[Webkit-unassigned] [Bug 51799] ContextShadow can get the CTM only once and avoid code duplication

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 2 11:10:47 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=51799





--- Comment #3 from Simon Fraser (smfr) <simon.fraser at apple.com>  2011-01-02 11:10:47 PST ---
(From update of attachment 77773)
View in context: https://bugs.webkit.org/attachment.cgi?id=77773&action=review

> WebCore/platform/graphics/ContextShadow.cpp:86
> -bool ContextShadow::mustUseContextShadow(PlatformContext context)
> +bool ContextShadow::mustUseContextShadow(const GraphicsContext* context)

I think this method belongs in platform-specific code. Different platforms may make different decisions about when to use ContextShadow.

> WebCore/platform/graphics/ContextShadow.cpp:178
> -void ContextShadow::adjustBlurDistance(const PlatformContext context)
> +void ContextShadow::adjustBlurDistance(const AffineTransform& transform)
>  {
>      // Adjust blur if we're scaling, since the radius must not be affected by transformations.
> -    const AffineTransform transform(getTransformationMatrixFromContext(context));
> -
>      if (transform.isIdentity())
>          return;

This method is wrong. It should return false if shadows don't ignore transforms.

> WebCore/platform/graphics/ContextShadow.cpp:-207
> -    const AffineTransform transform(getTransformationMatrixFromContext(context));

Getting the CTM is pretty cheap, so I don't really see the need to pass the transform around.

> WebCore/platform/graphics/cairo/ContextShadowCairo.cpp:92
> -PlatformContext ContextShadow::beginShadowLayer(PlatformContext context, const FloatRect& layerArea)
> +PlatformContext ContextShadow::beginShadowLayer(const GraphicsContext* context, const FloatRect& layerArea)

We don't normally treat the GraphicsContext* as const.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list