Title: [185897] trunk/Source/WebCore
Revision
185897
Author
akl...@apple.com
Date
2015-06-23 19:09:24 -0700 (Tue, 23 Jun 2015)

Log Message

Should reduce tile coverage for the first paint after a tab switch.
<https://webkit.org/b/146252>
<rdar://problem/19821583>

Reviewed by Darin Adler.

Reduce the number of tiles we need to paint after switching tabs,
to shorten the time it takes before we can flush pixels to screen.

We accomplish this by piggybacking on the "speculative tiling enabled"
mode of FrameView, which was previously only used to throttle painting
and layer flushes during page load.

When a FrameView becomes visible, which is what happens when you
switch to its tab, we revert the speculative tiling optimization to
its initial state, and reset the "scrolled by user" flag.

In practice this means that after switching tabs, we only generate
enough tiles to fill the viewport. Then, after 500ms has passed
or the user scrolls the page, we go back to the usual speculative
tiling mode.

* page/FrameView.cpp:
(WebCore::FrameView::show):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (185896 => 185897)


--- trunk/Source/WebCore/ChangeLog	2015-06-24 02:04:38 UTC (rev 185896)
+++ trunk/Source/WebCore/ChangeLog	2015-06-24 02:09:24 UTC (rev 185897)
@@ -1,3 +1,30 @@
+2015-06-23  Andreas Kling  <akl...@apple.com>
+
+        Should reduce tile coverage for the first paint after a tab switch.
+        <https://webkit.org/b/146252>
+        <rdar://problem/19821583>
+
+        Reviewed by Darin Adler.
+
+        Reduce the number of tiles we need to paint after switching tabs,
+        to shorten the time it takes before we can flush pixels to screen.
+
+        We accomplish this by piggybacking on the "speculative tiling enabled"
+        mode of FrameView, which was previously only used to throttle painting
+        and layer flushes during page load.
+
+        When a FrameView becomes visible, which is what happens when you
+        switch to its tab, we revert the speculative tiling optimization to
+        its initial state, and reset the "scrolled by user" flag.
+
+        In practice this means that after switching tabs, we only generate
+        enough tiles to fill the viewport. Then, after 500ms has passed
+        or the user scrolls the page, we go back to the usual speculative
+        tiling mode.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::show):
+
 2015-06-23  Anders Carlsson  <ander...@apple.com>
 
         Remove windowResizerRect code, nobody is using it anymore

Modified: trunk/Source/WebCore/page/FrameView.cpp (185896 => 185897)


--- trunk/Source/WebCore/page/FrameView.cpp	2015-06-24 02:04:38 UTC (rev 185896)
+++ trunk/Source/WebCore/page/FrameView.cpp	2015-06-24 02:09:24 UTC (rev 185897)
@@ -2485,6 +2485,19 @@
     adjustTiledBackingCoverage();
 }
 
+void FrameView::show()
+{
+    ScrollView::show();
+
+    if (frame().isMainFrame()) {
+        // Turn off speculative tiling for a brief moment after a FrameView appears on screen.
+        // Note that adjustTiledBackingCoverage() kicks the (500ms) timer to re-enable it.
+        m_speculativeTilingEnabled = false;
+        m_wasScrolledByUser = false;
+        adjustTiledBackingCoverage();
+    }
+}
+
 void FrameView::layoutTimerFired()
 {
 #ifdef INSTRUMENT_LAYOUT_SCHEDULING

Modified: trunk/Source/WebCore/page/FrameView.h (185896 => 185897)


--- trunk/Source/WebCore/page/FrameView.h	2015-06-24 02:04:38 UTC (rev 185896)
+++ trunk/Source/WebCore/page/FrameView.h	2015-06-24 02:09:24 UTC (rev 185897)
@@ -544,6 +544,8 @@
 
     void didChangeScrollOffset();
 
+    void show() override;
+
 protected:
     virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) override;
     virtual void scrollContentsSlowPath(const IntRect& updateRect) override;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to