From 7804ce7d1ad36624554787a46ed6263663565266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Fri, 6 Jun 2008 12:53:35 +0000 Subject: [PATCH] =?UTF-8?q?*=20clutter/cogl/common/cogl-bitmap-pixbuf.c:?= =?UTF-8?q?=20(=5Fcogl=5Fbitmap=5Ffrom=5Ffile):=20allocate=20height=C3=97r?= =?UTF-8?q?owstride=20and=20not=20duplicate=20gdkpixbuf's=20strange=20opti?= =?UTF-8?q?mization=20saving=20some=20bytes=20at=20the=20end=20of=20the=20?= =?UTF-8?q?pixbuf.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 7 +++++++ clutter/cogl/common/cogl-bitmap-pixbuf.c | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc59d90a4..a8366cd9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-06 Øyvind Kolås + + * clutter/cogl/common/cogl-bitmap-pixbuf.c: + (_cogl_bitmap_from_file): allocate height×rowstride and not duplicate + gdkpixbuf's strange optimization saving some bytes at the end of the + pixbuf. + 2008-06-05 Tommi Komulainen Bug 913 - cogl fails to build on OSX diff --git a/clutter/cogl/common/cogl-bitmap-pixbuf.c b/clutter/cogl/common/cogl-bitmap-pixbuf.c index 923788607..906cee01b 100644 --- a/clutter/cogl/common/cogl-bitmap-pixbuf.c +++ b/clutter/cogl/common/cogl-bitmap-pixbuf.c @@ -134,7 +134,7 @@ _cogl_bitmap_from_file (CoglBitmap *bmp, /* FIXME: Any way to destroy pixbuf but retain pixel data? */ pixels = gdk_pixbuf_get_pixels (pixbuf); - out_data = (guchar*) g_malloc ((height - 1) * rowstride + last_row_size); + out_data = (guchar*) g_malloc (height * rowstride); out = out_data; /* Copy up to last row */ @@ -152,7 +152,10 @@ _cogl_bitmap_from_file (CoglBitmap *bmp, g_object_unref (pixbuf); /* Store bitmap info */ - bmp->data = out_data; + bmp->data = out_data; /* The stored data the same alignment constraints as a + * gdkpixbuf but stores a full rowstride in the last + * scanline + */ bmp->format = pixel_format; bmp->width = width; bmp->height = height;