Reviewed by Vicki.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Jun 2005 22:46:55 +0000 (22:46 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Jun 2005 22:46:55 +0000 (22:46 +0000)
- replace more use of CGCompositeOperation that I missed.

        * WebCoreSupport.subproj/WebImageData.m:
        (-[WebImageData _checkSolidColor:]):
        (-[WebImageData _fillSolidColorInRect:compositeOperation:context:]):
        (-[WebImageData tileInRect:fromPoint:context:]):
        (-[WebImageData _PDFDrawFromRect:toRect:operation:alpha:flipped:context:]):
        * WebCoreSupport.subproj/WebImageRenderer.m:
        (-[WebInternalImage _PDFDrawFromRect:toRect:operation:alpha:flipped:]):

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

WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebImageData.m
WebKit/WebCoreSupport.subproj/WebImageRenderer.m

index dff65172216791e18206a56b45689171c14fd837..5818f9f629ec74597c09daf28d146b298d612f4d 100644 (file)
@@ -1,6 +1,20 @@
+2005-06-04  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Vicki.
+
+       - replace more use of CGCompositeOperation that I missed.
+       
+        * WebCoreSupport.subproj/WebImageData.m:
+        (-[WebImageData _checkSolidColor:]):
+        (-[WebImageData _fillSolidColorInRect:compositeOperation:context:]):
+        (-[WebImageData tileInRect:fromPoint:context:]):
+        (-[WebImageData _PDFDrawFromRect:toRect:operation:alpha:flipped:context:]):
+        * WebCoreSupport.subproj/WebImageRenderer.m:
+        (-[WebInternalImage _PDFDrawFromRect:toRect:operation:alpha:flipped:]):
+
 2005-06-03  Maciej Stachowiak  <mjs@apple.com>
 
-        Reviewed by NOBODY (OOPS!).
+        Reviewed by Dave.
 
        - replace use of CGCompositeOperation SPI with NSCompositingOperation API
 
index a1124ab11fb7601954f1ecd605b9051d54ed7b77..ca7644343ddaa93d3d075e7e1713249e1f31fb89 100644 (file)
@@ -12,7 +12,6 @@
 
 #import <WebCore/WebCoreImageRenderer.h>
 
-#import <CoreGraphics/CGContextGState.h>
 #import <CoreGraphics/CGColorSpacePrivate.h>
 
 #ifdef USE_CGIMAGEREF
         CGContextRef bmap = CGBitmapContextCreate(&pixel,1,1,8*sizeof(float),sizeof(pixel),space,
                                                   kCGImageAlphaPremultipliedLast | kCGBitmapFloatComponents);
         if( bmap ) {
-            CGContextSetCompositeOperation(bmap, kCGCompositeCopy);
+            [[NSGraphicsContext graphicsContextWithGraphicsPort:bmap flipped:NO] setCompositingOperation:NSCompositeCopy];
+
             CGRect dst = {{0,0},{1,1}};
             CGContextDrawImage(bmap,dst,image);
             if( pixel[3] > 0 )
     if( solidColor ) {
         CGContextSaveGState (aContext);
         CGContextSetFillColorWithColor(aContext, solidColor);
-        CGContextSetCompositeOperation (aContext, op);
+       [[NSGraphicsContext graphicsContextWithGraphicsPort:aContext flipped:NO] setCompositingOperation:op];
         CGContextFillRect (aContext, rect);
         CGContextRestoreGState (aContext);
     }
             }
             
             // Flip the coords.
-            CGContextSetCompositeOperation (aContext, op);
+            [[NSGraphicsContext graphicsContextWithGraphicsPort:aContext flipped:NO] setCompositingOperation:op];
             CGContextTranslateCTM (aContext, ir.origin.x, ir.origin.y);
             CGContextScaleCTM (aContext, 1, -1);
             CGContextTranslateCTM (aContext, 0, -ir.size.height);
@@ -571,7 +571,7 @@ static const CGPatternCallbacks patternCallbacks = { 0, drawPattern, NULL };
     }
 
     if( frame == 0 && isSolidColor ) {
-        [self _fillSolidColorInRect: rect compositeOperation: kCGCompositeSover context: aContext];
+        [self _fillSolidColorInRect: rect compositeOperation: NSCompositeSourceOver context: aContext];
         
     } else {
         CGSize tileSize = [self size];
@@ -593,7 +593,7 @@ static const CGPatternCallbacks patternCallbacks = { 0, drawPattern, NULL };
 
             [decodeLock unlock];
             
-            [self drawImageAtIndex:[self currentFrame] inRect:rect fromRect:fromRect compositeOperation:kCGCompositeSover context:aContext];
+            [self drawImageAtIndex:[self currentFrame] inRect:rect fromRect:fromRect compositeOperation:NSCompositeSourceOver context:aContext];
 
             return;
         }
@@ -623,7 +623,7 @@ static const CGPatternCallbacks patternCallbacks = { 0, drawPattern, NULL };
             float patternAlpha = 1;
             CGContextSetFillPattern(aContext, pattern, &patternAlpha);
 
-            CGContextSetCompositeOperation (aContext, kCGCompositeSover);
+            [[NSGraphicsContext graphicsContextWithGraphicsPort:aContext flipped:NO] setCompositingOperation:NSCompositeSourceOver];
 
             CGContextFillRect (aContext, rect);
 
@@ -971,7 +971,7 @@ static NSMutableSet *activeAnimations;
 
     CGContextSaveGState(context);
 
-    CGContextSetCompositeOperation (context, op);
+    [[NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO] setCompositingOperation:op];
 
     // Scale and translate so the document is rendered in the correct location.
     hScale = dstRect.size.width  / srcRect.size.width;
index 13e1f65f1ec69acf0fb478dad0409ee6f6d20df0..81d885e3e97825cc09dca7fb6874941ed090f865 100644 (file)
@@ -1,3 +1,4 @@
+
 /*     
         WebImageRenderer.m
        Copyright (c) 2002, 2003, Apple, Inc. All rights reserved.
@@ -931,8 +932,7 @@ static NSMutableSet *activeImageRenderers;
 
     CGContextSaveGState(_context);
 
-    CGContextSetCompositeOperation (_context, op);
-
+    [[NSGraphicsContext currentContext] setCompositingOperation:op];
     // Scale and translate so the document is rendered in the correct location.
     hScale = dstRect.size.width  / srcRect.size.width;
     vScale = dstRect.size.height / srcRect.size.height;