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

Unified Diff: android_webview/native/aw_settings.cc

Issue 140753006: [Android WebView] Turn on accelerated canvas based on View.isHardwareAccelerated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
Index: android_webview/native/aw_settings.cc
diff --git a/android_webview/native/aw_settings.cc b/android_webview/native/aw_settings.cc
index 0a1312d6ec34ecccc65a359548e3240994a0f3c2..9ca7e6d8e39152acac33fbbe16623e191e00a7c5 100644
--- a/android_webview/native/aw_settings.cc
+++ b/android_webview/native/aw_settings.cc
@@ -8,12 +8,14 @@
#include "android_webview/native/aw_contents.h"
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
+#include "base/command_line.h"
#include "base/supports_user_data.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/content_switches.h"
#include "jni/AwSettings_jni.h"
#include "webkit/common/user_agent/user_agent.h"
#include "webkit/common/webpreferences.h"
@@ -312,6 +314,11 @@ void AwSettings::PopulateWebPreferences(WebPreferences* web_prefs) {
Java_AwSettings_getPasswordEchoEnabledLocked(env, obj);
web_prefs->spatial_navigation_enabled =
Java_AwSettings_getSpatialNavigationLocked(env, obj);
+
+ web_prefs->accelerated_2d_canvas_enabled =
+ !CommandLine::ForCurrentProcess()->HasSwitch(
mnaganov (inactive) 2014/01/17 09:56:22 I don't really like checking the command line on e
boliu 2014/01/17 14:58:49 I guess that's the right tradeoff. Added an instan
+ switches::kDisableAccelerated2dCanvas) &&
+ Java_AwSettings_getEnableSupportedHardwareAcceleratedFeatures(env, obj);
}
static jlong Init(JNIEnv* env,

Powered by Google App Engine
This is Rietveld 408576698