Changeset 76612 in webkit


Ignore:
Timestamp:
Jan 25, 2011 10:54:30 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-01-25 Helder Correia <helder@sencha.com>

Reviewed by Dirk Schulze.

REGRESSION(75139): SVG gradients are not applied to texts
https://bugs.webkit.org/show_bug.cgi?id=52531

CGContextConcatCTM should use the CGLayer context, not the
GraphicsContext. Also, the CTM needs to be adjusted (translated).
This fixes SVG text gradient fill.

Test: svg/css/composite-shadow-text.svg

  • platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::fillRect):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r76610 r76612  
     12011-01-25  Helder Correia  <helder@sencha.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        REGRESSION(75139): SVG gradients are not applied to texts
     6        https://bugs.webkit.org/show_bug.cgi?id=52531
     7
     8        CGContextConcatCTM should use the CGLayer context, not the
     9        GraphicsContext. Also, the CTM needs to be adjusted (translated).
     10        This fixes SVG text gradient fill.
     11
     12        Test: svg/css/composite-shadow-text.svg
     13
     14        * platform/graphics/cg/GraphicsContextCG.cpp:
     15        (WebCore::GraphicsContext::fillRect):
     16
    1172011-01-25  Benjamin Kalman  <kalman@chromium.org>
    218
  • trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp

    r76029 r76612  
    627627        CGContextSaveGState(context);
    628628        if (hasShadow()) {
    629             CGContextConcatCTM(context, m_state.fillGradient->gradientSpaceTransform());
    630629            CGLayerRef layer = CGLayerCreateWithContext(context, CGSizeMake(rect.width(), rect.height()), 0);
    631630            CGContextRef layerContext = CGLayerGetContext(layer);
     631
     632            CGContextTranslateCTM(layerContext, -rect.x(), -rect.y());
     633            CGContextAddRect(layerContext, rect);
     634            CGContextClip(layerContext);
     635
     636            CGContextConcatCTM(layerContext, m_state.fillGradient->gradientSpaceTransform());
    632637            m_state.fillGradient->paint(layerContext);
    633638            CGContextDrawLayerAtPoint(context, CGPointMake(rect.left(), rect.top()), layer);
Note: See TracChangeset for help on using the changeset viewer.