Bug 104923

Summary: Canvas2DRenderingContext::setFont() does not need to be slow when repeatedly setting the same font
Product: WebKit Reporter: Stephen White <senorblanco>
Component: CanvasAssignee: Stephen White <senorblanco>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, jamesr, ojan.autocc, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Stephen White 2012-12-13 09:17:30 PST
Canvas2DRenderingContext::setFont() is slow
Comment 1 Stephen White 2012-12-13 09:19:21 PST
Created attachment 179284 [details]
Patch
Comment 2 James Robinson 2012-12-13 09:29:02 PST
Comment on attachment 179284 [details]
Patch

Seems sound, but do we have any way to validate + track changes like this?  Maybe something under PerformanceTests/ ?
Comment 3 Eric Seidel (no email) 2012-12-13 10:05:06 PST
Comment on attachment 179284 [details]
Patch

Lgtm too
Comment 4 Stephen White 2012-12-13 11:15:28 PST
(In reply to comment #2)
> (From update of attachment 179284 [details])
> Seems sound, but do we have any way to validate + track changes like this?  Maybe something under PerformanceTests/ ?

For now, I've added a ManualTest.
Comment 5 Stephen White 2012-12-13 11:16:12 PST
Created attachment 179304 [details]
Patch for landing
Comment 6 WebKit Review Bot 2012-12-13 11:33:24 PST
Comment on attachment 179304 [details]
Patch for landing

Clearing flags on attachment: 179304

Committed r137630: <http://trac.webkit.org/changeset/137630>
Comment 7 WebKit Review Bot 2012-12-13 11:33:28 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Stephen White 2012-12-13 12:41:28 PST
Good point about the bug rename.  CanvasRenderingContext2D::setFont() is still slow when actually setting fonts.  As a (somewhat more involved) followup, it would be nice to cache the mapping between unparsed strings and fonts, if possible.  The CSS parser is really slow.