2007-12-19 Alp Toker <alp@atoker.com>
authoralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2007 16:55:58 +0000 (16:55 +0000)
committeralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2007 16:55:58 +0000 (16:55 +0000)
        Reviewed by Holger Freyther.

        Improve graphics operator approximations

        These changes match Cairo's own CG approximations.

        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::toCairoOperator):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28861 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp

index 508bfad7f4d2a939de52e012bddf803a734a1ff9..1526d104db2585fef6ea67dfcfee41a8a12fcb49 100644 (file)
@@ -1,3 +1,14 @@
+2007-12-19  Alp Toker  <alp@atoker.com>
+
+        Reviewed by Holger Freyther.
+
+        Improve graphics operator approximations
+        
+        These changes match Cairo's own CG approximations.
+
+        * platform/graphics/cairo/GraphicsContextCairo.cpp:
+        (WebCore::toCairoOperator):
+
 2007-12-19  Alp Toker  <alp@atoker.com>
 
         Reviewed by Holger Freyther.
index bae71f924f0fe2616e7bde17e939c7a2c1debec6..29365c3755ea04216fa675a342d3a7ec806644ca 100644 (file)
@@ -756,14 +756,15 @@ static inline cairo_operator_t toCairoOperator(CompositeOperator op)
         case CompositeXOR:
             return CAIRO_OPERATOR_XOR;
         case CompositePlusDarker:
-            return CAIRO_OPERATOR_OVER;
+            return CAIRO_OPERATOR_SATURATE;
         case CompositeHighlight:
+            // There is no Cairo equivalent for CompositeHighlight.
             return CAIRO_OPERATOR_OVER;
         case CompositePlusLighter:
-            return CAIRO_OPERATOR_OVER;
+            return CAIRO_OPERATOR_ADD;
+        default:
+            return CAIRO_OPERATOR_SOURCE;
     }
-
-    return CAIRO_OPERATOR_OVER;
 }
 
 void GraphicsContext::setCompositeOperation(CompositeOperator op)