Title: [106804] trunk/Source/WebCore
Revision
106804
Author
noam.rosent...@nokia.com
Date
2012-02-06 06:18:14 -0800 (Mon, 06 Feb 2012)

Log Message

[Qt] Implement ImageBuffer::copyImage(ImageBuffer::DontCopyBackingStore)
https://bugs.webkit.org/show_bug.cgi?id=77689

Reviewed by Kenneth Rohde Christiansen.

Use StillImageQt::createForRendering when using DontCopyBackingStore.
Enable DontCopyBackingStore in TextureMapperNode.
This removes deep copies resulting from the use of ImageBuffer.

Instrumentation shows that deep image copies resulted from ImageBuffer are eliminated.

* platform/graphics/qt/ImageBufferQt.cpp:
(WebCore::ImageBuffer::copyImage):
* platform/graphics/texmap/TextureMapperNode.cpp:
(WebCore::TextureMapperNode::renderContent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106803 => 106804)


--- trunk/Source/WebCore/ChangeLog	2012-02-06 14:07:27 UTC (rev 106803)
+++ trunk/Source/WebCore/ChangeLog	2012-02-06 14:18:14 UTC (rev 106804)
@@ -1,3 +1,21 @@
+2012-02-06  No'am Rosenthal  <noam.rosent...@nokia.com>
+
+        [Qt] Implement ImageBuffer::copyImage(ImageBuffer::DontCopyBackingStore)
+        https://bugs.webkit.org/show_bug.cgi?id=77689
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Use StillImageQt::createForRendering when using DontCopyBackingStore.
+        Enable DontCopyBackingStore in TextureMapperNode.
+        This removes deep copies resulting from the use of ImageBuffer.
+
+        Instrumentation shows that deep image copies resulted from ImageBuffer are eliminated.
+
+        * platform/graphics/qt/ImageBufferQt.cpp:
+        (WebCore::ImageBuffer::copyImage):
+        * platform/graphics/texmap/TextureMapperNode.cpp:
+        (WebCore::TextureMapperNode::renderContent):
+
 2012-02-06  Allan Sandfeld Jensen  <allan.jen...@nokia.com>
 
         WebGestureEvent can not encode delta and area.

Modified: trunk/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp (106803 => 106804)


--- trunk/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp	2012-02-06 14:07:27 UTC (rev 106803)
+++ trunk/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp	2012-02-06 14:18:14 UTC (rev 106804)
@@ -123,8 +123,10 @@
 
 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior) const
 {
-    ASSERT(copyBehavior == CopyBackingStore);
-    return StillImage::create(m_data.m_pixmap);
+    if (copyBehavior == CopyBackingStore)
+        return StillImage::create(m_data.m_pixmap);
+
+    return StillImage::createForRendering(&m_data.m_pixmap);
 }
 
 void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp (106803 => 106804)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp	2012-02-06 14:07:27 UTC (rev 106803)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp	2012-02-06 14:18:14 UTC (rev 106804)
@@ -186,10 +186,15 @@
     if (m_currentContent.contentType == DirectImageContentType)
         context->drawImage(m_currentContent.image.get(), ColorSpaceDeviceRGB, m_state.contentsRect);
 
-    // FIXME: Implement ImageBuffer::DontCopyBackingStore in Qt/GTK ports, and then change this.
-    // See https://bugs.webkit.org/show_bug.cgi?id=77689
-    RefPtr<Image> image = imageBuffer->copyImage(CopyBackingStore);
+    RefPtr<Image> image;
 
+#if PLATFORM(QT)
+    image = imageBuffer->copyImage(DontCopyBackingStore);
+#else
+    // FIXME: support DontCopyBackingStore in non-Qt ports that use TextureMapper.
+    image = imageBuffer->copyImage(CopyBackingStore);
+#endif
+
     // Divide the image to tiles.
     for (size_t tileIndex = 0; tileIndex < m_ownedTiles.size(); ++tileIndex) {
         OwnedTile& tile = m_ownedTiles[tileIndex];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to