don't swap out the history picture too soon
Wait until either the picture is not blank or the progress is complete.
This commit is contained in:
@@ -2844,7 +2844,7 @@ public class WebView extends AbsoluteLayout
|
||||
// Should only be called in UI thread
|
||||
void switchOutDrawHistory() {
|
||||
if (null == mWebViewCore) return; // CallbackProxy may trigger this
|
||||
if (mDrawHistory) {
|
||||
if (mDrawHistory && mWebViewCore.pictureReady()) {
|
||||
mDrawHistory = false;
|
||||
invalidate();
|
||||
int oldScrollX = mScrollX;
|
||||
|
||||
@@ -285,6 +285,11 @@ final class WebViewCore {
|
||||
* split into parts. Called from the UI thread.
|
||||
*/
|
||||
private native boolean nativeDrawContent(Canvas canvas, int color);
|
||||
|
||||
/**
|
||||
* check to see if picture is blank and in progress
|
||||
*/
|
||||
private native boolean nativePictureReady();
|
||||
|
||||
/**
|
||||
* Redraw a portion of the picture set. The Point wh returns the
|
||||
@@ -1347,6 +1352,10 @@ final class WebViewCore {
|
||||
}
|
||||
}
|
||||
|
||||
/* package */ boolean pictureReady() {
|
||||
return nativePictureReady();
|
||||
}
|
||||
|
||||
/*package*/ Picture copyContentPicture() {
|
||||
Picture result = new Picture();
|
||||
nativeCopyContentToPicture(result);
|
||||
|
||||
Reference in New Issue
Block a user