@@ -2654,7 +2654,7 @@ public void clearView() {
26542654 checkThread ();
26552655 mContentWidth = 0 ;
26562656 mContentHeight = 0 ;
2657- setBaseLayer (0 , null , false , false , false );
2657+ setBaseLayer (0 , null , false , false );
26582658 mWebViewCore .sendMessage (EventHub .CLEAR_CONTENT );
26592659 }
26602660
@@ -4521,6 +4521,8 @@ protected void onDraw(Canvas canvas) {
45214521
45224522 if (canvas .isHardwareAccelerated ()) {
45234523 mZoomManager .setHardwareAccelerated ();
4524+ } else {
4525+ mWebViewCore .resumeWebKitDraw ();
45244526 }
45254527
45264528 int saveCount = canvas .save ();
@@ -4763,11 +4765,19 @@ private void offsetByLayerScrollPosition(Rect box) {
47634765 }
47644766
47654767 void setBaseLayer (int layer , Region invalRegion , boolean showVisualIndicator ,
4766- boolean isPictureAfterFirstLayout , boolean registerPageSwapCallback ) {
4768+ boolean isPictureAfterFirstLayout ) {
47674769 if (mNativeClass == 0 )
47684770 return ;
4769- nativeSetBaseLayer (mNativeClass , layer , invalRegion , showVisualIndicator ,
4770- isPictureAfterFirstLayout , registerPageSwapCallback );
4771+ boolean queueFull ;
4772+ queueFull = nativeSetBaseLayer (mNativeClass , layer , invalRegion ,
4773+ showVisualIndicator , isPictureAfterFirstLayout );
4774+
4775+ if (layer == 0 || isPictureAfterFirstLayout ) {
4776+ mWebViewCore .resumeWebKitDraw ();
4777+ } else if (queueFull ) {
4778+ mWebViewCore .pauseWebKitDraw ();
4779+ }
4780+
47714781 if (mHTML5VideoViewProxy != null ) {
47724782 mHTML5VideoViewProxy .setBaseLayer (layer );
47734783 }
@@ -9049,6 +9059,7 @@ private void setTouchHighlightRects(WebKitHitTest hit) {
90499059 /** @hide Called by JNI when pages are swapped (only occurs with hardware
90509060 * acceleration) */
90519061 protected void pageSwapCallback (boolean notifyAnimationStarted ) {
9062+ mWebViewCore .resumeWebKitDraw ();
90529063 if (inEditingMode ()) {
90539064 didUpdateWebTextViewDimensions (ANYWHERE );
90549065 }
@@ -9071,13 +9082,9 @@ void setNewPicture(final WebViewCore.DrawData draw, boolean updateBaseLayer) {
90719082 boolean isPictureAfterFirstLayout = viewState != null ;
90729083
90739084 if (updateBaseLayer ) {
9074- // Request a callback on pageSwap (to reposition the webtextview)
9075- boolean registerPageSwapCallback =
9076- !mZoomManager .isFixedLengthAnimationInProgress () && inEditingMode ();
9077-
90789085 setBaseLayer (draw .mBaseLayer , draw .mInvalRegion ,
90799086 getSettings ().getShowVisualIndicator (),
9080- isPictureAfterFirstLayout , registerPageSwapCallback );
9087+ isPictureAfterFirstLayout );
90819088 }
90829089 final Point viewSize = draw .mViewSize ;
90839090 // We update the layout (i.e. request a layout from the
@@ -9755,11 +9762,6 @@ protected void contentInvalidateAll() {
97559762 }
97569763 }
97579764
9758- /** @hide call pageSwapCallback upon next page swap */
9759- protected void registerPageSwapCallback () {
9760- nativeRegisterPageSwapCallback (mNativeClass );
9761- }
9762-
97639765 /** @hide discard all textures from tiles */
97649766 protected void discardAllTextures () {
97659767 nativeDiscardAllTextures ();
@@ -9922,10 +9924,9 @@ private native boolean nativeMoveCursor(int keyCode, int count,
99229924 private native void nativeSetFindIsEmpty ();
99239925 private native void nativeSetFindIsUp (boolean isUp );
99249926 private native void nativeSetHeightCanMeasure (boolean measure );
9925- private native void nativeSetBaseLayer (int nativeInstance ,
9927+ private native boolean nativeSetBaseLayer (int nativeInstance ,
99269928 int layer , Region invalRegion ,
9927- boolean showVisualIndicator , boolean isPictureAfterFirstLayout ,
9928- boolean registerPageSwapCallback );
9929+ boolean showVisualIndicator , boolean isPictureAfterFirstLayout );
99299930 private native int nativeGetBaseLayer ();
99309931 private native void nativeShowCursorTimed ();
99319932 private native void nativeReplaceBaseContent (int content );
@@ -9937,7 +9938,6 @@ private native void nativeSetSelectionPointer(int nativeInstance,
99379938 private native void nativeStopGL ();
99389939 private native Rect nativeSubtractLayers (Rect content );
99399940 private native int nativeTextGeneration ();
9940- private native void nativeRegisterPageSwapCallback (int nativeInstance );
99419941 private native void nativeDiscardAllTextures ();
99429942 private native void nativeTileProfilingStart ();
99439943 private native float nativeTileProfilingStop ();
0 commit comments