Skip to content
  • bdakin's avatar
    Reviewed by Darin. · af5f98b2
    bdakin authored
            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: http://svn.webkit.org/repository/webkit/trunk@14739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    af5f98b2