Title: [193390] trunk/Source/WebCore
Revision
193390
Author
[email protected]
Date
2015-12-03 16:49:48 -0800 (Thu, 03 Dec 2015)

Log Message

Remove the use of GraphicsContextStateSaver from RenderLayer::paintLayerByApplyingTransform
https://bugs.webkit.org/show_bug.cgi?id=151829

Patch by Said Abou-Hallawa <[email protected]> on 2015-12-03
Reviewed by Simon Fraser.

Set the CTM of the GraphicsContext to its original value before changing
it. This is a lot cheaper than using GraphicsContextStateSaver to save the
whole state of the GraphicsContext and restore it back;

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerByApplyingTransform):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (193389 => 193390)


--- trunk/Source/WebCore/ChangeLog	2015-12-04 00:34:55 UTC (rev 193389)
+++ trunk/Source/WebCore/ChangeLog	2015-12-04 00:49:48 UTC (rev 193390)
@@ -1,3 +1,17 @@
+2015-12-03  Said Abou-Hallawa  <[email protected]>
+
+        Remove the use of GraphicsContextStateSaver from RenderLayer::paintLayerByApplyingTransform
+        https://bugs.webkit.org/show_bug.cgi?id=151829
+
+        Reviewed by Simon Fraser.
+
+        Set the CTM of the GraphicsContext to its original value before changing
+        it. This is a lot cheaper than using GraphicsContextStateSaver to save the
+        whole state of the GraphicsContext and restore it back;
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintLayerByApplyingTransform):
+
 2015-12-03  Eric Carlson  <[email protected]>
 
         [MediaStream] Update MediaStreamTrack.getCapabilities

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (193389 => 193390)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2015-12-04 00:34:55 UTC (rev 193389)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2015-12-04 00:49:48 UTC (rev 193390)
@@ -4405,7 +4405,7 @@
     // Translate the graphics context to the snapping position to avoid off-device-pixel positing.
     transform.translateRight(devicePixelSnappedOffsetForThisLayer.width(), devicePixelSnappedOffsetForThisLayer.height());
     // Apply the transform.
-    GraphicsContextStateSaver stateSaver(context);
+    AffineTransform oldTransfrom = context.getCTM();
     context.concatCTM(transform.toAffineTransform());
 
     // Now do a paint with the root layer shifted to be us.
@@ -4413,6 +4413,7 @@
     LayerPaintingInfo transformedPaintingInfo(this, LayoutRect(encloseRectToDevicePixels(transform.inverse().valueOr(AffineTransform()).mapRect(paintingInfo.paintDirtyRect), deviceScaleFactor)),
         paintingInfo.paintBehavior, adjustedSubpixelAccumulation, paintingInfo.subtreePaintRoot, paintingInfo.overlapTestRequests);
     paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags);
+    context.setCTM(oldTransfrom);
 }
 
 void RenderLayer::paintList(Vector<RenderLayer*>* list, GraphicsContext& context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to