diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-17 22:50:01 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-17 22:50:01 +0000 |
commit | 56aca707d0ad5ace8c5513dae5e31f964ad8f8be (patch) | |
tree | 914281fe049f47c5c3a2abb77d6815d269a13598 /android_webview/common | |
parent | e842c17b0d0aaf1b389f56c7e12c0fff4b3b10bb (diff) | |
download | chromium_src-56aca707d0ad5ace8c5513dae5e31f964ad8f8be.zip chromium_src-56aca707d0ad5ace8c5513dae5e31f964ad8f8be.tar.gz chromium_src-56aca707d0ad5ace8c5513dae5e31f964ad8f8be.tar.bz2 |
[Android WebView] Turn on accelerated canvas based on View.isHardwareAccelerated
In onAttachedToWindow, check that if the view is hardware accelerated,
then enable hardware accelerated 2d canvas. Similarly disable canvas on
detach.
Note that accelerated 2d canvas is still off by default, but this patch
adds a command line switch to turn it on.
BUG=332273
Review URL: https://codereview.chromium.org/140753006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/common')
-rw-r--r-- | android_webview/common/aw_switches.cc | 2 | ||||
-rw-r--r-- | android_webview/common/aw_switches.h | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/android_webview/common/aw_switches.cc b/android_webview/common/aw_switches.cc index 216b4e3..2c78aa4 100644 --- a/android_webview/common/aw_switches.cc +++ b/android_webview/common/aw_switches.cc @@ -14,4 +14,6 @@ const char kTileMemoryMultiplier[] = "tile-memory-multiplier"; const char kNumGrallocBuffersPerWebview[] = "num-gralloc-buffers-per-webview"; +const char kEnableAccelerated2dCanvas[] = "enable-accelerated-2d-canvas"; + } // namespace switches diff --git a/android_webview/common/aw_switches.h b/android_webview/common/aw_switches.h index c718c05..7b31bfd 100644 --- a/android_webview/common/aw_switches.h +++ b/android_webview/common/aw_switches.h @@ -20,6 +20,10 @@ extern const char kTileMemoryMultiplier[]; // Maximum number of gralloc allocations per webview. extern const char kNumGrallocBuffersPerWebview[]; +// Explicitly enable accelerated 2d canvas. +// TODO(boliu): Remove this switch once on by default. +extern const char kEnableAccelerated2dCanvas[]; + } // namespace switches #endif // ANDROID_WEBVIEW_COMMON_AW_SWITCHES_H_ |