Loading core/java/android/webkit/WebViewCore.java +41 −0 Original line number Diff line number Diff line Loading @@ -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(); /** Loading Loading @@ -798,6 +803,7 @@ final class WebViewCore { "FREE_MEMORY", // = 145 "VALID_NODE_BOUNDS", // = 146 "SAVE_WEBARCHIVE", // = 147 "WEBKIT_DRAW_LAYERS", // = 148; }; class EventHub { Loading Loading @@ -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; Loading Loading @@ -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. Loading Loading @@ -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; Loading Loading @@ -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(); Loading @@ -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); Loading Loading @@ -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()) { Loading Loading
core/java/android/webkit/WebViewCore.java +41 −0 Original line number Diff line number Diff line Loading @@ -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(); /** Loading Loading @@ -798,6 +803,7 @@ final class WebViewCore { "FREE_MEMORY", // = 145 "VALID_NODE_BOUNDS", // = 146 "SAVE_WEBARCHIVE", // = 147 "WEBKIT_DRAW_LAYERS", // = 148; }; class EventHub { Loading Loading @@ -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; Loading Loading @@ -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. Loading Loading @@ -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; Loading Loading @@ -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(); Loading @@ -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); Loading Loading @@ -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()) { Loading