Changeset 166455 in webkit


Ignore:
Timestamp:
Mar 29, 2014 2:53:51 PM (10 years ago)
Author:
Alan Bujtas
Message:

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:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166454 r166455  
     12014-03-29  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel rendering: Make GraphicsContext::drawImageBuffer* functions float based.
     4        https://bugs.webkit.org/show_bug.cgi?id=130932
     5
     6        Reviewed by Simon Fraser.
     7       
     8        This is in preparation to support device pixel based filter painting.
     9        Filter calculation is still integral based.
     10
     11        No change in behavior.
     12
     13        * platform/graphics/GraphicsContext.cpp:
     14        (WebCore::GraphicsContext::drawImageBuffer):
     15        * platform/graphics/GraphicsContext.h:
     16        * platform/graphics/filters/FilterEffect.cpp: This will eventually be fully float based.
     17        Right now, this IntRect->FloatRect change is only to ensure that we can call
     18        the float based drawImageBuffer().
     19        (WebCore::FilterEffect::drawingRegionOfInputImage):
     20        * platform/graphics/filters/FilterEffect.h:
     21
    1222014-03-27  Sam Weinig  <sam@webkit.org>
    223
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp

    r166100 r166455  
    633633}
    634634
    635 void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntPoint& p, CompositeOperator op, BlendMode blendMode)
     635void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatPoint& p, CompositeOperator op, BlendMode blendMode)
    636636{
    637637    if (!image)
    638638        return;
    639     drawImageBuffer(image, styleColorSpace, FloatRect(IntRect(p, image->logicalSize())), FloatRect(FloatPoint(), FloatSize(image->logicalSize())), op, blendMode);
    640 }
    641 
    642 void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntRect& r, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
     639    drawImageBuffer(image, styleColorSpace, FloatRect(p, image->logicalSize()), FloatRect(FloatPoint(), image->logicalSize()), op, blendMode);
     640}
     641
     642void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatRect& dest, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
    643643{
    644644    if (!image)
    645645        return;
    646     drawImageBuffer(image, styleColorSpace, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->logicalSize())), op, blendMode, useLowQualityScale);
    647 }
    648 
    649 void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, BlendMode blendMode)
    650 {
    651     drawImageBuffer(image, styleColorSpace, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, blendMode);
    652 }
    653 
    654 void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
    655 {
    656     drawImageBuffer(image, styleColorSpace, FloatRect(dest), FloatRect(srcRect), op, blendMode, useLowQualityScale);
    657 }
    658 
    659 void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatRect& dest)
    660 {
    661     if (!image)
    662         return;
    663     drawImageBuffer(image, styleColorSpace, dest, FloatRect(IntRect(IntPoint(), image->logicalSize())));
     646    drawImageBuffer(image, styleColorSpace, dest, FloatRect(FloatPoint(), FloatSize(image->logicalSize())), op, blendMode, useLowQualityScale);
     647}
     648
     649void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatPoint& dest, const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode)
     650{
     651    drawImageBuffer(image, styleColorSpace, FloatRect(dest, srcRect.size()), srcRect, op, blendMode);
    664652}
    665653
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.h

    r166100 r166455  
    315315                            CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
    316316
    317         void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntPoint&, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
    318         void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
    319         void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
    320         void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
    321         void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect& destRect);
     317        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatPoint&, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
     318        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect&, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
     319        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatPoint& destPoint, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
    322320        void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
    323321
  • trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp

    r164886 r166455  
    9595}
    9696
    97 IntRect FilterEffect::drawingRegionOfInputImage(const IntRect& srcRect) const
    98 {
    99     return IntRect(IntPoint(srcRect.x() - m_absolutePaintRect.x(),
     97FloatRect FilterEffect::drawingRegionOfInputImage(const IntRect& srcRect) const
     98{
     99    return FloatRect(FloatPoint(srcRect.x() - m_absolutePaintRect.x(),
    100100                            srcRect.y() - m_absolutePaintRect.y()), srcRect.size());
    101101}
  • trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h

    r166341 r166455  
    9292    }
    9393
    94     IntRect drawingRegionOfInputImage(const IntRect&) const;
     94    FloatRect drawingRegionOfInputImage(const IntRect&) const;
    9595    IntRect requestedRegionOfInputImageData(const IntRect&) const;
    9696
Note: See TracChangeset for help on using the changeset viewer.