WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
45722
Lower the default canvas interpolation quality for platforms that use CG
https://bugs.webkit.org/show_bug.cgi?id=45722
Summary
Lower the default canvas interpolation quality for platforms that use CG
Matthew Delaney
Reported
2010-09-13 17:14:51 PDT
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.
Attachments
Patch
(4.97 KB, patch)
2010-09-14 05:25 PDT
,
Matthew Delaney
no flags
Details
Formatted Diff
Diff
Patch
(4.10 KB, patch)
2010-09-23 14:11 PDT
,
Matthew Delaney
no flags
Details
Formatted Diff
Diff
Patch
(2.84 KB, patch)
2010-09-23 16:53 PDT
,
Matthew Delaney
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Matthew Delaney
Comment 1
2010-09-14 05:25:07 PDT
Created
attachment 67542
[details]
Patch
Matthew Delaney
Comment 2
2010-09-14 05:26:54 PDT
This patch is likely WIP due to it possibly causing a small issue in 2 of the canvas layout tests. Will investigate very soon.
Geoffrey Garen
Comment 3
2010-09-14 13:50:33 PDT
Comment on
attachment 67542
[details]
Patch r- due to layout test failures.
Adam Roben (:aroben)
Comment 4
2010-09-20 11:43:47 PDT
Why not do this on Windows, too?
Geoffrey Garen
Comment 5
2010-09-20 11:48:19 PDT
Why not on all platforms?
Oliver Hunt
Comment 6
2010-09-20 11:50:31 PDT
(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
Matthew Delaney
Comment 7
2010-09-20 12:16:32 PDT
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.
Matthew Delaney
Comment 8
2010-09-23 14:11:00 PDT
Created
attachment 68584
[details]
Patch
Oliver Hunt
Comment 9
2010-09-23 16:32:45 PDT
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.
Matthew Delaney
Comment 10
2010-09-23 16:53:05 PDT
Created
attachment 68624
[details]
Patch
WebKit Commit Bot
Comment 11
2010-09-23 17:29:47 PDT
Comment on
attachment 68624
[details]
Patch Clearing flags on attachment: 68624 Committed
r68221
: <
http://trac.webkit.org/changeset/68221
>
WebKit Commit Bot
Comment 12
2010-09-23 17:29:53 PDT
All reviewed patches have been landed. Closing bug.
Caio Marcelo de Oliveira Filho
Comment 13
2011-03-28 09:10:38 PDT
Revision
r68221
cherry-picked into qtwebkit-2.1-x with commit 318b799eee638d69247276fa8b9ba48027562bcd <
http://gitorious.org/webkit/qtwebkit/commit/318b799eee638d69247276fa8b9ba48027562bcd
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug