Currently Safari is using CG's "high" interpolation quality setting as the default for canvas. Dropping it down to "low" speeds up many canvas demos (including GUIMark 2 bitmap, IE Asteroid, etc.) without any noticeable degradation of quality. As a result, the speedups for animations make the apparent quality seem much better. Also, CG's low interpolation quality setting is equivalent to most other browsers' default or high settings. Note: Dropping the interpolation quality down to low still causes the drawing of large images to go slowly if they're scaled down when drawn into the canvas. This will be addressed in a followup bug that will block on this one.
Created attachment 67542 [details] Patch
This patch is likely WIP due to it possibly causing a small issue in 2 of the canvas layout tests. Will investigate very soon.
Comment on attachment 67542 [details] Patch r- due to layout test failures.
Why not do this on Windows, too?
Why not on all platforms?
(In reply to comment #5) > Why not on all platforms? It should be PLATFORM(CG) as the specific problem is that CG's high quality is higher quality (and hence slower) than any other graphics libraries high quality. Medium quality in CG is trilinear filtering, which is higher quality than anything firefox, et al use anywhere afaik
Yes, Oliver said it well. This is specifically to address CG. Cross-platform, there is a concept of basically 4 possible "Interpolation Quality" settings: none, low, medium, and high. Per platform, these quality settings match to different scaling algorithms. CG's low setting happens to be others' high/medium settings which is quantized bilinear interpolation. AFAIK, everywhere else in webkit, we're using CG's high setting. This patch is just changing the quality setting used in the CG version of canvas.
Created attachment 68584 [details] Patch
Comment on attachment 68584 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=68584&action=review > WebCore/html/canvas/CanvasRenderingContext2D.cpp:140 > + if (GraphicsContext* c = drawingContext()) > + c->setImageInterpolationQuality(DefaultInterpolationQuality); We deliberately delayed creation of the underlying ImageBuffer in the canvas so that we don't end up doing a whole lot of work on an imagebuffer that is going to be thrown out. Also this means when we do throw out the buffer and then recreate it we won't reset the interpolation quality. The existing location of the call to setInterpolation quality is the correct one.
Created attachment 68624 [details] Patch
Comment on attachment 68624 [details] Patch Clearing flags on attachment: 68624 Committed r68221: <http://trac.webkit.org/changeset/68221>
All reviewed patches have been landed. Closing bug.
Revision r68221 cherry-picked into qtwebkit-2.1-x with commit 318b799eee638d69247276fa8b9ba48027562bcd <http://gitorious.org/webkit/qtwebkit/commit/318b799eee638d69247276fa8b9ba48027562bcd>