Bug 42300

Summary: Canvas: Don't add shadow rect to dirty region when shadow alpha is 0
Product: WebKit Reporter: Andreas Kling <kling>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: oliver
Priority: P2 Keywords: Performance
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed patch none

Description Andreas Kling 2010-07-14 16:05:04 PDT
CanvasRenderingContext2D::willDraw() will always add the current shadow rect to the dirty region.
We can skip this if the current shadow color has a zero alpha value.
Comment 1 Andreas Kling 2010-07-14 16:06:14 PDT
Created attachment 61578 [details]
Proposed patch
Comment 2 Darin Adler 2010-07-14 16:14:27 PDT
Comment on attachment 61578 [details]
Proposed patch

It’s unfortunate we have to construct a Color just to check the alpha channel. That’s going to cost some actual instructions and CPU time. Maybe we should have more functions that operate directly on RGBA32 values.
Comment 3 Andreas Kling 2010-07-14 16:25:22 PDT
(In reply to comment #2)
> (From update of attachment 61578 [details])
> It’s unfortunate we have to construct a Color just to check the alpha channel. That’s going to cost some actual instructions and CPU time. Maybe we should have more functions that operate directly on RGBA32 values.

Agreed. Coming soon in a separate patch.
Comment 4 Andreas Kling 2010-07-14 16:28:06 PDT
Comment on attachment 61578 [details]
Proposed patch

Clearing flags on attachment: 61578

Committed r63370: <http://trac.webkit.org/changeset/63370>
Comment 5 Andreas Kling 2010-07-14 16:28:16 PDT
All reviewed patches have been landed.  Closing bug.