Fully invalidate the pictureset when content size changes
bug:5759299
Webkit invals aren't correct when the content size changes (even simply growing
vertically), for now just repaint from scratch in that case.
Change-Id: I408b289bfee1139d6c8f3c7babd963d217cb5bc0
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index b998e99..1e406b1 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -673,10 +673,20 @@
content->clear();
#if USE(ACCELERATED_COMPOSITING)
- // Detects if the content size has changed
- bool contentSizeChanged = false;
- if (content->width() != width || content->height() != height)
- contentSizeChanged = true;
+ // The invals are not always correct when the content size has changed. For
+ // now, let's just reset the inval so that it invalidates the entire content
+ // -- the pictureset will be fully repainted, tiles will be marked dirty and
+ // will have to be repainted.
+
+ // FIXME: the webkit invals ought to have been enough...
+ if (content->width() != width || content->height() != height) {
+ SkIRect r;
+ r.fLeft = 0;
+ r.fTop = 0;
+ r.fRight = width;
+ r.fBottom = height;
+ m_addInval.setRect(r);
+ }
#endif
content->setDimensions(width, height, &m_addInval);
@@ -700,23 +710,6 @@
// Rebuild the pictureset (webkit repaint)
rebuildPictureSet(content);
-
-#if USE(ACCELERATED_COMPOSITING)
- // We repainted the pictureset, but the invals are not always correct when
- // the content size did change. For now, let's just reset the
- // inval we will pass to the UI so that it invalidates the entire
- // content -- tiles will be marked dirty and will have to be repainted.
- // FIXME: the webkit invals ought to have been enough...
- if (contentSizeChanged) {
- SkIRect r;
- r.fLeft = 0;
- r.fTop = 0;
- r.fRight = width;
- r.fBottom = height;
- m_addInval.setRect(r);
- }
-#endif
-
} // WebViewCoreRecordTimeCounter
WebCore::Node* oldFocusNode = currentFocus();