commit 8da867557a9ed03fbc89182983645be0e06af2af Author: Allan Sandfeld Jensen Date: Tue Sep 3 17:32:55 2013 +0200 [Qt] Images scaled poorly on composited canvas https://bugs.webkit.org/show_bug.cgi?id=120632 Reviewed by Jocelyn Turcotte. Explicitly set a imageInterpolationQuality on the TextureMapper, because InterpolationDefault may be interpreted differently by nested GraphicsContexts. * WebCoreSupport/TextureMapperLayerClientQt.cpp: (TextureMapperLayerClientQt::renderCompositedLayers): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154985 268f45cc-cd09-0410-ab3c-d52691b4dbfc Task-number: QTBUG-33081 Change-Id: Iec90f53da38c4520cef2aac0519e36af74dd5a50 diff --git a/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp index 4442baf..8b4748b 100644 --- a/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp @@ -103,7 +103,14 @@ void TextureMapperLayerClientQt::renderCompositedLayers(GraphicsContext* context return; m_textureMapper->setGraphicsContext(context); - m_textureMapper->setImageInterpolationQuality(context->imageInterpolationQuality()); + // GraphicsContext::imageInterpolationQuality is always InterpolationDefault here, + // but 'default' may be interpreted differently due to a different backend QPainter, + // so we need to set an explicit imageInterpolationQuality. + if (context->platformContext()->renderHints() & QPainter::SmoothPixmapTransform) + m_textureMapper->setImageInterpolationQuality(WebCore::InterpolationMedium); + else + m_textureMapper->setImageInterpolationQuality(WebCore::InterpolationNone); + m_textureMapper->setTextDrawingMode(context->textDrawingMode()); QPainter* painter = context->platformContext(); const QTransform transform = painter->worldTransform();