Bug 42088 - Canvas: Move fillRect() save/restore into GraphicsContext implementations
Summary: Canvas: Move fillRect() save/restore into GraphicsContext implementations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-07-12 09:39 PDT by Andreas Kling
Modified: 2010-07-12 11:34 PDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (1.33 KB, patch)
2010-07-12 09:41 PDT, Andreas Kling
vestbo: review-
vestbo: commit-queue-
Details | Formatted Diff | Diff
Proposed patch v2 (4.80 KB, patch)
2010-07-12 11:16 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2010-07-12 09:39:19 PDT
CanvasRenderingContext2D::fillRect() will currently call save() and restore() on the GraphicsContext before and after calling fillRect().

This is unnecessary for Qt since GraphicsContextQt::fillRect() doesn't taint the QPainter.
Comment 1 Andreas Kling 2010-07-12 09:41:12 PDT
Created attachment 61240 [details]
Proposed patch

Not the prettiest patch in the world. Cosmetic suggestions welcome.
Comment 2 Tor Arne Vestbø 2010-07-12 10:09:49 PDT
Comment on attachment 61240 [details]
Proposed patch

I think the right approach is to have the GC do save/restore if it needs it.
Comment 3 Andreas Kling 2010-07-12 11:11:09 PDT
CG doesn't need this either.
Comment 4 Andreas Kling 2010-07-12 11:16:02 PDT
Created attachment 61248 [details]
Proposed patch v2

(Qt) Results from Hixie's skelet0n animation test:
http://hixie.ch/tests/adhoc/perf/video/002.html

Without this patch:

  Elapsed wall-clock time: 996ms (ideal: 640ms).
  Elapsed non-idle time: 356ms (ideal: 0ms).
  Speed: 15.06fps (ideal: 25.00fps).

With this patch:

  Elapsed wall-clock time: 900ms (ideal: 640ms).
  Elapsed non-idle time: 260ms (ideal: 0ms).
  Speed: 16.67fps (ideal: 25.00fps).
Comment 5 WebKit Commit Bot 2010-07-12 11:34:34 PDT
Comment on attachment 61248 [details]
Proposed patch v2

Clearing flags on attachment: 61248

Committed r63102: <http://trac.webkit.org/changeset/63102>
Comment 6 WebKit Commit Bot 2010-07-12 11:34:38 PDT
All reviewed patches have been landed.  Closing bug.