+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
#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);
}
if( frame == 0 && isSolidColor ) {
- [self _fillSolidColorInRect: rect compositeOperation: kCGCompositeSover context: aContext];
+ [self _fillSolidColorInRect: rect compositeOperation: NSCompositeSourceOver context: aContext];
} else {
CGSize tileSize = [self size];
[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;
}
float patternAlpha = 1;
CGContextSetFillPattern(aContext, pattern, &patternAlpha);
- CGContextSetCompositeOperation (aContext, kCGCompositeSover);
+ [[NSGraphicsContext graphicsContextWithGraphicsPort:aContext flipped:NO] setCompositingOperation:NSCompositeSourceOver];
CGContextFillRect (aContext, rect);
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;