summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/nav
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-12-13 08:53:08 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-12-13 08:53:08 -0800
commitcc6205ef9a3d8f7e2710d5db536cc7c7fc7836a0 (patch)
tree2c1d017a6985b6a1e1d65e9d6831df22666ec856 /Source/WebKit/android/nav
parent6d459e9c12f67cdcae791b319995cd8ea27f4442 (diff)
parenta3a38731f4eeb01d2a42965b6c875d957999969d (diff)
downloadexternal_webkit-cc6205ef9a3d8f7e2710d5db536cc7c7fc7836a0.zip
external_webkit-cc6205ef9a3d8f7e2710d5db536cc7c7fc7836a0.tar.gz
external_webkit-cc6205ef9a3d8f7e2710d5db536cc7c7fc7836a0.tar.bz2
Merge "update callback mechanism, adds nativeDiscardAllTextures for TileBenchmark tool"
Diffstat (limited to 'Source/WebKit/android/nav')
-rw-r--r--Source/WebKit/android/nav/WebView.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 5e943ae..7861205 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -1907,7 +1907,7 @@ static bool nativeEvaluateLayersAnimations(JNIEnv *env, jobject obj, jint native
return false;
}
-static void nativeSetBaseLayer(JNIEnv *env, jobject obj, jint layer, jobject inval,
+static void nativeSetBaseLayer(JNIEnv *env, jobject obj, jint nativeView, jint layer, jobject inval,
jboolean showVisualIndicator,
jboolean isPictureAfterFirstLayout,
jboolean registerPageSwapCallback)
@@ -1916,7 +1916,7 @@ static void nativeSetBaseLayer(JNIEnv *env, jobject obj, jint layer, jobject inv
SkRegion invalRegion;
if (inval)
invalRegion = *GraphicsJNI::getNativeRegion(env, inval);
- GET_NATIVE_VIEW(env, obj)->setBaseLayer(layerImpl, invalRegion, showVisualIndicator,
+ ((WebView*)nativeView)->setBaseLayer(layerImpl, invalRegion, showVisualIndicator,
isPictureAfterFirstLayout,
registerPageSwapCallback);
}
@@ -2494,9 +2494,16 @@ static void nativeSetSelectionPointer(JNIEnv *env, jobject obj, jint nativeView,
((WebView*)nativeView)->setSelectionPointer(set, scale, x, y);
}
-static void nativeRegisterPageSwapCallback(JNIEnv *env, jobject obj)
+static void nativeRegisterPageSwapCallback(JNIEnv *env, jobject obj, jint nativeView)
{
- GET_NATIVE_VIEW(env, obj)->registerPageSwapCallback();
+ ((WebView*)nativeView)->registerPageSwapCallback();
+}
+
+static void nativeDiscardAllTextures(JNIEnv *env, jobject obj)
+{
+ //discard all textures for debugging/test purposes, but not gl backing memory
+ bool allTextures = true, deleteGLTextures = false;
+ TilesManager::instance()->discardTextures(allTextures, deleteGLTextures);
}
static void nativeTileProfilingStart(JNIEnv *env, jobject obj)
@@ -2593,8 +2600,8 @@ static jstring nativeGetProperty(JNIEnv *env, jobject obj, jstring key)
static void nativeOnTrimMemory(JNIEnv *env, jobject obj, jint level)
{
if (TilesManager::hardwareAccelerationEnabled()) {
- bool freeAllTextures = (level > TRIM_MEMORY_UI_HIDDEN);
- TilesManager::instance()->deallocateTextures(freeAllTextures);
+ bool freeAllTextures = (level > TRIM_MEMORY_UI_HIDDEN), glTextures = true;
+ TilesManager::instance()->discardTextures(freeAllTextures, glTextures);
}
}
@@ -2850,7 +2857,7 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeSetFindIsUp },
{ "nativeSetHeightCanMeasure", "(Z)V",
(void*) nativeSetHeightCanMeasure },
- { "nativeSetBaseLayer", "(ILandroid/graphics/Region;ZZZ)V",
+ { "nativeSetBaseLayer", "(IILandroid/graphics/Region;ZZZ)V",
(void*) nativeSetBaseLayer },
{ "nativeGetTextSelectionRegion", "(ILandroid/graphics/Region;)V",
(void*) nativeGetTextSelectionRegion },
@@ -2868,8 +2875,10 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeSetSelectionPointer },
{ "nativeShowCursorTimed", "()V",
(void*) nativeShowCursorTimed },
- { "nativeRegisterPageSwapCallback", "()V",
+ { "nativeRegisterPageSwapCallback", "(I)V",
(void*) nativeRegisterPageSwapCallback },
+ { "nativeDiscardAllTextures", "()V",
+ (void*) nativeDiscardAllTextures },
{ "nativeTileProfilingStart", "()V",
(void*) nativeTileProfilingStart },
{ "nativeTileProfilingStop", "()F",