[webkit-reviews] review denied: [Bug 51869] Shadows are not drawn when filling a rect with a gradient fillStyle on Mac and Chromium-Mac : [Attachment 78073] Extra test step for rotation; fix Win build (hopefully)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 5 17:22:28 PST 2011


Simon Fraser (smfr) <simon.fraser at apple.com> has denied Helder Correia
<helder at sencha.com>'s request for review:
Bug 51869: Shadows are not drawn when filling a rect with a gradient fillStyle
on Mac and Chromium-Mac
https://bugs.webkit.org/show_bug.cgi?id=51869

Attachment 78073: Extra test step for rotation; fix Win build (hopefully)
https://bugs.webkit.org/attachment.cgi?id=78073&action=review

------- Additional Comments from Simon Fraser (smfr) <simon.fraser at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=78073&action=review

Does this patch alter any of the canvas/ test results?

> WebCore/ChangeLog:10
> +	   The solution is to draw the gradient into a transparency layer,

Strictly speaking, a transparency layer is something else. This is just a
CGLayer.

> WebCore/platform/graphics/cg/GraphicsContextCG.cpp:608
> -	   CGContextSaveGState(context);
> -	   CGContextClipToRect(context, rect);
> +	   CGLayerRef layer = CGLayerCreateWithContext(context,
CGSizeMake(rect.width(), rect.height()), 0);
> +	   CGContextRef layerContext = CGLayerGetContext(layer);
> +	   m_state.fillGradient->paint(layerContext);
>	   CGContextConcatCTM(context,
m_state.fillGradient->gradientSpaceTransform());
> -	   m_state.fillGradient->paint(this);
> -	   CGContextRestoreGState(context);
> +	   CGContextDrawLayerAtPoint(context, CGPointMake(rect.left(),
rect.top()), layer);
> +	   CGLayerRelease(layer);

You should only create the CGLayerRef if you know it should render with a
shadow.


More information about the webkit-reviews mailing list