Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2697)

Unified Diff: android_webview/native/aw_settings.cc

Issue 211623005: aw: Use minimum_accelerated_2d_canvas_size to turn canvas on/off (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 100M Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_settings.cc
diff --git a/android_webview/native/aw_settings.cc b/android_webview/native/aw_settings.cc
index e2379ed5586eeac603d30df2a8e58c0f278336c0..cf66d4e85e706f99be4395d130755c74ef4a920b 100644
--- a/android_webview/native/aw_settings.cc
+++ b/android_webview/native/aw_settings.cc
@@ -326,10 +326,16 @@ void AwSettings::PopulateWebPreferencesLocked(
web_prefs->spatial_navigation_enabled =
Java_AwSettings_getSpatialNavigationLocked(env, obj);
- web_prefs->accelerated_2d_canvas_enabled =
- !accelerated_2d_canvas_disabled_by_switch_ &&
- Java_AwSettings_getEnableSupportedHardwareAcceleratedFeaturesLocked(
- env, obj);
+ web_prefs->accelerated_2d_canvas_enabled = true;
+ if (accelerated_2d_canvas_disabled_by_switch_ ||
+ !Java_AwSettings_getEnableSupportedHardwareAcceleratedFeaturesLocked(
+ env, obj)) {
+ // Any canvas smaller than this will fallback to software. Abusing this
+ // slightly to turn canvas off without changing
+ // accelerated_2d_canvas_enabled, which also affects compositing mode.
+ // Using 100M instead of max int to avoid overflows.
+ web_prefs->minimum_accelerated_2d_canvas_size = 100 * 1000 * 1000;
+ }
}
static jlong Init(JNIEnv* env,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698