Bug 59967

Summary: Avoid wasted cycles updating paths when popping the context stack
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: CanvasAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: mdelaney7, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: OS X 10.5   
Attachments:
Description Flags
Patch mitz: review+

Simon Fraser (smfr)
Reported 2011-05-02 15:24:13 PDT
CanvasRenderingContext2D::restore() does m_path.transform(state().m_transform); which is a waste of cycles if the path is empty, or the transform is identity.
Attachments
Patch (1.56 KB, patch)
2011-05-02 15:49 PDT, Simon Fraser (smfr)
mitz: review+
Simon Fraser (smfr)
Comment 1 2011-05-02 15:49:42 PDT
Matthew Delaney
Comment 2 2011-05-02 16:06:54 PDT
I wonder if putting isEmpty first in the check might make these paths even a little faster. isIdentity() looks at a handful of values on the matrix whereas isEmpty should be checking just a single count variable (platform dependent of course though).
Simon Fraser (smfr)
Comment 3 2011-05-02 16:19:04 PDT
Note You need to log in before you can comment on or make changes to this bug.