Subpixel rendering: Make GraphicsContext::drawImageBuffer* functions float based.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Mar 2014 21:53:51 +0000 (21:53 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Mar 2014 21:53:51 +0000 (21:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130932

Reviewed by Simon Fraser.

This is in preparation to support device pixel based filter painting.
Filter calculation is still integral based.

No change in behavior.

* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImageBuffer):
* platform/graphics/GraphicsContext.h:
* platform/graphics/filters/FilterEffect.cpp: This will eventually be fully float based.
Right now, this IntRect->FloatRect change is only to ensure that we can call
the float based drawImageBuffer().
(WebCore::FilterEffect::drawingRegionOfInputImage):
* platform/graphics/filters/FilterEffect.h:

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/filters/FilterEffect.cpp
Source/WebCore/platform/graphics/filters/FilterEffect.h

index d8b8626..b1ff79d 100644 (file)
@@ -1,3 +1,24 @@
+2014-03-29  Zalan Bujtas  <zalan@apple.com>
+
+        Subpixel rendering: Make GraphicsContext::drawImageBuffer* functions float based.
+        https://bugs.webkit.org/show_bug.cgi?id=130932
+
+        Reviewed by Simon Fraser.
+        
+        This is in preparation to support device pixel based filter painting.
+        Filter calculation is still integral based.
+
+        No change in behavior.
+
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::drawImageBuffer):
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/filters/FilterEffect.cpp: This will eventually be fully float based.
+        Right now, this IntRect->FloatRect change is only to ensure that we can call 
+        the float based drawImageBuffer(). 
+        (WebCore::FilterEffect::drawingRegionOfInputImage):
+        * platform/graphics/filters/FilterEffect.h:
+
 2014-03-27  Sam Weinig  <sam@webkit.org>
 
         Convert yet more of HTMLConverter to C++
index a055563..3fb820e 100644 (file)
@@ -632,35 +632,23 @@ void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, c
         image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, styleColorSpace, op);
 }
 
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntPoint& p, CompositeOperator op, BlendMode blendMode)
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatPoint& p, CompositeOperator op, BlendMode blendMode)
 {
     if (!image)
         return;
-    drawImageBuffer(image, styleColorSpace, FloatRect(IntRect(p, image->logicalSize())), FloatRect(FloatPoint(), FloatSize(image->logicalSize())), op, blendMode);
+    drawImageBuffer(image, styleColorSpace, FloatRect(p, image->logicalSize()), FloatRect(FloatPoint(), image->logicalSize()), op, blendMode);
 }
 
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntRect& r, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatRect& dest, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
 {
     if (!image)
         return;
-    drawImageBuffer(image, styleColorSpace, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->logicalSize())), op, blendMode, useLowQualityScale);
+    drawImageBuffer(image, styleColorSpace, dest, FloatRect(FloatPoint(), FloatSize(image->logicalSize())), op, blendMode, useLowQualityScale);
 }
 
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, BlendMode blendMode)
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatPoint& dest, const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode)
 {
-    drawImageBuffer(image, styleColorSpace, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, blendMode);
-}
-
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
-{
-    drawImageBuffer(image, styleColorSpace, FloatRect(dest), FloatRect(srcRect), op, blendMode, useLowQualityScale);
-}
-
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatRect& dest)
-{
-    if (!image)
-        return;
-    drawImageBuffer(image, styleColorSpace, dest, FloatRect(IntRect(IntPoint(), image->logicalSize())));
+    drawImageBuffer(image, styleColorSpace, FloatRect(dest, srcRect.size()), srcRect, op, blendMode);
 }
 
 void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
index ae76b10..7f1c314 100644 (file)
@@ -314,11 +314,9 @@ namespace WebCore {
                             const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile,
                             CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
 
-        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntPoint&, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
-        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
-        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
-        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
-        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect& destRect);
+        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatPoint&, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
+        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect&, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
+        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatPoint& destPoint, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
         void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
 
         void setImageInterpolationQuality(InterpolationQuality);
index 3be11a1..d84bca2 100644 (file)
@@ -94,9 +94,9 @@ IntRect FilterEffect::requestedRegionOfInputImageData(const IntRect& effectRect)
     return IntRect(location, m_absolutePaintRect.size());
 }
 
-IntRect FilterEffect::drawingRegionOfInputImage(const IntRect& srcRect) const
+FloatRect FilterEffect::drawingRegionOfInputImage(const IntRect& srcRect) const
 {
-    return IntRect(IntPoint(srcRect.x() - m_absolutePaintRect.x(),
+    return FloatRect(FloatPoint(srcRect.x() - m_absolutePaintRect.x(),
                             srcRect.y() - m_absolutePaintRect.y()), srcRect.size());
 }
 
index d2095f5..972c558 100644 (file)
@@ -91,7 +91,7 @@ public:
             || m_premultipliedImageResult;
     }
 
-    IntRect drawingRegionOfInputImage(const IntRect&) const;
+    FloatRect drawingRegionOfInputImage(const IntRect&) const;
     IntRect requestedRegionOfInputImageData(const IntRect&) const;
 
     // Solid black image with different alpha values.