[Swfdec-commits] 2 commits - swfdec/swfdec_color.c swfdec/swfdec_image.c

Benjamin Otte company at kemper.freedesktop.org
Mon Jul 28 03:33:49 PDT 2008


 swfdec/swfdec_color.c |   13 ++++++-------
 swfdec/swfdec_image.c |    2 +-
 2 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit ad640aefd36021f16de0972d3447e2d8059584b5
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Jul 28 12:13:09 2008 +0200

    revert the previous change to how transparent pixels are handled
    
    Turns out only transparent pixels on a BitmapData object that have never
    been set work like this.
    Who'd have thought? ;o

diff --git a/swfdec/swfdec_color.c b/swfdec/swfdec_color.c
index 5e5aef4..7bc8654 100644
--- a/swfdec/swfdec_color.c
+++ b/swfdec/swfdec_color.c
@@ -66,13 +66,12 @@ swfdec_color_apply_transform_premultiplied (SwfdecColor in,
     return SWFDEC_COLOR_COMBINE (0, 0, 0, 255);
 
   aold = SWFDEC_COLOR_ALPHA (in);
-  if (aold == 0) {
-    aold = r = g = b = 0xFF;
-  } else {
-    r = SWFDEC_COLOR_RED (in);
-    g = SWFDEC_COLOR_GREEN (in);
-    b = SWFDEC_COLOR_BLUE (in);
-  }
+  if (aold == 0)
+    return 0;
+    
+  r = SWFDEC_COLOR_RED (in);
+  g = SWFDEC_COLOR_GREEN (in);
+  b = SWFDEC_COLOR_BLUE (in);
 
   a = (aold * trans->aa >> 8) + trans->ab;
   a = CLAMP (a, 0, 255);
commit 95c5077f50eb163c72387efe61b6d5faa10765ee
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Jul 28 12:12:41 2008 +0200

    convert the surface that does exist.
    
    Yes, this caused a SEGV in the testsuite.

diff --git a/swfdec/swfdec_image.c b/swfdec/swfdec_image.c
index 966b6fd..d1e7bae 100644
--- a/swfdec/swfdec_image.c
+++ b/swfdec/swfdec_image.c
@@ -689,7 +689,7 @@ swfdec_image_create_surface_transformed (SwfdecImage *image, SwfdecRenderer *ren
     }
   }
 
-  surface = swfdec_renderer_transform (renderer, surface, trans);
+  surface = swfdec_renderer_transform (renderer, source, trans);
   if (renderer) {
     surface = swfdec_renderer_create_similar (renderer, surface);
     /* FIXME: The size is just an educated guess */


More information about the Swfdec-commits mailing list