Skip to content
  • timothy_horton@apple.com's avatar
    [cg] userSpaceOnUse SVG Patterns have the wrong origin · 359441bd
    timothy_horton@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=75741
    <rdar://problem/9383222>
    
    Reviewed by Simon Fraser.
    
    The transformation from pattern space to user space should use the userToBase CTM,
    not the current CTM.
    
    Test: svg/custom/pattern-userSpaceOnUse-userToBaseTransform.xhtml
    
    * platform/graphics/cg/GraphicsContextCG.cpp:
    (WebCore::GraphicsContext::applyStrokePattern):
    (WebCore::GraphicsContext::applyFillPattern):
    (WebCore::GraphicsContext::getCTM):
    * platform/graphics/cg/TransformationMatrixCG.cpp:
    (WebCore::AffineTransform::AffineTransform): Add a AffineTransform(CGAffineTransform) constructor
    * platform/graphics/transforms/AffineTransform.h:
    
    Add a test that ensures that userSpaceOnUse patterns are rendered in the
    correct orientation and location in both the accelerated compositing and
    regular cases, as well as with SVG translation.
    
    * platform/mac/svg/custom/pattern-userSpaceOnUse-userToBaseTransform-expected.png: Added.
    * platform/mac/svg/custom/pattern-userSpaceOnUse-userToBaseTransform-expected.txt: Added.
    * svg/custom/pattern-userSpaceOnUse-userToBaseTransform.xhtml: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    359441bd