Reviewed by Sam Weinig, Dan Bernstein.
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2007 00:02:51 +0000 (00:02 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2007 00:02:51 +0000 (00:02 +0000)
        Tiger build fix: restored some graphics code still needed on Tiger.

        * platform/graphics/GraphicsTypes.h:
        * platform/graphics/cg/GraphicsContextCG.cpp:
        * platform/graphics/mac/GraphicsContextMac.mm:
        (WebCore::GraphicsContext::setCompositeOperation):

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

WebCore/ChangeLog
WebCore/platform/graphics/GraphicsTypes.h
WebCore/platform/graphics/cg/GraphicsContextCG.cpp
WebCore/platform/graphics/mac/GraphicsContextMac.mm

index 5a6074e0cb73b44db7fece89f51a15b6b863611f..85c7f792118a4444847c7fdcb35ac814b18909a0 100644 (file)
@@ -1,3 +1,14 @@
+2007-12-19  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig, Dan Bernstein.
+
+        Tiger build fix: restored some graphics code still needed on Tiger.
+
+        * platform/graphics/GraphicsTypes.h:
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        * platform/graphics/mac/GraphicsContextMac.mm:
+        (WebCore::GraphicsContext::setCompositeOperation):
+
 2007-12-19  Alp Toker  <alp@atoker.com>
 
         Build fix for Pango < 1.18.0 breakage introduced in r28864. Use Fc and
index a7b66f50fbf26d34dc5158a13315fee2663f303f..b3ca99a848d56d6c6de1ab5196445f4b6710febe 100644 (file)
@@ -30,6 +30,9 @@ namespace WebCore {
 
     class String;
 
+    // Note: These constants exactly match the NSCompositeOperator constants of
+    // AppKit on Mac OS X Tiger. If these ever change, we'll need to change the
+    // Mac OS X Tiger platform code to map one to the other.
     enum CompositeOperator {
         CompositeClear,
         CompositeCopy,
index 077ec0240c49fdcfbd85e4b719a6319e79c4965c..177d727bf3acdd08923aa05859aa445fba4b0463 100644 (file)
@@ -868,6 +868,7 @@ void GraphicsContext::setUseAntialiasing(bool enable)
     CGContextSetShouldAntialias(platformContext(), enable);
 }
 
+#ifndef BUILDING_ON_TIGER // Tiger's setCompositeOperation() is defined in GraphicsContextMac.mm.
 void GraphicsContext::setCompositeOperation(CompositeOperator mode)
 {   
     if (paintingDisabled())
@@ -920,6 +921,7 @@ void GraphicsContext::setCompositeOperation(CompositeOperator mode)
     }
     CGContextSetBlendMode(platformContext(), target);
 }
+#endif
     
 }
 
index eca6451a8b8f786f8b80dd3d5befbadab93882fa..25d1e8debdad6033d3703469e63ad6f4817c6701 100644 (file)
@@ -69,6 +69,18 @@ void GraphicsContext::drawFocusRing(const Color& color)
     CGPathRelease(focusRingPath);
 }
 
+#ifdef BUILDING_ON_TIGER // Post-Tiger's setCompositeOperation() is defined in GraphicsContextCG.cpp.
+void GraphicsContext::setCompositeOperation(CompositeOperator op)
+{
+    if (paintingDisabled())
+        return;
+    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+    [[NSGraphicsContext graphicsContextWithGraphicsPort:platformContext() flipped:YES]
+        setCompositingOperation:(NSCompositingOperation)op];
+    [pool drain];
+}
+#endif
 void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& point, int width, bool grammar)
 {
     if (paintingDisabled())