Changeset 148089 in webkit


Ignore:
Timestamp:
Apr 10, 2013 4:34:53 AM (11 years ago)
Author:
Antti Koivisto
Message:

Create fewer tiles when page is loading
https://bugs.webkit.org/show_bug.cgi?id=114294

Source/WebCore:

Reviewed by Anders Carlsson.

We currently create speculative tiles immediately. Page is often changing rapidly during loading and
keeping the speculative tiles up to date creates extra work.

Tests: platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-speculative.html

platform/mac-wk2/tiled-drawing/tile-coverage-speculative.html

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::loadProgressingStatusChanged):

  • page/FrameView.cpp:

(WebCore::FrameView::adjustTiledBackingCoverage):
(WebCore::FrameView::setWasScrolledByUser):

User scrolling enables speculative tiling no matter what the load status.

  • page/FrameView.h:
  • rendering/RenderLayerBacking.cpp:

(WebCore::computeTileCoverage):
(WebCore::RenderLayerBacking::adjustTiledBackingCoverage):

Cover only the viewport during loading.

LayoutTests:

Reviewed by Anders Carlsson.

Reduced initial tile counts and new tests for speculative tiles.

  • platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt:
  • platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-expected.txt:
  • platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-speculative-expected.txt: Added.
  • platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-speculative.html: Added.
  • platform/mac-wk2/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt:
  • platform/mac-wk2/tiled-drawing/tile-coverage-speculative-expected.txt: Added.
  • platform/mac-wk2/tiled-drawing/tile-coverage-speculative.html: Added.
  • platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-expected.txt:
  • platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt:
  • platform/mac-wk2/tiled-drawing/use-tiled-drawing-expected.txt:
  • platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-body-layer-expected.txt:
  • platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-expected.txt:
  • platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-opacity-html-expected.txt:
  • platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-positioned-expected.txt:
  • platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-transformed-html-expected.txt:
  • platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-zoomed-expected.txt:
  • platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-html-background-expected.txt:
