@@ -2669,7 +2669,7 @@ public boolean pageDown(boolean bottom) {
26692669 public void clearView () {
26702670 mContentWidth = 0 ;
26712671 mContentHeight = 0 ;
2672- setBaseLayer (0 , null , false , false );
2672+ setBaseLayer (0 , false , false );
26732673 mWebViewCore .sendMessage (EventHub .CLEAR_CONTENT );
26742674 }
26752675
@@ -4448,12 +4448,12 @@ public void onConfigurationChanged(Configuration newConfig) {
44484448 */
44494449 private SelectActionModeCallback mSelectCallback ;
44504450
4451- void setBaseLayer (int layer , Region invalRegion , boolean showVisualIndicator ,
4451+ void setBaseLayer (int layer , boolean showVisualIndicator ,
44524452 boolean isPictureAfterFirstLayout ) {
44534453 if (mNativeClass == 0 )
44544454 return ;
44554455 boolean queueFull ;
4456- queueFull = nativeSetBaseLayer (mNativeClass , layer , invalRegion ,
4456+ queueFull = nativeSetBaseLayer (mNativeClass , layer ,
44574457 showVisualIndicator , isPictureAfterFirstLayout );
44584458
44594459 if (queueFull ) {
@@ -7848,7 +7848,7 @@ void setNewPicture(final WebViewCore.DrawData draw, boolean updateBaseLayer) {
78487848 boolean isPictureAfterFirstLayout = viewState != null ;
78497849
78507850 if (updateBaseLayer ) {
7851- setBaseLayer (draw .mBaseLayer , draw . mInvalRegion ,
7851+ setBaseLayer (draw .mBaseLayer ,
78527852 getSettings ().getShowVisualIndicator (),
78537853 isPictureAfterFirstLayout );
78547854 }
@@ -7880,15 +7880,17 @@ void setNewPicture(final WebViewCore.DrawData draw, boolean updateBaseLayer) {
78807880 }
78817881 mSendScrollEvent = true ;
78827882
7883- if ( DebugFlags . WEB_VIEW ) {
7884- Rect b = draw . mInvalRegion . getBounds ();
7885- Log . v ( LOGTAG , "NEW_PICTURE_MSG_ID {" +
7886- b . left + "," + b . top + "," + b . right + "," + b . bottom + "}" );
7883+ int functor = 0 ;
7884+ if ( mWebView . isHardwareAccelerated ()
7885+ || mWebView . getLayerType () != View . LAYER_TYPE_HARDWARE ) {
7886+ functor = nativeGetDrawGLFunction ( mNativeClass );
78877887 }
7888- Rect invalBounds = draw . mInvalRegion . getBounds ();
7889- if (! invalBounds . isEmpty () ) {
7890- invalidateContentRect ( invalBounds );
7888+
7889+ if (functor != 0 ) {
7890+ mWebView . getViewRootImpl (). attachFunctor ( functor );
78917891 } else {
7892+ // invalidate the screen so that the next repaint will show new content
7893+ // TODO: partial invalidate
78927894 mWebView .invalidate ();
78937895 }
78947896
@@ -8576,8 +8578,7 @@ private native void nativeUpdateDrawGLFunction(int nativeInstance, Rect rect
85768578 private native Rect nativeLayerBounds (int layer );
85778579 private native void nativeSetHeightCanMeasure (boolean measure );
85788580 private native boolean nativeSetBaseLayer (int nativeInstance ,
8579- int layer , Region invalRegion ,
8580- boolean showVisualIndicator , boolean isPictureAfterFirstLayout );
8581+ int layer , boolean showVisualIndicator , boolean isPictureAfterFirstLayout );
85818582 private native int nativeGetBaseLayer ();
85828583 private native void nativeReplaceBaseContent (int content );
85838584 private native void nativeCopyBaseContentToPicture (Picture pict );
0 commit comments