WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 59929
[Chromium] Make accelerated 2d canvas enabled by default with skia
https://bugs.webkit.org/show_bug.cgi?id=59929
Summary
[Chromium] Make accelerated 2d canvas enabled by default with skia
Justin Novosad
Reported
2011-05-02 05:33:24 PDT
The setting acceleratedCanvas2DEnabled will soon be turned on by default in Chromium. The effect of this run-time flag must be changed so that it enables the Skia-based GPU acceleration of the 2D canvas. Furthermore, a new runtime flag must be added in order to enable the legacy accelerated 2D canvas. The legacy flag will have priority when both flags are enabled simultaneously.
Attachments
Patch
(12.61 KB, patch)
2011-05-02 08:32 PDT
,
Justin Novosad
no flags
Details
Formatted Diff
Diff
Patch
(7.67 KB, patch)
2011-05-03 11:54 PDT
,
Justin Novosad
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Justin Novosad
Comment 1
2011-05-02 08:32:45 PDT
Created
attachment 91924
[details]
Patch
Stephen White
Comment 2
2011-05-02 08:36:36 PDT
Comment on
attachment 91924
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=91924&action=review
> Source/WebCore/page/Page.cpp:752 > + m_sharedGraphicsContext3D = SharedGraphicsContext3D::create(chrome(), settings()->legacyAccelerated2dCanvasEnabled() ? 0 : SharedGraphicsContext3D::UseSkiaGPU);
Since this now makes skia-gpu the default path for accelerated canvas, won't we also need to add all failing tests to test_expectations along with this change?
Vangelis Kokkevis
Comment 3
2011-05-02 10:08:22 PDT
Comment on
attachment 91924
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=91924&action=review
> Source/WebCore/page/Settings.cpp:722 > +void Settings::setLegacyAccelerated2dCanvasEnabled(bool enabled)
This is a chromium-only flag so I think it should only exist in the chromium websettings files much like it was done with the compositeToTexture flag in :
https://bugs.webkit.org/show_bug.cgi?id=52311
It will actually simplify things and you won't have to touch quite that many files.
Justin Novosad
Comment 4
2011-05-02 13:17:25 PDT
Delivery plan proposed by Stephen White: 1: Add --enable-legacy-accelerated-2d-canvas flag to both Chrome and DRT (won't do anything yet, since old path is still the default) 2: Change the --accelerated-2d-canvas flag to mean Ganesh, not the old path, and remove the double-meaning of --enable-accelerated-drawing (have it mean only Alok's compositor -> skia stuff, not canvas2D). This should be a 1-liner in the code. Along with this change, submit suppressions to test_expectations for the new failures. 3: Make canvas2D GPU (skia path) on by default in Chrome. Replace the --enable-accelerated-2d-canvas flag with --disable-accelerated-2d-canvas. Pass --disable-accelerated-2d-canvas to the CPU step on the canary and trybots, and remove --enable-accelerated-2d-canvas from the GPU step. 4. Rebaseline the fast/canvas tests that need new pixel results, and remove the suppressions from test_expectations.
Vangelis Kokkevis
Comment 5
2011-05-03 10:12:51 PDT
(In reply to
comment #4
)
> Delivery plan proposed by Stephen White: > > 1: Add --enable-legacy-accelerated-2d-canvas flag to both Chrome and DRT (won't do anything yet, since old path is still the default) > 2: Change the --accelerated-2d-canvas flag to mean Ganesh, not the old path, and remove the double-meaning of --enable-accelerated-drawing (have it mean only Alok's compositor -> skia stuff, not canvas2D). This should be a 1-liner in the code. Along with this change, submit suppressions to test_expectations for the new failures. > 3: Make canvas2D GPU (skia path) on by default in Chrome. Replace the --enable-accelerated-2d-canvas flag with --disable-accelerated-2d-canvas. Pass --disable-accelerated-2d-canvas to the CPU step on the canary and trybots, and remove --enable-accelerated-2d-canvas from the GPU step. > 4. Rebaseline the fast/canvas tests that need new pixel results, and remove the suppressions from test_expectations.
Sounds good. We should probably flip #3 and #4 so that we have the tests producing the correct results before we turn this on by default.
Justin Novosad
Comment 6
2011-05-03 10:46:55 PDT
(In reply to
comment #3
)
> (From update of
attachment 91924
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=91924&action=review
> > > Source/WebCore/page/Settings.cpp:722 > > +void Settings::setLegacyAccelerated2dCanvasEnabled(bool enabled) > > This is a chromium-only flag so I think it should only exist in the chromium websettings files much like it was done with the compositeToTexture flag in : > >
https://bugs.webkit.org/show_bug.cgi?id=52311
> > It will actually simplify things and you won't have to touch quite that many files.
I tried to do what you suggest, but the problem is that I can't figure out a clean way to access WebSettings from outside of WebKit/chromium/src. I think your suggestion might not work for what we are trying to do here, unless I am missing something?
Kenneth Russell
Comment 7
2011-05-03 11:12:50 PDT
Comment on
attachment 91924
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=91924&action=review
>>> Source/WebCore/page/Settings.cpp:722 >>> +void Settings::setLegacyAccelerated2dCanvasEnabled(bool enabled) >> >> This is a chromium-only flag so I think it should only exist in the chromium websettings files much like it was done with the compositeToTexture flag in : >> >>
https://bugs.webkit.org/show_bug.cgi?id=52311
>> >> It will actually simplify things and you won't have to touch quite that many files. > > I tried to do what you suggest, but the problem is that I can't figure out a clean way to access WebSettings from outside of WebKit/chromium/src. I think your suggestion might not work for what we are trying to do here, unless I am missing something?
No, you are correct. You can't access the Chromium WebKit API from WebCore. You can access it from Chrome sources and from within WebKit/chromium/src. The way you've done things looks fine.
> Source/WebCore/page/Settings.h:492 > + bool m_legacyAcceleratedCanvas2dEnabled : 1;
You need to initialize this new bit to false in the Settings constructor.
> Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h:100 > +#define WebKitLegacyAccelerated2dCanvasEnabledPreferenceKey @"WebKitLegacyAccelerated2dCanvasEnabled"
You don't need to touch any of these Mac-specific files. The Chromium port is the only one using this legacy accelerated canvas 2D code at this point, so it's better not to add the new flag to any of the other ports' WebPreferences-like classes.
Justin Novosad
Comment 8
2011-05-03 11:54:24 PDT
Created
attachment 92099
[details]
Patch
Kenneth Russell
Comment 9
2011-05-03 11:58:36 PDT
Comment on
attachment 92099
[details]
Patch Looks fine.
WebKit Commit Bot
Comment 10
2011-05-03 23:25:37 PDT
Comment on
attachment 92099
[details]
Patch Clearing flags on attachment: 92099 Committed
r85720
: <
http://trac.webkit.org/changeset/85720
>
WebKit Commit Bot
Comment 11
2011-05-03 23:25:43 PDT
All reviewed patches have been landed. Closing bug.
Justin Novosad
Comment 12
2011-05-04 08:58:45 PDT
(In reply to
comment #11
)
> All reviewed patches have been landed. Closing bug.
The patch that was landed is only phase 1. Further work on this issue continues here:
https://bugs.webkit.org/show_bug.cgi?id=60173
Simon Fraser (smfr)
Comment 13
2011-12-22 10:55:27 PST
Add legacyAccelerated2dCanvasEnabled to Settings with no explanatory comment is a bad thing to do. I have no idea what the difference is between these two prefs.
Justin Novosad
Comment 14
2011-12-22 11:53:42 PST
(In reply to
comment #13
)
> Add legacyAccelerated2dCanvasEnabled to Settings with no explanatory comment is a bad thing to do. I have no idea what the difference is between these two prefs.
Thanks for spotting this. This code is now vestigial, and should be cleaned out. Just created:
https://bugs.webkit.org/show_bug.cgi?id=75108
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