From e47ac47d6c744ea1cc242a002754598eeee79335 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Thu, 11 Mar 2010 14:53:07 -0800 Subject: [PATCH] If the Picture is not ready, just draw the background and return. This should help to avoid the flash in gm. Fix http://b/issue?id=2494990 --- core/java/android/webkit/WebView.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 825ea464186d..00a80a57587f 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3115,6 +3115,14 @@ public class WebView extends AbsoluteLayout return; } + // if both mContentWidth and mContentHeight are 0, it means there is no + // valid Picture passed to WebView yet. This can happen when WebView + // just starts. Draw the background and return. + if ((mContentWidth | mContentHeight) == 0 && mHistoryPicture == null) { + canvas.drawColor(mBackgroundColor); + return; + } + int saveCount = canvas.save(); if (mInOverScrollMode && getSettings().getUseSystemOverscrollBackground()) { -- 2.11.0