summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2010-11-01 16:58:01 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-11-01 16:58:01 -0700
commit7d0414885e426af5e4d90c1242f01bd979412df6 (patch)
tree6c5485952816e2c310eafc1b44610d0252e84f56
parentc9acd7d2f06f4ba8237006ce5930f09c0922d84b (diff)
parentfb7bc34b23f37d10be2c778ddc5ce86542b6573c (diff)
downloadframeworks_base-7d0414885e426af5e4d90c1242f01bd979412df6.zip
frameworks_base-7d0414885e426af5e4d90c1242f01bd979412df6.tar.gz
frameworks_base-7d0414885e426af5e4d90c1242f01bd979412df6.tar.bz2
Merge "Update layers only"
-rw-r--r--core/java/android/webkit/WebViewCore.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index 9a873b6..9edb267 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -472,6 +472,11 @@ final class WebViewCore {
*/
private native int nativeRecordContent(Region invalRegion, Point wh);
+ /**
+ * Update the layers' content
+ */
+ private native int nativeUpdateLayers();
+
private native boolean nativeFocusBoundsChanged();
/**
@@ -798,6 +803,7 @@ final class WebViewCore {
"FREE_MEMORY", // = 145
"VALID_NODE_BOUNDS", // = 146
"SAVE_WEBARCHIVE", // = 147
+ "WEBKIT_DRAW_LAYERS", // = 148;
};
class EventHub {
@@ -868,6 +874,9 @@ final class WebViewCore {
// Load and save web archives
static final int SAVE_WEBARCHIVE = 147;
+ // Update layers
+ static final int WEBKIT_DRAW_LAYERS = 148;
+
// Network-based messaging
static final int CLEAR_SSL_PREF_TABLE = 150;
@@ -953,6 +962,10 @@ final class WebViewCore {
webkitDraw();
break;
+ case WEBKIT_DRAW_LAYERS:
+ webkitDrawLayers();
+ break;
+
case DESTROY:
// Time to take down the world. Cancel all pending
// loads and destroy the native view and frame.
@@ -1800,6 +1813,7 @@ final class WebViewCore {
// Used to avoid posting more than one draw message.
private boolean mDrawIsScheduled;
+ private boolean mDrawLayersIsScheduled;
// Used to avoid posting more than one split picture message.
private boolean mSplitPictureIsScheduled;
@@ -1839,6 +1853,20 @@ final class WebViewCore {
boolean mFocusSizeChanged;
}
+ // Only update the layers' content, not the base surface
+ // PictureSet.
+ private void webkitDrawLayers() {
+ mDrawLayersIsScheduled = false;
+ if (mDrawIsScheduled) {
+ removeMessages(EventHub.WEBKIT_DRAW);
+ webkitDraw();
+ return;
+ }
+ DrawData draw = new DrawData();
+ draw.mBaseLayer = nativeUpdateLayers();
+ webkitDraw(draw);
+ }
+
private void webkitDraw() {
mDrawIsScheduled = false;
DrawData draw = new DrawData();
@@ -1848,6 +1876,10 @@ final class WebViewCore {
if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "webkitDraw abort");
return;
}
+ webkitDraw(draw);
+ }
+
+ private void webkitDraw(DrawData draw) {
if (mWebView != null) {
draw.mFocusSizeChanged = nativeFocusBoundsChanged();
draw.mViewSize = new Point(mCurrentViewWidth, mCurrentViewHeight);
@@ -1957,6 +1989,15 @@ final class WebViewCore {
}
}
+ // called from JNI
+ void layersDraw() {
+ synchronized (this) {
+ if (mDrawLayersIsScheduled) return;
+ mDrawLayersIsScheduled = true;
+ mEventHub.sendMessage(Message.obtain(null, EventHub.WEBKIT_DRAW_LAYERS));
+ }
+ }
+
// called by JNI
private void contentScrollBy(int dx, int dy, boolean animate) {
if (!mBrowserFrame.firstLayoutDone()) {