[Qt] Avoid deep copy of QImage in GraphicsContext3D::getImageData()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jul 2012 22:44:57 +0000 (22:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jul 2012 22:44:57 +0000 (22:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=90705

Patch by Lauro Neto <lauro.neto@openbossa.org> on 2012-07-06
Reviewed by Noam Rosenthal.

Use QImage.constBits() as argument to packPixels instead of bits() to avoid
deep copying it.

* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3D::getImageData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122037 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

index ee88c1b..9945106 100644 (file)
@@ -1,3 +1,16 @@
+2012-07-06  Lauro Neto  <lauro.neto@openbossa.org>
+
+        [Qt] Avoid deep copy of QImage in GraphicsContext3D::getImageData()
+        https://bugs.webkit.org/show_bug.cgi?id=90705
+
+        Reviewed by Noam Rosenthal.
+
+        Use QImage.constBits() as argument to packPixels instead of bits() to avoid
+        deep copying it.
+
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3D::getImageData):
+
 2012-07-06  Andy Estes  <aestes@apple.com>
 
         Fix errors reported by generate-bindings.pl after r121882.
index 70d3f24..72b6bb4 100644 (file)
@@ -529,7 +529,7 @@ bool GraphicsContext3D::getImageData(Image* image,
 
     outputVector.resize(packedSize);
 
-    return packPixels(qtImage.bits(), SourceFormatBGRA8, image->width(), image->height(), 0, format, type, alphaOp, outputVector.data());
+    return packPixels(qtImage.constBits(), SourceFormatBGRA8, image->width(), image->height(), 0, format, type, alphaOp, outputVector.data());
 }
 
 void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>)