diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/webkit/ViewStateSerializer.java | 1 | ||||
| -rw-r--r-- | core/java/android/webkit/WebViewClassic.java | 27 | ||||
| -rw-r--r-- | core/java/android/webkit/WebViewCore.java | 11 |
3 files changed, 17 insertions, 22 deletions
diff --git a/core/java/android/webkit/ViewStateSerializer.java b/core/java/android/webkit/ViewStateSerializer.java index 35168cf..c161085 100644 --- a/core/java/android/webkit/ViewStateSerializer.java +++ b/core/java/android/webkit/ViewStateSerializer.java @@ -64,7 +64,6 @@ class ViewStateSerializer { draw.mViewState = new WebViewCore.ViewState(); draw.mContentSize = new Point(contentWidth, contentHeight); draw.mBaseLayer = baseLayer; - draw.mInvalRegion = new Region(0, 0, contentWidth, contentHeight); stream.close(); return draw; } diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java index bc43557..9cf0d54 100644 --- a/core/java/android/webkit/WebViewClassic.java +++ b/core/java/android/webkit/WebViewClassic.java @@ -2669,7 +2669,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc public void clearView() { mContentWidth = 0; mContentHeight = 0; - setBaseLayer(0, null, false, false); + setBaseLayer(0, false, false); mWebViewCore.sendMessage(EventHub.CLEAR_CONTENT); } @@ -4448,12 +4448,12 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc */ private SelectActionModeCallback mSelectCallback; - void setBaseLayer(int layer, Region invalRegion, boolean showVisualIndicator, + void setBaseLayer(int layer, boolean showVisualIndicator, boolean isPictureAfterFirstLayout) { if (mNativeClass == 0) return; boolean queueFull; - queueFull = nativeSetBaseLayer(mNativeClass, layer, invalRegion, + queueFull = nativeSetBaseLayer(mNativeClass, layer, showVisualIndicator, isPictureAfterFirstLayout); if (queueFull) { @@ -7848,7 +7848,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc boolean isPictureAfterFirstLayout = viewState != null; if (updateBaseLayer) { - setBaseLayer(draw.mBaseLayer, draw.mInvalRegion, + setBaseLayer(draw.mBaseLayer, getSettings().getShowVisualIndicator(), isPictureAfterFirstLayout); } @@ -7880,15 +7880,17 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc } mSendScrollEvent = true; - if (DebugFlags.WEB_VIEW) { - Rect b = draw.mInvalRegion.getBounds(); - Log.v(LOGTAG, "NEW_PICTURE_MSG_ID {" + - b.left+","+b.top+","+b.right+","+b.bottom+"}"); + int functor = 0; + if (mWebView.isHardwareAccelerated() + || mWebView.getLayerType() != View.LAYER_TYPE_HARDWARE) { + functor = nativeGetDrawGLFunction(mNativeClass); } - Rect invalBounds = draw.mInvalRegion.getBounds(); - if (!invalBounds.isEmpty()) { - invalidateContentRect(invalBounds); + + if (functor != 0) { + mWebView.getViewRootImpl().attachFunctor(functor); } else { + // invalidate the screen so that the next repaint will show new content + // TODO: partial invalidate mWebView.invalidate(); } @@ -8576,8 +8578,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc private native Rect nativeLayerBounds(int layer); private native void nativeSetHeightCanMeasure(boolean measure); private native boolean nativeSetBaseLayer(int nativeInstance, - int layer, Region invalRegion, - boolean showVisualIndicator, boolean isPictureAfterFirstLayout); + int layer, boolean showVisualIndicator, boolean isPictureAfterFirstLayout); private native int nativeGetBaseLayer(); private native void nativeReplaceBaseContent(int content); private native void nativeCopyBaseContentToPicture(Picture pict); diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index 75141fd..12c9d69 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -601,8 +601,7 @@ public final class WebViewCore { * Redraw a portion of the picture set. The Point wh returns the * width and height of the overall picture. */ - private native int nativeRecordContent(int nativeClass, Region invalRegion, - Point wh); + private native int nativeRecordContent(int nativeClass, Point wh); /** * Notify webkit that animations have begun (on the hardware accelerated content) @@ -2180,11 +2179,9 @@ public final class WebViewCore { static class DrawData { DrawData() { mBaseLayer = 0; - mInvalRegion = new Region(); mContentSize = new Point(); } int mBaseLayer; - Region mInvalRegion; // view size that was used by webkit during the most recent layout Point mViewSize; Point mContentSize; @@ -2230,8 +2227,7 @@ public final class WebViewCore { mDrawIsScheduled = false; DrawData draw = new DrawData(); if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "webkitDraw start"); - draw.mBaseLayer = nativeRecordContent(mNativeClass, draw.mInvalRegion, - draw.mContentSize); + draw.mBaseLayer = nativeRecordContent(mNativeClass, draw.mContentSize); if (draw.mBaseLayer == 0) { if (mWebViewClassic != null && !mWebViewClassic.isPaused()) { if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "webkitDraw abort, resending draw message"); @@ -2277,8 +2273,7 @@ public final class WebViewCore { // the draw path (and fix saving <canvas>) DrawData draw = new DrawData(); if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "saveViewState start"); - draw.mBaseLayer = nativeRecordContent(mNativeClass, draw.mInvalRegion, - draw.mContentSize); + draw.mBaseLayer = nativeRecordContent(mNativeClass, draw.mContentSize); boolean result = false; try { result = ViewStateSerializer.serializeViewState(stream, draw); |
