Title: [106807] trunk/Source/WebCore
Revision
106807
Author
[email protected]
Date
2012-02-06 08:10:13 -0800 (Mon, 06 Feb 2012)

Log Message

[Texmap][Qt] Avoid an image copy when uploading textures in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=77748

Reviewed by Kenneth Rohde Christiansen.

Use QPixmap::buffer() API to get access to the QPixmap's pixels without implicit copies.

Instrumentation shows that the deep image copies created from TextureMapperGL are
eliminated.

* platform/graphics/opengl/TextureMapperGL.cpp:
(WebCore::BitmapTextureGL::updateContents):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106806 => 106807)


--- trunk/Source/WebCore/ChangeLog	2012-02-06 16:05:53 UTC (rev 106806)
+++ trunk/Source/WebCore/ChangeLog	2012-02-06 16:10:13 UTC (rev 106807)
@@ -1,3 +1,18 @@
+2012-02-06  No'am Rosenthal  <[email protected]>
+
+        [Texmap][Qt] Avoid an image copy when uploading textures in WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=77748
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Use QPixmap::buffer() API to get access to the QPixmap's pixels without implicit copies.
+
+        Instrumentation shows that the deep image copies created from TextureMapperGL are
+        eliminated.
+
+        * platform/graphics/opengl/TextureMapperGL.cpp:
+        (WebCore::BitmapTextureGL::updateContents):
+
 2012-02-06  Allan Sandfeld Jensen  <[email protected]>
 
         LayoutTest failures on r106797

Modified: trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp (106806 => 106807)


--- trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp	2012-02-06 16:05:53 UTC (rev 106806)
+++ trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp	2012-02-06 16:10:13 UTC (rev 106807)
@@ -30,6 +30,10 @@
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
+#if PLATFORM(QT) && QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#include <QPlatformPixmap>
+#endif
+
 #if PLATFORM(QT)
 #include <cairo/OpenGLShims.h>
 #elif defined(TEXMAP_OPENGL_ES_2)
@@ -633,7 +637,16 @@
         return;
 
 #if PLATFORM(QT)
-    QImage qtImage = frameImage->toImage();
+    QImage qtImage;
+
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+    // With QPA, we can avoid a deep copy.
+    qtImage = *frameImage->handle()->buffer();
+#else
+    // This might be a deep copy, depending on other references to the pixmap.
+    qtImage = frameImage->toImage();
+#endif
+
     if (IntSize(qtImage.size()) != sourceRect.size())
         qtImage = qtImage.copy(sourceRect);
     if (format == BGRAFormat || format == BGRFormat)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to