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:
Cary Clark
2009-04-23 13:12:19 -04:00
parent 843bbb8597
commit bc2e33b5c8
2 changed files with 10 additions and 1 deletions

View File

@@ -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;

View File

@@ -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);