Location:
trunk
Files:
2 added
19 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148088 r148089  
     12013-04-10  Antti Koivisto  <antti@apple.com>
     2
     3        Create fewer tiles when page is loading
     4        https://bugs.webkit.org/show_bug.cgi?id=114294
     5
     6        Reviewed by Anders Carlsson.
     7       
     8        Reduced initial tile counts and new tests for speculative tiles.
     9
     10        * platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt:
     11        * platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-expected.txt:
     12        * platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-speculative-expected.txt: Added.
     13        * platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-speculative.html: Added.
     14        * platform/mac-wk2/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt:
     15        * platform/mac-wk2/tiled-drawing/tile-coverage-speculative-expected.txt: Added.
     16        * platform/mac-wk2/tiled-drawing/tile-coverage-speculative.html: Added.
     17        * platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-expected.txt:
     18        * platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt:
     19        * platform/mac-wk2/tiled-drawing/use-tiled-drawing-expected.txt:
     20        * platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-body-layer-expected.txt:
     21        * platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-expected.txt:
     22        * platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-opacity-html-expected.txt:
     23        * platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-positioned-expected.txt:
     24        * platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-transformed-html-expected.txt:
     25        * platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-zoomed-expected.txt:
     26        * platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-html-background-expected.txt:
     27
    1282013-04-10  Anton Obzhirov  <a.obzhirov@samsung.com>
    229
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt

    r141634 r148089  
    77      (drawsContent 1)
    88      (backgroundColor #FFFFFF)
    9       (tile cache coverage 0, 0 785 x 1700)
     9      (tile cache coverage 0, 0 785 x 1024)
    1010      (tile size 512 x 512)
    11       (top left tile 0, 0 tiles grid 2 x 4)
     11      (top left tile 0, 0 tiles grid 2 x 2)
    1212      (children 1
    1313        (GraphicsLayer
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-expected.txt

    r141634 r148089  
    99      (backgroundColor #FFFFFF)
    1010      (visible rect 0.00, 3000.00 785.00 x 600.00)
    11       (tile cache coverage 0, 2048 785 x 2560)
     11      (tile cache coverage 0, 2560 785 x 1536)
    1212      (tile size 512 x 512)
    13       (top left tile 0, 4 tiles grid 2 x 5)
     13      (top left tile 0, 5 tiles grid 2 x 3)
    1414      (children 1
    1515        (GraphicsLayer
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt

    r142526 r148089  
    99      (backgroundColor #FFFFFF)
    1010      (visible rect 0.00, 4421.00 785.00 x 600.00)
    11       (tile cache coverage 0, 3072 785 x 1949)
     11      (tile cache coverage 0, 4096 785 x 925)
    1212      (tile size 512 x 512)
    13       (top left tile 0, 6 tiles grid 2 x 4)
     13      (top left tile 0, 8 tiles grid 2 x 2)
    1414      (children 1
    1515        (GraphicsLayer
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/tile-coverage-speculative-expected.txt

    r148088 r148089  
    11(GraphicsLayer
    22  (bounds 785.00 5021.00)
    3   (visible rect 0.00, 4421.00 785.00 x 600.00)
     3  (visible rect 0.00, 0.00 785.00 x 600.00)
    44  (children 1
    55    (GraphicsLayer
     
    88      (drawsContent 1)
    99      (backgroundColor #FFFFFF)
    10       (visible rect 0.00, 4421.00 785.00 x 600.00)
    11       (tile cache coverage 0, 3072 785 x 1949)
     10      (visible rect 0.00, 0.00 785.00 x 600.00)
     11      (tile cache coverage 0, 0 785 x 2048)
    1212      (tile size 512 x 512)
    13       (top left tile 0, 6 tiles grid 2 x 4)
     13      (top left tile 0, 0 tiles grid 2 x 4)
    1414      (children 1
    1515        (GraphicsLayer
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-expected.txt

    r142338 r148089  
    1111      (transform [2.30 0.00 0.00 0.00] [0.00 2.30 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
    1212      (visible rect 0.00, 0.00 341.30 x 254.35)
    13       (tile cache coverage 0, 0 784 x 584)
     13      (tile cache coverage 0, 0 445 x 445)
    1414      (tile size 512 x 512)
    15       (top left tile 0, 0 tiles grid 4 x 3)
     15      (top left tile 0, 0 tiles grid 2 x 2)
    1616      (children 1
    1717        (GraphicsLayer
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt

    r141634 r148089  
    1111      (transform [2.30 0.00 0.00 0.00] [0.00 2.30 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
    1212      (visible rect 800.00, 1000.00 341.30 x 254.35)
    13       (tile cache coverage 445, 667 762 x 890)
     13      (tile cache coverage 667, 890 540 x 445)
    1414      (tile size 512 x 512)
    15       (top left tile 2, 3 tiles grid 4 x 4)
     15      (top left tile 3, 4 tiles grid 3 x 2)
    1616      (children 1
    1717        (GraphicsLayer
  • trunk/LayoutTests/platform/mac-wk2/tiled-drawing/use-tiled-drawing-expected.txt

    r141634 r148089  
    99      (backgroundColor #FFFFFF)
    1010      (visible rect 0.00, 0.00 785.00 x 585.00)
    11       (tile cache coverage 0, 0 1208 x 2021)
     11      (tile cache coverage 0, 0 1024 x 1024)
    1212      (tile size 512 x 512)
    13       (top left tile 0, 0 tiles grid 3 x 4)
     13      (top left tile 0, 0 tiles grid 2 x 2)
    1414      (children 1
    1515        (GraphicsLayer
  • trunk/LayoutTests/platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-body-layer-expected.txt

    r142235 r148089  
    1616          (bounds 785.00 1600.00)
    1717          (drawsContent 1)
    18           (tile cache coverage 0, 0 785 x 1600)
     18          (tile cache coverage 0, 0 785 x 1024)
    1919          (tile size 512 x 512)
    20           (top left tile 0, 0 tiles grid 2 x 4)
     20          (top left tile 0, 0 tiles grid 2 x 2)
    2121          (children 1
    2222            (GraphicsLayer
  • trunk/LayoutTests/platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-expected.txt

    r142235 r148089  
    1616          (bounds 785.00 1700.00)
    1717          (drawsContent 1)
    18           (tile cache coverage 0, 0 785 x 1700)
     18          (tile cache coverage 0, 0 785 x 1024)
    1919          (tile size 512 x 512)
    20           (top left tile 0, 0 tiles grid 2 x 4)
     20          (top left tile 0, 0 tiles grid 2 x 2)
    2121          (children 1
    2222            (GraphicsLayer
  • trunk/LayoutTests/platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-opacity-html-expected.txt

    r142224 r148089  
    1616          (bounds 785.00 1700.00)
    1717          (drawsContent 1)
    18           (tile cache coverage 0, 0 785 x 1700)
     18          (tile cache coverage 0, 0 785 x 1024)
    1919          (tile size 512 x 512)
    20           (top left tile 0, 0 tiles grid 2 x 4)
     20          (top left tile 0, 0 tiles grid 2 x 2)
    2121          (children 1
    2222            (GraphicsLayer
  • trunk/LayoutTests/platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-positioned-expected.txt

    r142235 r148089  
    1616          (bounds 785.00 3700.00)
    1717          (drawsContent 1)
    18           (tile cache coverage 0, 0 785 x 2048)
     18          (tile cache coverage 0, 0 785 x 1024)
    1919          (tile size 512 x 512)
    20           (top left tile 0, 0 tiles grid 2 x 4)
     20          (top left tile 0, 0 tiles grid 2 x 2)
    2121          (children 1
    2222            (GraphicsLayer
  • trunk/LayoutTests/platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-transformed-html-expected.txt

    r142235 r148089  
    1616          (bounds 795.00 1710.00)
    1717          (drawsContent 1)
    18           (tile cache coverage 0, 0 795 x 1710)
     18          (tile cache coverage 0, 0 795 x 1024)
    1919          (tile size 512 x 512)
    20           (top left tile 0, 0 tiles grid 2 x 4)
     20          (top left tile 0, 0 tiles grid 2 x 2)
    2121          (children 1
    2222            (GraphicsLayer
  • trunk/LayoutTests/platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-zoomed-expected.txt

    r142235 r148089  
    1818          (bounds 785.00 1700.00)
    1919          (drawsContent 1)
    20           (tile cache coverage 0, 0 784 x 890)
     20          (tile cache coverage 0, 0 445 x 667)
    2121          (tile size 512 x 512)
    22           (top left tile 0, 0 tiles grid 4 x 4)
     22          (top left tile 0, 0 tiles grid 2 x 3)
    2323          (children 1
    2424            (GraphicsLayer
  • trunk/LayoutTests/platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-html-background-expected.txt

    r142235 r148089  
    1616          (bounds 785.00 1516.00)
    1717          (drawsContent 1)
    18           (tile cache coverage 0, 0 785 x 1516)
     18          (tile cache coverage 0, 0 785 x 1024)
    1919          (tile size 512 x 512)
    20           (top left tile 0, 0 tiles grid 2 x 3)
     20          (top left tile 0, 0 tiles grid 2 x 2)
    2121          (children 1
    2222            (GraphicsLayer
  • trunk/Source/WebCore/ChangeLog

    r148087 r148089  
     12013-04-10  Antti Koivisto  <antti@apple.com>
     2
     3        Create fewer tiles when page is loading
     4        https://bugs.webkit.org/show_bug.cgi?id=114294
     5
     6        Reviewed by Anders Carlsson.
     7
     8        We currently create speculative tiles immediately. Page is often changing rapidly during loading and
     9        keeping the speculative tiles up to date creates extra work.
     10       
     11        Tests: platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-speculative.html
     12               platform/mac-wk2/tiled-drawing/tile-coverage-speculative.html
     13       
     14       * loader/FrameLoader.cpp:
     15        (WebCore::FrameLoader::loadProgressingStatusChanged):
     16        * page/FrameView.cpp:
     17        (WebCore::FrameView::adjustTiledBackingCoverage):
     18        (WebCore::FrameView::setWasScrolledByUser):
     19       
     20            User scrolling enables speculative tiling no matter what the load status.
     21
     22        * page/FrameView.h:
     23        * rendering/RenderLayerBacking.cpp:
     24        (WebCore::computeTileCoverage):
     25        (WebCore::RenderLayerBacking::adjustTiledBackingCoverage):
     26       
     27            Cover only the viewport during loading.
     28
    1292013-04-10  Alberto Garcia  <agarcia@igalia.com>
    230
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r148013 r148089  
    33213321{
    33223322    bool isLoadProgressing = m_frame->page()->progress()->isLoadProgressing();
    3323     m_frame->page()->mainFrame()->view()->updateLayerFlushThrottlingInAllFrames(isLoadProgressing);
     3323    FrameView* view = m_frame->page()->mainFrame()->view();
     3324    view->updateLayerFlushThrottlingInAllFrames(isLoadProgressing);
     3325    view->adjustTiledBackingCoverage();
    33243326}
    33253327
  • trunk/Source/WebCore/page/FrameView.cpp

    r148048 r148089  
    23122312}
    23132313
     2314void FrameView::adjustTiledBackingCoverage()
     2315{
     2316#if USE(ACCELERATED_COMPOSITING)
     2317    RenderView* renderView = this->renderView();
     2318    if (renderView && renderView->layer()->backing())
     2319        renderView->layer()->backing()->adjustTiledBackingCoverage();
     2320#endif
     2321}
     2322
    23142323void FrameView::layoutTimerFired(Timer<FrameView>*)
    23152324{
     
    34293438        return;
    34303439    m_maintainScrollPositionAnchor = 0;
     3440    if (m_wasScrolledByUser == wasScrolledByUser)
     3441        return;
    34313442    m_wasScrolledByUser = wasScrolledByUser;
     3443    adjustTiledBackingCoverage();
    34323444}
    34333445
  • trunk/Source/WebCore/page/FrameView.h

    r148031 r148089  
    238238
    239239    void updateLayerFlushThrottlingInAllFrames(bool isLoadProgressing);
     240    void adjustTiledBackingCoverage();
    240241
    241242    void beginDisableRepaints();
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r147937 r148089  
    4747#include "KeyframeList.h"
    4848#include "PluginViewBase.h"
     49#include "ProgressTracker.h"
    4950#include "RenderApplet.h"
    5051#include "RenderIFrame.h"
     
    209210}
    210211
     212static TiledBacking::TileCoverage computeTileCoverage(const RenderLayerBacking* backing)
     213{
     214    // FIXME: When we use TiledBacking for overflow, this should look at RenderView scrollability.
     215    Frame* frame = backing->owningLayer()->renderer()->frame();
     216    if (!frame)
     217        return TiledBacking::CoverageForVisibleArea;
     218
     219    TiledBacking::TileCoverage tileCoverage = TiledBacking::CoverageForVisibleArea;
     220    FrameView* frameView = frame->view();
     221    bool useMinimalTilesDuringLoading = frame->page()->progress()->isLoadProgressing() && !frameView->wasScrolledByUser();
     222    if (!useMinimalTilesDuringLoading) {
     223        bool clipsToExposedRect = backing->tiledBacking()->clipsToExposedRect();
     224        if (frameView->horizontalScrollbarMode() != ScrollbarAlwaysOff || clipsToExposedRect)
     225            tileCoverage |= TiledBacking::CoverageForHorizontalScrolling;
     226
     227        if (frameView->verticalScrollbarMode() != ScrollbarAlwaysOff || clipsToExposedRect)
     228            tileCoverage |= TiledBacking::CoverageForVerticalScrolling;
     229    }
     230    if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(backing->owningLayer())) {
     231        // Ask our TiledBacking for large tiles unless the only reason we're main-thread-scrolling
     232        // is a page overlay (find-in-page, the Web Inspector highlight mechanism, etc.).
     233        if (scrollingCoordinator->mainThreadScrollingReasons() & ~ScrollingCoordinator::ForcedOnMainThread)
     234            tileCoverage |= TiledBacking::CoverageForSlowScrolling;
     235    }
     236    return tileCoverage;
     237}
     238
    211239void RenderLayerBacking::adjustTiledBackingCoverage()
    212240{
     
    214242        return;
    215243
    216     TiledBacking::TileCoverage tileCoverage = TiledBacking::CoverageForVisibleArea;
    217 
    218     // FIXME: When we use TiledBacking for overflow, this should look at RenderView scrollability.
    219     Frame* frame = renderer()->frame();
    220     if (frame) {
    221         FrameView* frameView = frame->view();
    222         bool clipsToExposedRect = tiledBacking()->clipsToExposedRect();
    223         if (frameView->horizontalScrollbarMode() != ScrollbarAlwaysOff || clipsToExposedRect)
    224             tileCoverage |= TiledBacking::CoverageForHorizontalScrolling;
    225 
    226         if (frameView->verticalScrollbarMode() != ScrollbarAlwaysOff || clipsToExposedRect)
    227             tileCoverage |= TiledBacking::CoverageForVerticalScrolling;
    228 
    229         if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m_owningLayer)) {
    230             // Ask our TiledBacking for large tiles unless the only reason we're main-thread-scrolling
    231             // is a page overlay (find-in-page, the Web Inspector highlight mechanism, etc.).
    232             if (scrollingCoordinator->mainThreadScrollingReasons() & ~ScrollingCoordinator::ForcedOnMainThread)
    233                 tileCoverage |= TiledBacking::CoverageForSlowScrolling;
    234         }
    235     }
    236 
     244    TiledBacking::TileCoverage tileCoverage = computeTileCoverage(this);
    237245    tiledBacking()->setTileCoverage(tileCoverage);
    238246}
Note: See TracChangeset for help on using the changeset viewer.