Remove FLASH_SUBTRACT blend mode.
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Tue, 23 Jun 2009 18:39:49 +0000 (14:39 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Tue, 23 Jun 2009 18:45:28 +0000 (14:45 -0400)
We may resurrect it later, but leave it out for now, as the closest
thing we have to a spec:

http://www.kaourantin.net/2005/09/some-word-on-blend-modes-in-flash.html

claims that alpha values should be subtracted, whereas real-world flash
files indicate that they shouldn't.

pixman/pixman-combine.c.template
pixman/pixman.h

index f80e1a9..ee724d9 100644 (file)
@@ -1015,77 +1015,6 @@ PdfNonSeparableBlendMode (HSLLuminosity)
 #undef Min
 #undef PdfNonSeparableBlendMode
 
-/*
- * Flash Subtract:
- * This is the only blend mode present in Adobe Flash that is not part of 
- * the PDF specification. It has been reverse engineered from looking at 
- * Flash files. Some information can be found at
- * http://www.kaourantin.net/2005/09/some-word-on-blend-modes-in-flash.html
- */
-#define Subtract(res, Color)                                           \
-    do {                                                               \
-      comp1_t dc, sc;                                                  \
-      dc = Color (d);                                                  \
-      sc = Color (s);                                                  \
-      if (sc >= dc)                                                    \
-       res = 0;                                                        \
-      else                                                             \
-       res = dc - sc;                                                  \
-    } while (0)
-
-static void
-fbCombineFlashSubtractU (pixman_implementation_t *imp, pixman_op_t op,
-                        comp4_t *dest, const comp4_t *src, const comp4_t *mask, int width)
-{
-    int i;
-
-    for (i = 0; i < width; ++i) {
-       comp4_t d, s;
-       comp4_t r, g, b;
-
-       d = *(dest + i);
-       s = combineMask (src, mask, i);
-
-       Subtract (r, Red);
-       Subtract (g, Green);
-       Subtract (b, Blue);
-
-       *(dest + i) = (Alpha (d) << A_SHIFT)
-           | (r << R_SHIFT)
-           | (g << G_SHIFT)
-           | b;
-    }
-}
-
-static void
-fbCombineFlashSubtractC (pixman_implementation_t *imp, pixman_op_t op,
-                        comp4_t *dest, const comp4_t *src, const comp4_t *mask, int width)
-{
-    int i;
-
-    for (i = 0; i < width; ++i) {
-       comp4_t d, s, m;
-       comp4_t r, g, b;
-
-       d = *(dest + i);
-       s = *(src + i);
-       m = *(mask + i);
-
-       fbCombineMaskValueC (&s, &m);
-
-       Subtract (r, Red);
-       Subtract (g, Green);
-       Subtract (b, Blue);
-
-       *(dest + i) = (Alpha (d) << A_SHIFT)
-           | (r << R_SHIFT)
-           | (g << G_SHIFT)
-           | b;
-    }
-}
-
-#undef Subtract
-
 /* Overlay
  *
  * All of the disjoint composing functions
@@ -2071,7 +2000,6 @@ _pixman_setup_combiner_functions_width (pixman_implementation_t *imp)
     imp->combine_width[PIXMAN_OP_HSL_SATURATION] = fbCombineHSLSaturationU;
     imp->combine_width[PIXMAN_OP_HSL_COLOR] = fbCombineHSLColorU;
     imp->combine_width[PIXMAN_OP_HSL_LUMINOSITY] = fbCombineHSLLuminosityU;
-    imp->combine_width[PIXMAN_OP_FLASH_SUBTRACT] = fbCombineFlashSubtractU;
 
     /* Component alpha combiners */
     imp->combine_width_ca[PIXMAN_OP_CLEAR] = fbCombineClearC;
@@ -2132,7 +2060,6 @@ _pixman_setup_combiner_functions_width (pixman_implementation_t *imp)
     imp->combine_width_ca[PIXMAN_OP_HSL_SATURATION] = fbCombineHSLSaturationC;
     imp->combine_width_ca[PIXMAN_OP_HSL_COLOR] = fbCombineHSLColorC;
     imp->combine_width_ca[PIXMAN_OP_HSL_LUMINOSITY] = fbCombineHSLLuminosityC;
-    imp->combine_width_ca[PIXMAN_OP_FLASH_SUBTRACT] = fbCombineFlashSubtractC;
 }
 
 
index 93e3d11..0d602c8 100644 (file)
@@ -383,7 +383,6 @@ typedef enum
     PIXMAN_OP_HSL_SATURATION           = 0x3c,
     PIXMAN_OP_HSL_COLOR                        = 0x3d,
     PIXMAN_OP_HSL_LUMINOSITY           = 0x3e,
-    PIXMAN_OP_FLASH_SUBTRACT           = 0x3f,
 
     PIXMAN_OP_NONE,
     PIXMAN_OP_LAST = PIXMAN_OP_NONE