Commit efa2c800 authored by simon.fraser@apple.com's avatar simon.fraser@apple.com
Browse files

Repaint counters are sometimes not in the corner of the compositing layer

https://bugs.webkit.org/show_bug.cgi?id=120176

Reviewed by Beth Dakin.

Sometimes the repaint counters are not in the corner of the compositing layer;
they are either inset, or partially or entirely outside the layer.

Fix by making sure that we restore the CGContext before drawing
the counter, since the WebCore code may have translated the CTM.

The counter-painting code saves and restores the context itself,
so this is safe.

* platform/graphics/mac/WebLayer.mm:
(drawLayerContents):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 35e061d8
2013-08-22 Simon Fraser <simon.fraser@apple.com>
Repaint counters are sometimes not in the corner of the compositing layer
https://bugs.webkit.org/show_bug.cgi?id=120176
Reviewed by Beth Dakin.
Sometimes the repaint counters are not in the corner of the compositing layer;
they are either inset, or partially or entirely outside the layer.
Fix by making sure that we restore the CGContext before drawing
the counter, since the WebCore code may have translated the CTM.
The counter-painting code saves and restores the context itself,
so this is safe.
* platform/graphics/mac/WebLayer.mm:
(drawLayerContents):
2013-08-22 Tim Horton <timothy_horton@apple.com> 2013-08-22 Tim Horton <timothy_horton@apple.com>
   
Unavailable plug-in indicator text is one pixel too low Unavailable plug-in indicator text is one pixel too low
...@@ -126,6 +126,8 @@ void drawLayerContents(CGContextRef context, CALayer *layer, WebCore::PlatformCA ...@@ -126,6 +126,8 @@ void drawLayerContents(CGContextRef context, CALayer *layer, WebCore::PlatformCA
layerContents = platformLayer->owner(); layerContents = platformLayer->owner();
ASSERT(layerContents); ASSERT(layerContents);
CGContextRestoreGState(context);
// Always update the repain count so that it's accurate even if the count itself is not shown. This will be useful // Always update the repain count so that it's accurate even if the count itself is not shown. This will be useful
// for the Web Inspector feeding this information through the LayerTreeAgent. // for the Web Inspector feeding this information through the LayerTreeAgent.
int repaintCount = layerContents->platformCALayerIncrementRepaintCount(); int repaintCount = layerContents->platformCALayerIncrementRepaintCount();
...@@ -166,8 +168,6 @@ void drawLayerContents(CGContextRef context, CALayer *layer, WebCore::PlatformCA ...@@ -166,8 +168,6 @@ void drawLayerContents(CGContextRef context, CALayer *layer, WebCore::PlatformCA
CGContextEndTransparencyLayer(context); CGContextEndTransparencyLayer(context);
CGContextRestoreGState(context); CGContextRestoreGState(context);
} }
CGContextRestoreGState(context);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment