summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Antoine LaFayette <plafayet@codeaurora.org>2012-03-02 22:02:31 (GMT)
committerPierre-Antoine LaFayette <plafayet@codeaurora.org>2012-05-14 22:04:25 (GMT)
commit75aab57859de45a0aaec5a7cad41a12111e9a82e (patch)
tree7ca27b7259b452a6b0080dfcfe742557a6e6755b
parent307d4a2b5b20f2609497ceaea1eca2e29a8a781f (diff)
Runtime enablement of WebGL
Hooks up with the Java side to enable/disable WebGL through the debug menu. Depends-On: https://review-android.quicinc.com/#change,108780 Change-Id: I1601a835bc358b607f7d58d1224c71e2e8cd1e62
-rw-r--r--Source/WebKit/android/jni/WebSettings.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/Source/WebKit/android/jni/WebSettings.cpp b/Source/WebKit/android/jni/WebSettings.cpp
index f732716..4b921df 100644
--- a/Source/WebKit/android/jni/WebSettings.cpp
+++ b/Source/WebKit/android/jni/WebSettings.cpp
@@ -142,6 +142,9 @@ struct FieldIds {
mUseDoubleTree = env->GetFieldID(clazz, "mUseDoubleTree", "Z");
mPageCacheCapacity = env->GetFieldID(clazz, "mPageCacheCapacity", "I");
mWOFFEnabled = env->GetFieldID(clazz, "mWOFFEnabled", "Z");
+#if ENABLE(WEBGL)
+ mWebGLEnabled = env->GetFieldID(clazz, "mWebGLEnabled", "Z");
+#endif
#if ENABLE(WEB_AUTOFILL)
mAutoFillEnabled = env->GetFieldID(clazz, "mAutoFillEnabled", "Z");
mAutoFillProfile = env->GetFieldID(clazz, "mAutoFillProfile", "Landroid/webkit/WebSettings$AutoFillProfile;");
@@ -202,6 +205,9 @@ struct FieldIds {
LOG_ASSERT(mUseDoubleTree, "Could not find field mUseDoubleTree");
LOG_ASSERT(mPageCacheCapacity, "Could not find field mPageCacheCapacity");
LOG_ASSERT(mWOFFEnabled, "Could not find field mWOFFEnabled");
+#if ENABLE(WEBGL)
+ LOG_ASSERT(mWebGLEnabled, "Could not find field mWebGLEnabled");
+#endif
jclass enumClass = env->FindClass("java/lang/Enum");
LOG_ASSERT(enumClass, "Could not find Enum class!");
@@ -252,6 +258,9 @@ struct FieldIds {
jfieldID mUseDoubleTree;
jfieldID mPageCacheCapacity;
jfieldID mWOFFEnabled;
+#if ENABLE(WEBGL)
+ jfieldID mWebGLEnabled;
+#endif
// Ordinal() method and value field for enums
jmethodID mOrdinal;
jfieldID mTextSizeValue;
@@ -566,6 +575,11 @@ public:
flag = env->GetBooleanField(obj, gFieldIds->mWOFFEnabled);
s->setWOFFEnabled(flag);
+#if ENABLE(WEBGL)
+ flag = env->GetBooleanField(obj, gFieldIds->mWebGLEnabled);
+ s->setWebGLEnabled(flag);
+#endif
+
#if ENABLE(WEB_AUTOFILL)
flag = env->GetBooleanField(obj, gFieldIds->mAutoFillEnabled);
// TODO: This updates the Settings WebCore side with the user's
@@ -603,10 +617,6 @@ public:
str = (jstring)env->GetObjectField(obj, gFieldIds->mDataPath);
WebCore::INodeProxy::setAppDataPath(jstringToWtfString(env, str));
#endif
-
-#if ENABLE(WEBGL)
- s->setWebGLEnabled(false);
-#endif
}
};