[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 15:28:48 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e05dd4fe516b508b1af1ecff2065cbaeb4241258
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 4 15:47:58 2010 +0000

    2010-11-04  Andreas Kling  <kling at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            GraphicsContext: Don't do full save/restore when painting with low quality scaling
            https://bugs.webkit.org/show_bug.cgi?id=48738
    
            Stash the imageInterpolationQuality() in a local and reset it after painting.
    
            * platform/graphics/GraphicsContext.cpp:
            (WebCore::GraphicsContext::drawImage):
            (WebCore::GraphicsContext::drawTiledImage):
            (WebCore::GraphicsContext::drawImageBuffer):
            * platform/graphics/haiku/GraphicsContextHaiku.cpp:
            (WebCore::GraphicsContext::imageInterpolationQuality):
            * platform/graphics/skia/GraphicsContextSkia.cpp:
            (WebCore::GraphicsContext::imageInterpolationQuality):
            * platform/graphics/wince/GraphicsContextWinCE.cpp:
            (WebCore::GraphicsContext::imageInterpolationQuality):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71337 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1f31a93..2de7991 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-11-04  Andreas Kling  <kling at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        GraphicsContext: Don't do full save/restore when painting with low quality scaling
+        https://bugs.webkit.org/show_bug.cgi?id=48738
+
+        Stash the imageInterpolationQuality() in a local and reset it after painting.
+
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::drawImage):
+        (WebCore::GraphicsContext::drawTiledImage):
+        (WebCore::GraphicsContext::drawImageBuffer):
+        * platform/graphics/haiku/GraphicsContextHaiku.cpp:
+        (WebCore::GraphicsContext::imageInterpolationQuality):
+        * platform/graphics/skia/GraphicsContextSkia.cpp:
+        (WebCore::GraphicsContext::imageInterpolationQuality):
+        * platform/graphics/wince/GraphicsContextWinCE.cpp:
+        (WebCore::GraphicsContext::imageInterpolationQuality):
+
 2010-11-04  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Reviewed by Andreas Kling.
diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp
index b2ed8b5..f5e9b14 100644
--- a/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/WebCore/platform/graphics/GraphicsContext.cpp
@@ -404,25 +404,27 @@ void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const
         th = image->height();
 
     if (useLowQualityScale) {
-        save();
+        InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
+        // FIXME: Should be InterpolationLow
         setImageInterpolationQuality(InterpolationNone);
-    }
-    image->draw(this, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), styleColorSpace, op);
-    if (useLowQualityScale)
-        restore();
+        image->draw(this, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), styleColorSpace, op);
+        setImageInterpolationQuality(previousInterpolationQuality);
+    } else
+        image->draw(this, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), styleColorSpace, op);
 }
 
 void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, const IntRect& rect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op, bool useLowQualityScale)
 {
     if (paintingDisabled() || !image)
         return;
+
     if (useLowQualityScale) {
-        save();
+        InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
         setImageInterpolationQuality(InterpolationLow);
-    }
-    image->drawTiled(this, rect, srcPoint, tileSize, styleColorSpace, op);
-    if (useLowQualityScale)
-        restore();
+        image->drawTiled(this, rect, srcPoint, tileSize, styleColorSpace, op);
+        setImageInterpolationQuality(previousInterpolationQuality);
+    } else
+        image->drawTiled(this, rect, srcPoint, tileSize, styleColorSpace, op);
 }
 
 void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, const IntRect& dest, const IntRect& srcRect, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op, bool useLowQualityScale)
@@ -430,17 +432,19 @@ void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, c
     if (paintingDisabled() || !image)
         return;
 
-    if (useLowQualityScale) {
-        save();
-        setImageInterpolationQuality(InterpolationLow);
-    }
-    if (hRule == Image::StretchTile && vRule == Image::StretchTile)
+    if (hRule == Image::StretchTile && vRule == Image::StretchTile) {
         // Just do a scale.
         drawImage(image, styleColorSpace, dest, srcRect, op);
-    else
+        return;
+    }
+
+    if (useLowQualityScale) {
+        InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
+        setImageInterpolationQuality(InterpolationLow);
+        image->drawTiled(this, dest, srcRect, hRule, vRule, styleColorSpace, op);
+        setImageInterpolationQuality(previousInterpolationQuality);
+    } else
         image->drawTiled(this, dest, srcRect, hRule, vRule, styleColorSpace, op);
-    if (useLowQualityScale)
-        restore();
 }
 
 void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntPoint& p, CompositeOperator op)
@@ -484,14 +488,13 @@ void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorS
         th = image->height();
 
     if (useLowQualityScale) {
-        save();
+        InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
+        // FIXME: Should be InterpolationLow
         setImageInterpolationQuality(InterpolationNone);
-    }
-
-    image->draw(this, styleColorSpace, dest, src, op, useLowQualityScale);
-
-    if (useLowQualityScale)
-        restore();
+        image->draw(this, styleColorSpace, dest, src, op, useLowQualityScale);
+        setImageInterpolationQuality(previousInterpolationQuality);
+    } else
+        image->draw(this, styleColorSpace, dest, src, op, useLowQualityScale);
 }
 
 void GraphicsContext::addRoundedRectClip(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight,
diff --git a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
index 24e926f..6911b31 100644
--- a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
@@ -468,6 +468,12 @@ void GraphicsContext::setImageInterpolationQuality(InterpolationQuality)
 {
 }
 
+InterpolationQuality GraphicsContext::imageInterpolationQuality() const
+{
+    notImplemented();
+    return InterpolationDefault;
+}
+
 void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect)
 {
     notImplemented();
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 4bd4492..e506e5d 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -932,6 +932,11 @@ void GraphicsContext::setCompositeOperation(CompositeOperator op)
     platformContext()->setXfermodeMode(WebCoreCompositeToSkiaComposite(op));
 }
 
+InterpolationQuality GraphicsContext::imageInterpolationQuality() const
+{
+    return platformContext()->interpolationQuality();
+}
+
 void GraphicsContext::setImageInterpolationQuality(InterpolationQuality q)
 {
     platformContext()->setInterpolationQuality(q);
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
index 49a00ef..8af6ef7 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
@@ -1522,6 +1522,12 @@ void GraphicsContext::clearPlatformShadow()
     notImplemented();
 }
 
+InterpolationQuality GraphicsContext::imageInterpolationQuality() const
+{
+    notImplemented();
+    return InterpolationDefault;
+}
+
 void GraphicsContext::setImageInterpolationQuality(InterpolationQuality)
 {
     notImplemented();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list