OSDN Git Service

Fix WebViewCore::createBaseLayer() to always do a layout and paint the background...
authorSteve Block <steveblock@google.com>
Thu, 24 Nov 2011 15:24:03 +0000 (15:24 +0000)
committerSteve Block <steveblock@google.com>
Thu, 24 Nov 2011 15:56:20 +0000 (15:56 +0000)
It seems that it's not valid to do this only when the base layer's inval region
is not empty.

This is a partial revert of https://android-git.corp.google.com/g/#/c/142481.

Bug: 5501576
Change-Id: Ie608674e0b61e0d6280777583c64499ff5afe8a3

Source/WebKit/android/jni/WebViewCore.cpp

index 7692de1..6cc15d7 100644 (file)
@@ -897,17 +897,15 @@ BaseLayerAndroid* WebViewCore::createBaseLayer(SkRegion* region)
     BaseLayerAndroid* base = new BaseLayerAndroid();
     base->setContent(m_content);
 
-    if (!region->isEmpty()) {
-        m_skipContentDraw = true;
-        bool layoutSucceeded = layoutIfNeededRecursive(m_mainFrame);
-        m_skipContentDraw = false;
-        // Layout only fails if called during a layout.
-        LOG_ASSERT(layoutSucceeded, "Can never be called recursively");
-    }
+    m_skipContentDraw = true;
+    bool layoutSucceeded = layoutIfNeededRecursive(m_mainFrame);
+    m_skipContentDraw = false;
+    // Layout only fails if called during a layout.
+    LOG_ASSERT(layoutSucceeded, "Can never be called recursively");
 
 #if USE(ACCELERATED_COMPOSITING)
     // We set the background color
-    if (!region->isEmpty() && m_mainFrame && m_mainFrame->document()
+    if (m_mainFrame && m_mainFrame->document()
         && m_mainFrame->document()->body()) {
         Document* document = m_mainFrame->document();
         RefPtr<RenderStyle> style = document->styleForElementIgnoringPendingStylesheets(document->body());