[prev in list] [next in list] [prev in thread] [next in thread]
List: cairo-commit
Subject: [cairo-commit] src/cairo-image-surface.c
From: company () kemper ! freedesktop ! org (Benjamin Otte)
Date: 2009-09-23 15:41:40
Message-ID: 20090923154140.9471210051 () kemper ! freedesktop ! org
[Download RAW message or body]
src/cairo-image-surface.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
New commits:
commit ab558fa843accc440686f7b8eda197277a6a4eb2
Author: Benjamin Otte <otte@gnome.org>
Date: Wed Sep 23 17:40:17 2009 +0200
[image] Move setting of is_clear to _create_with_pixman_format()
Simplifies code and ensures other users of that function don't run into
the same bug.
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 8ad259d..9156349 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -391,7 +391,8 @@ _cairo_image_surface_create_with_pixman_format (unsigned char *data,
if (cairo_surface_status (surface))
pixman_image_unref (pixman_image);
else
- ((cairo_image_surface_t *)surface)->is_clear = TRUE;
+ /* we can not make any assumptions by the initial state of the data */
+ ((cairo_image_surface_t *)surface)->is_clear = (data != NULL);
return surface;
}
@@ -542,7 +543,6 @@ cairo_image_surface_create_for_data (unsigned char *data,
int stride)
{
pixman_format_code_t pixman_format;
- cairo_surface_t *surface;
int minstride;
if (! CAIRO_FORMAT_VALID (format))
@@ -563,16 +563,10 @@ cairo_image_surface_create_for_data (unsigned char *data,
}
pixman_format = _cairo_format_to_pixman_format_code (format);
- surface = _cairo_image_surface_create_with_pixman_format (data,
- pixman_format,
- width, height,
- stride);
- if (unlikely (surface->status))
- return surface;
-
- /* we can not make any assumptions by the initial state of the data */
- ((cairo_image_surface_t *) surface)->is_clear = FALSE;
- return surface;
+ return _cairo_image_surface_create_with_pixman_format (data,
+ pixman_format,
+ width, height,
+ stride);
}
slim_hidden_def (cairo_image_surface_create_for_data);
_______________________________________________
cairo-commit mailing list
cairo-commit@lists.cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo-commit
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic