Title: [143692] trunk/Source/WebCore
Revision
143692
Author
[email protected]
Date
2013-02-21 22:39:40 -0800 (Thu, 21 Feb 2013)

Log Message

Remove deep copy of ImageBuffer in tiled SVG backgrounds
https://bugs.webkit.org/show_bug.cgi?id=110549

Reviewed by Dirk Schulze.

SVGImage::drawPatternForContainer creates a temporary ImageBuffer for stamping out tiled
backgrounds. Previously this ImageBuffer was unnecessarily deep-copied! This patch uses a
shallow copy, taking advantage of the fact that the temporary ImageBuffer is never modified.

This patch is covered with existing tests.

* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawPatternForContainer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (143691 => 143692)


--- trunk/Source/WebCore/ChangeLog	2013-02-22 06:33:52 UTC (rev 143691)
+++ trunk/Source/WebCore/ChangeLog	2013-02-22 06:39:40 UTC (rev 143692)
@@ -1,3 +1,19 @@
+2013-02-21  Philip Rogers  <[email protected]>
+
+        Remove deep copy of ImageBuffer in tiled SVG backgrounds
+        https://bugs.webkit.org/show_bug.cgi?id=110549
+
+        Reviewed by Dirk Schulze.
+
+        SVGImage::drawPatternForContainer creates a temporary ImageBuffer for stamping out tiled
+        backgrounds. Previously this ImageBuffer was unnecessarily deep-copied! This patch uses a
+        shallow copy, taking advantage of the fact that the temporary ImageBuffer is never modified.
+
+        This patch is covered with existing tests.
+
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::drawPatternForContainer):
+
 2013-02-21  Antoine Quint  <[email protected]>
 
         Expose a list of all reasons that qualify a RenderLayer to be composited

Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (143691 => 143692)


--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp	2013-02-22 06:33:52 UTC (rev 143691)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp	2013-02-22 06:39:40 UTC (rev 143692)
@@ -158,7 +158,7 @@
 
     OwnPtr<ImageBuffer> buffer = ImageBuffer::create(expandedIntSize(imageBufferSize.size()), 1);
     drawForContainer(buffer->context(), containerSize, zoom, imageBufferSize, zoomedContainerRect, ColorSpaceDeviceRGB, CompositeSourceOver, BlendModeNormal);
-    RefPtr<Image> image = buffer->copyImage(CopyBackingStore, Unscaled);
+    RefPtr<Image> image = buffer->copyImage(DontCopyBackingStore, Unscaled);
 
     // Adjust the source rect and transform due to the image buffer's scaling.
     FloatRect scaledSrcRect = srcRect;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to