summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-09-22 15:34:29 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2011-09-23 14:26:00 -0700
commit85de57ad68c831729ebc46b87548ddb1e92ab6a5 (patch)
tree179e0a0cf8394f23471ec5978f90653d274cf84f
parent4bc6db35eafbb6f961c6bb08639c0dc211b6419c (diff)
downloadpackages_apps_Browser-85de57ad68c831729ebc46b87548ddb1e92ab6a5.zip
packages_apps_Browser-85de57ad68c831729ebc46b87548ddb1e92ab6a5.tar.gz
packages_apps_Browser-85de57ad68c831729ebc46b87548ddb1e92ab6a5.tar.bz2
UI for switching texture upload mode
For browser, default will be CPU upload until bug 5334978 fix. bug:5347539 The webkit part is in https://android-git.corp.google.com/g/#/c/137610/ Change-Id: Iec3a100dc142b28e54145f08a5c76210f8634cba
-rw-r--r--res/values/strings.xml2
-rw-r--r--res/xml/debug_preferences.xml5
-rw-r--r--src/com/android/browser/BrowserSettings.java10
-rw-r--r--src/com/android/browser/PreferenceKeys.java1
-rw-r--r--src/com/android/browser/WebViewProperties.java1
5 files changed, 19 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 307459c..47f217b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -567,6 +567,8 @@
<!-- Do not tranlsate. Development option -->
<string name="pref_development_visual_indicator" translatable="false">Enable Visual Indicator</string>
<!-- Do not tranlsate. Development option -->
+ <string name="pref_development_cpu_upload_path" translatable="false">Enable Cpu Upload Path</string>
+ <!-- Do not tranlsate. Development option -->
<string name="js_engine_flags" translatable="false">Set JS flags</string>
<!-- Do not tranlsate. Development option -->
<string name="pref_development_uastring" translatable="false">UAString</string>
diff --git a/res/xml/debug_preferences.xml b/res/xml/debug_preferences.xml
index 2d15ab2..abbd07e 100644
--- a/res/xml/debug_preferences.xml
+++ b/res/xml/debug_preferences.xml
@@ -39,6 +39,11 @@
android:defaultValue="false"
android:title="@string/pref_development_visual_indicator" />
+ <CheckBoxPreference
+ android:key="enable_cpu_upload_path"
+ android:defaultValue="true"
+ android:title="@string/pref_development_cpu_upload_path" />
+
<!-- The javascript console is enabled by default when the user has
also enabled debug mode by navigating to about:debug. -->
<CheckBoxPreference
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index cfaa18a..2c0b2ec 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -268,6 +268,9 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
settings.setProperty(WebViewProperties.gfxInvertedScreenContrast,
Float.toString(getInvertedContrast()));
+
+ settings.setProperty(WebViewProperties.gfxEnableCpuUploadPath,
+ enableCpuUploadPath() ? "true" : "false");
}
/**
@@ -672,6 +675,13 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
return mPrefs.getBoolean(PREF_ENABLE_VISUAL_INDICATOR, false);
}
+ public boolean enableCpuUploadPath() {
+ if (!isDebugEnabled()) {
+ return true;
+ }
+ return mPrefs.getBoolean(PREF_ENABLE_CPU_UPLOAD_PATH, true);
+ }
+
public boolean enableJavascriptConsole() {
if (!isDebugEnabled()) {
return false;
diff --git a/src/com/android/browser/PreferenceKeys.java b/src/com/android/browser/PreferenceKeys.java
index f3da937..89fcbfc 100644
--- a/src/com/android/browser/PreferenceKeys.java
+++ b/src/com/android/browser/PreferenceKeys.java
@@ -68,6 +68,7 @@ public interface PreferenceKeys {
static final String PREF_ENABLE_NAV_DUMP = "enable_nav_dump";
static final String PREF_ENABLE_TRACING = "enable_tracing";
static final String PREF_ENABLE_VISUAL_INDICATOR = "enable_visual_indicator";
+ static final String PREF_ENABLE_CPU_UPLOAD_PATH = "enable_cpu_upload_path";
static final String PREF_JAVASCRIPT_CONSOLE = "javascript_console";
static final String PREF_JS_ENGINE_FLAGS = "js_engine_flags";
static final String PREF_NORMAL_LAYOUT = "normal_layout";
diff --git a/src/com/android/browser/WebViewProperties.java b/src/com/android/browser/WebViewProperties.java
index 9a656d7..c410038 100644
--- a/src/com/android/browser/WebViewProperties.java
+++ b/src/com/android/browser/WebViewProperties.java
@@ -18,4 +18,5 @@ package com.android.browser;
public interface WebViewProperties {
static final String gfxInvertedScreen = "inverted";
static final String gfxInvertedScreenContrast = "inverted_contrast";
+ static final String gfxEnableCpuUploadPath = "enable_cpu_upload_path";
}