RESOLVED FIXED Bug 59967
Avoid wasted cycles updating paths when popping the context stack
https://bugs.webkit.org/show_bug.cgi?id=59967
Summary Avoid wasted cycles updating paths when popping the context stack
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.