Changeset 109186 in webkit
- Timestamp:
- Feb 28, 2012, 8:46:47 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/mac/WebLayer.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109184 r109186 1 2012-02-28 Simon Fraser <simon.fraser@apple.com> 2 3 Optimize the rects being drawn into compositing layers 4 https://bugs.webkit.org/show_bug.cgi?id=79852 5 6 Reviewed by Dan Bernstein. 7 8 Use the newly added WebKitSystemInterface method 9 to limit the area being painted in a CALayer 10 -drawInContext callback. This avoids redundant drawing, 11 for performance. 12 13 * platform/graphics/mac/WebLayer.mm: 14 (drawLayerContents): 15 1 16 2012-02-28 Simon Fraser <simon.fraser@apple.com> 2 17 -
trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm
r106304 r109186 36 36 #import <QuartzCore/QuartzCore.h> 37 37 #import <wtf/UnusedParam.h> 38 #import "WebCoreSystemInterface.h" 38 39 39 40 @interface CALayer(WebCoreCALayerPrivate) … … 77 78 // It's important to get the clip from the context, because it may be significantly 78 79 // smaller than the layer bounds (e.g. tiled layers) 79 CGRect clipBounds = CGContextGetClipBoundingBox(context); 80 IntRect clip(enclosingIntRect(clipBounds)); 80 FloatRect clipBounds = CGContextGetClipBoundingBox(context); 81 82 #if !defined(BUILDING_ON_SNOW_LEOPARD) 83 __block GraphicsContext* ctx = &graphicsContext; 84 85 wkCALayerEnumerateRectsBeingDrawnWithBlock(layer, context, ^(CGRect rect){ 86 FloatRect rectBeingDrawn(rect); 87 rectBeingDrawn.intersect(clipBounds); 88 89 GraphicsContextStateSaver stateSaver(*ctx); 90 ctx->clip(rectBeingDrawn); 91 92 layerContents->platformCALayerPaintContents(*ctx, enclosedIntRect(rectBeingDrawn)); 93 }); 94 #else 95 IntRect clip(enclosedIntRect(clipBounds)); 81 96 layerContents->platformCALayerPaintContents(graphicsContext, clip); 97 #endif 82 98 83 99 [NSGraphicsContext restoreGraphicsState];
Note:
See TracChangeset
for help on using the changeset viewer.