Bug 18626 - Regression in swfdec_renderer_transform()
Summary: Regression in swfdec_renderer_transform()
Status: RESOLVED FIXED
Alias: None
Product: swfdec
Classification: Unclassified
Component: library (show other bugs)
Version: git
Hardware: All All
: medium critical
Assignee: swfdec ml
QA Contact: swfdec ml
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-19 13:35 UTC by Chris Wilson
Modified: 2008-11-20 03:05 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Chris Wilson 2008-11-19 13:35:09 UTC
commit 90dab77f5639ee9d3d75eb739557350aa432e353 changed the target surface format from always ARGB32 to depend upon whether the source surface has an alpha channel. This fails to take into account the result of the color transformation which may require the alpha channel.

The simple fix would be:
diff --git a/swfdec/swfdec_renderer.c b/swfdec/swfdec_renderer.c
index 787e592..dcf74dd 100644
--- a/swfdec/swfdec_renderer.c
+++ b/swfdec/swfdec_renderer.c
@@ -424,11 +424,10 @@ swfdec_renderer_transform (SwfdecRenderer *renderer, cairo_surface_t *surface,
 
   /* FIXME: This function should likely be a vfunc. 
    * Or better: it should compile to a shader */
+  target = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, rect->width, rect->height);
   if (cairo_surface_get_content (surface) & CAIRO_CONTENT_ALPHA) {
-    target = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, rect->width, rect->height);
     mask = 0;
   } else {
-    target = cairo_image_surface_create (CAIRO_FORMAT_RGB24, rect->width, rect->height);
     mask = SWFDEC_COLOR_COMBINE (0, 0, 0, 0xFF);
   }
   cairo_surface_set_device_offset (target, -rect->x, -rect->y);
Comment 1 Benjamin Otte 2008-11-20 03:05:37 UTC
fixed in git master

In a possibly way smarter way, too!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.