Reviewed by Darin.
authorbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Jun 2006 02:27:00 +0000 (02:27 +0000)
committerbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Jun 2006 02:27:00 +0000 (02:27 +0000)
commita2feb43c632a3a35bf6e6bfe588a18cf333e0532
tree2d1b2dae4a077dbdce74f3182bc521f9233b3ec7
parentd9afd99964ea3ac784f0792397c57e0bdb5a0c9b
    Reviewed by Darin.

        Fix for <rdar://problem/4567520> Pixel cracks in weather widget at
        1.83 scaling

        To prevent pixel cracks at non-integral scaling factors, before we
        call into CG to draw an image, we have to convert the rect to
        device space, round the origin and size to integers in device
        space, and convert back to user space.

        No test cases added since this only affects non-1.0 resolution
        scale factors.

        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
        (WebCore::JSCanvasRenderingContext2D::drawImage): drawImage() now
        takes FloatRects.
        * html/CanvasPattern.cpp:
        (WebCore::patternCallback): Call roundToDevicePixels()
        * html/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::drawImage): drawImage() now
        takes FloatRects and call roundToDevicePixels()
        * html/CanvasRenderingContext2D.h: drawImage() now takes
        FloatRects.
        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::paint): Call roundToDevicePixels()
        * kcanvas/device/quartz/QuartzSupport.mm:
        (WebCore::debugDumpCGImageToFile): Same as above.
        * platform/GraphicsContext.h:
        * platform/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::roundToDevicePixels): Takes care of
        converting between coordinate spaces and rounding.
        (WebCore::GraphicsContext::drawLineForText):
        * platform/mac/ImageMac.mm: Call roundToDevicePixels()
        (WebCore::Image::draw): Same as above.
        (WebCore::drawPattern): Same as above.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
WebCore/html/CanvasPattern.cpp
WebCore/html/CanvasRenderingContext2D.cpp
WebCore/html/CanvasRenderingContext2D.h
WebCore/html/HTMLCanvasElement.cpp
WebCore/kcanvas/device/quartz/QuartzSupport.mm
WebCore/platform/GraphicsContext.h
WebCore/platform/cg/GraphicsContextCG.cpp
WebCore/platform/mac/ImageMac.mm