From 29df16cc66470ae7915154189e32cbc7703871dd Mon Sep 17 00:00:00 2001 From: mjs Date: Sat, 4 Jun 2005 22:46:55 +0000 Subject: [PATCH] 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:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9270 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKit/ChangeLog | 16 +++++++++++++++- WebKit/WebCoreSupport.subproj/WebImageData.m | 16 ++++++++-------- WebKit/WebCoreSupport.subproj/WebImageRenderer.m | 4 ++-- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index dff651722167..5818f9f629ec 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,6 +1,20 @@ +2005-06-04 Maciej Stachowiak + + 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 - Reviewed by NOBODY (OOPS!). + Reviewed by Dave. - replace use of CGCompositeOperation SPI with NSCompositingOperation API diff --git a/WebKit/WebCoreSupport.subproj/WebImageData.m b/WebKit/WebCoreSupport.subproj/WebImageData.m index a1124ab11fb7..ca7644343dda 100644 --- a/WebKit/WebCoreSupport.subproj/WebImageData.m +++ b/WebKit/WebCoreSupport.subproj/WebImageData.m @@ -12,7 +12,6 @@ #import -#import #import #ifdef USE_CGIMAGEREF @@ -275,7 +274,8 @@ 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 ) @@ -448,7 +448,7 @@ if( solidColor ) { CGContextSaveGState (aContext); CGContextSetFillColorWithColor(aContext, solidColor); - CGContextSetCompositeOperation (aContext, op); + [[NSGraphicsContext graphicsContextWithGraphicsPort:aContext flipped:NO] setCompositingOperation:op]; CGContextFillRect (aContext, rect); CGContextRestoreGState (aContext); } @@ -502,7 +502,7 @@ } // 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; diff --git a/WebKit/WebCoreSupport.subproj/WebImageRenderer.m b/WebKit/WebCoreSupport.subproj/WebImageRenderer.m index 13e1f65f1ec6..81d885e3e978 100644 --- a/WebKit/WebCoreSupport.subproj/WebImageRenderer.m +++ b/WebKit/WebCoreSupport.subproj/WebImageRenderer.m @@ -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; -- 2.36.0