summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp')
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
index 55c0b6aca..4469fde58 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
@@ -38,6 +38,7 @@
#include <wtf/TemporaryChange.h>
#if PLATFORM(QT)
+#include <QPaintEngine>
#include "NativeImageQt.h"
#endif
@@ -908,7 +909,17 @@ void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, co
const char* imageData;
#if PLATFORM(QT)
- QImage qImage = frameImage->toImage();
+ QImage qImage;
+ QPaintEngine* paintEngine = frameImage->paintEngine();
+ if (paintEngine && paintEngine->type() == QPaintEngine::Raster) {
+ // QRasterPixmapData::toImage() will deep-copy the backing QImage if there's an active QPainter on it.
+ // For performance reasons, we don't want that here, so we temporarily redirect the paint engine.
+ QPaintDevice* currentPaintDevice = paintEngine->paintDevice();
+ paintEngine->setPaintDevice(0);
+ qImage = frameImage->toImage();
+ paintEngine->setPaintDevice(currentPaintDevice);
+ } else
+ qImage = frameImage->toImage();
imageData = reinterpret_cast<const char*>(qImage.constBits());
bytesPerLine = qImage.bytesPerLine();
#elif USE(CAIRO)