[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

ariya at webkit.org ariya at webkit.org
Fri Feb 26 22:17:13 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit dc28d6245fa177c88083cd565b50cfd6d9f31c06
Author: ariya at webkit.org <ariya at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 10 22:37:05 2010 +0000

    2010-02-10  Ariya Hidayat  <ariya.hidayat at gmail.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Implement image interpolation quality.
    
            https://bugs.webkit.org/show_bug.cgi?id=34629
    
            * platform/graphics/qt/GraphicsContextQt.cpp:
            (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
            (WebCore::GraphicsContext::setImageInterpolationQuality):
            (WebCore::GraphicsContext::imageInterpolationQuality):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54623 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2ab2c01..c5859e8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-10  Ariya Hidayat  <ariya.hidayat at gmail.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Implement image interpolation quality.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34629
+
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+        (WebCore::GraphicsContext::setImageInterpolationQuality):
+        (WebCore::GraphicsContext::imageInterpolationQuality):
+
 2010-02-10  Eric Seidel  <eric at webkit.org>
 
         No review, Mac build fix.
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 2caabb6..736062c 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -221,6 +221,8 @@ public:
 
     QBrush solidColor;
 
+    InterpolationQuality imageInterpolationQuality;
+
     // Only used by SVG for now.
     QPainterPath currentPath;
 
@@ -236,6 +238,8 @@ GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate(QPainter* p)
 
     solidColor = QBrush(Qt::black);
 
+    imageInterpolationQuality = InterpolationDefault;
+
     if (painter) {
         // use the default the QPainter was constructed with
         antiAliasingForRectsAndLines = painter->testRenderHint(QPainter::Antialiasing);
@@ -1233,13 +1237,30 @@ void GraphicsContext::releaseWindowsContext(HDC hdc, const IntRect& dstRect, boo
 }
 #endif
 
-void GraphicsContext::setImageInterpolationQuality(InterpolationQuality)
+void GraphicsContext::setImageInterpolationQuality(InterpolationQuality quality)
 {
+    m_data->imageInterpolationQuality = quality;
+
+    switch (quality) {
+    case InterpolationDefault:
+    case InterpolationNone:
+    case InterpolationLow:
+        // use nearest-neigbor
+        m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, false);
+        break;
+
+    case InterpolationMedium:
+    case InterpolationHigh:
+    default:
+        // use the filter
+        m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, true);
+        break;
+    };
 }
 
 InterpolationQuality GraphicsContext::imageInterpolationQuality() const
 {
-    return InterpolationDefault;
+    return m_data->imageInterpolationQuality;
 }
 
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list