Teach WebView::scrollBackingStore about compositing mode
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Jan 2011 17:10:34 +0000 (17:10 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Jan 2011 17:10:34 +0000 (17:10 +0000)
Test:
    compositing/scroll-painted-composited-content.html

Fixes <http://webkit.org/b/52720> REGRESSION (r75987): Assertion failure in
WebView::scrollBackingStore when scrolling page with composited content

Reviewed by Anders Carlsson.

Source/WebKit/win:

* WebView.cpp:
(WebView::scrollBackingStore): Do something sensible (though naive) when in compositing
mode, rather than incorrectly asserting that this function is never called in that case. For
now we just repaint the entire scrolled region; someday hopefully we can avoid having to
repaint the areas that have just been moved.

LayoutTests:

Add a test that scrolls composited content that has already been painted

* compositing/scroll-painted-composited-content.html: Added.
* compositing/scroll-painted-composited-content-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76254 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/compositing/scroll-painted-composited-content-expected.txt [new file with mode: 0644]
LayoutTests/compositing/scroll-painted-composited-content.html [new file with mode: 0644]
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp

index 2d78244c8578aaeebf235f4023b644e9a98cbb30..36a300b1049e1a19f2b6b275770626e8e939b2a3 100644 (file)
@@ -1,3 +1,15 @@
+2011-01-19  Adam Roben  <aroben@apple.com>
+
+        Add a test that scrolls composited content that has already been painted
+
+        Test for <http://webkit.org/b/52720> REGRESSION (r75987): Assertion failure in
+        WebView::scrollBackingStore when scrolling page with composited content
+
+        Reviewed by Anders Carlsson.
+
+        * compositing/scroll-painted-composited-content.html: Added.
+        * compositing/scroll-painted-composited-content-expected.txt: Added.
+
 2011-01-20  Yury Semikhatsky  <yurys@chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/LayoutTests/compositing/scroll-painted-composited-content-expected.txt b/LayoutTests/compositing/scroll-painted-composited-content-expected.txt
new file mode 100644 (file)
index 0000000..8592fc9
--- /dev/null
@@ -0,0 +1,3 @@
+Test for Bug 52720 - REGRESSION (r75987): Assertion failure in WebView::scrollBackingStore when scrolling page with composited content. The test passes if it doesn't assert in Debug builds.
+
+
diff --git a/LayoutTests/compositing/scroll-painted-composited-content.html b/LayoutTests/compositing/scroll-painted-composited-content.html
new file mode 100644 (file)
index 0000000..7811087
--- /dev/null
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Test scrolling with composited content that has already been painted</title>
+    <style>
+        body {
+            width: 600px;
+        }
+        div {
+            -webkit-transform: translateZ(0);
+            width: 1000px;
+            height: 800px;
+        }
+    </style>
+</head>
+<body>
+    <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=52720">Bug 52720 - REGRESSION
+    (r75987): Assertion failure in WebView::scrollBackingStore when scrolling page with composited
+    content</a>. The test passes if it doesn't assert in Debug builds.</p>
+
+    <div></div>
+
+    <script>
+        if (window.layoutTestController) {
+            layoutTestController.dumpAsText();
+            // Force a paint so that the content will be painted at the current scroll offset (0x0)
+            // before we scroll.
+            layoutTestController.display();
+        }
+        window.scrollBy(300, 0);
+    </script>
+</body>
+</html>
index a564330f269bfcbb824ab1a0352594a747901503..54eac8237f8e036dc7ac1b0c264f42bc1e11468d 100644 (file)
@@ -1,3 +1,21 @@
+2011-01-19  Adam Roben  <aroben@apple.com>
+
+        Teach WebView::scrollBackingStore about compositing mode
+
+        Test:
+            compositing/scroll-painted-composited-content.html
+
+        Fixes <http://webkit.org/b/52720> REGRESSION (r75987): Assertion failure in
+        WebView::scrollBackingStore when scrolling page with composited content
+
+        Reviewed by Anders Carlsson.
+
+        * WebView.cpp:
+        (WebView::scrollBackingStore): Do something sensible (though naive) when in compositing
+        mode, rather than incorrectly asserting that this function is never called in that case. For
+        now we just repaint the entire scrolled region; someday hopefully we can avoid having to
+        repaint the areas that have just been moved.
+
 2011-01-19  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by Sam Weinig.
index 4c6a423e88c8e463a510461a37799a6eac63f79b..bf89ec99add86f2d6ae0501452b81441e56b1b99 100644 (file)
@@ -819,7 +819,12 @@ void WebView::addToDirtyRegion(HRGN newRegion)
 void WebView::scrollBackingStore(FrameView* frameView, int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect)
 {
 #if USE(ACCELERATED_COMPOSITING)
-    ASSERT(!isAcceleratedCompositing());
+    if (isAcceleratedCompositing()) {
+        // FIXME: We should be doing something smarter here, like moving tiles around and painting
+        // any newly-exposed tiles. <http://webkit.org/b/52714>
+        m_backingLayer->setNeedsDisplayInRect(scrollViewRect);
+        return;
+    }
 #endif
 
     LOCAL_GDI_COUNTER(0, __FUNCTION__);