Title: [125708] trunk/Source/WebCore
Revision
125708
Author
[email protected]
Date
2012-08-15 14:22:01 -0700 (Wed, 15 Aug 2012)

Log Message

NinePieceImage: Avoid unnecessary duplication of default data in assignment operator.
<http://webkit.org/b/94046>

Reviewed by Geoffrey Garen.

If copying a NinePieceImage with a null m_data, don't create a copy of it's data()
as that will point to the default NinePieceImageData. ~200kB progression on Membuster.

* rendering/style/NinePieceImage.h:
(WebCore::NinePieceImage::operator=):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125707 => 125708)


--- trunk/Source/WebCore/ChangeLog	2012-08-15 21:20:42 UTC (rev 125707)
+++ trunk/Source/WebCore/ChangeLog	2012-08-15 21:22:01 UTC (rev 125708)
@@ -1,3 +1,16 @@
+2012-08-15  Andreas Kling  <[email protected]>
+
+        NinePieceImage: Avoid unnecessary duplication of default data in assignment operator.
+        <http://webkit.org/b/94046>
+
+        Reviewed by Geoffrey Garen.
+
+        If copying a NinePieceImage with a null m_data, don't create a copy of it's data()
+        as that will point to the default NinePieceImageData. ~200kB progression on Membuster.
+
+        * rendering/style/NinePieceImage.h:
+        (WebCore::NinePieceImage::operator=):
+
 2012-08-15  Gregg Tavares  <[email protected]>
 
         Mark Skia and Compositor Contexts

Modified: trunk/Source/WebCore/rendering/style/NinePieceImage.h (125707 => 125708)


--- trunk/Source/WebCore/rendering/style/NinePieceImage.h	2012-08-15 21:20:42 UTC (rev 125707)
+++ trunk/Source/WebCore/rendering/style/NinePieceImage.h	2012-08-15 21:22:01 UTC (rev 125708)
@@ -85,6 +85,10 @@
 
     void operator=(const NinePieceImage& other)
     {
+        if (!other.m_data) {
+            m_data.clear();
+            return;
+        }
         const NinePieceImageData& otherData = other.data();
         m_data = adoptPtr(new NinePieceImageData(otherData.m_image, otherData.m_imageSlices, otherData.m_fill, otherData.m_borderSlices, otherData.m_outset, static_cast<ENinePieceImageRule>(otherData.m_horizontalRule), static_cast<ENinePieceImageRule>(otherData.m_verticalRule)));
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to