summaryrefslogtreecommitdiffstats
path: root/cc/tiled_layer.h
diff options
context:
space:
mode:
authorepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 20:26:46 +0000
committerepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 20:26:46 +0000
commit8d9317254ae5a9044bcb5e454139be1422b50ad4 (patch)
treed8b9c677ef4a73d9350852b82b2720e3769983e5 /cc/tiled_layer.h
parent5fdb45bd56f20aa4f103ee5a4b5a4d57b25b09d4 (diff)
downloadchromium_src-8d9317254ae5a9044bcb5e454139be1422b50ad4.zip
chromium_src-8d9317254ae5a9044bcb5e454139be1422b50ad4.tar.gz
chromium_src-8d9317254ae5a9044bcb5e454139be1422b50ad4.tar.bz2
cc: Add predictive pre-painting.
When scrolling quickly and with painting just barely able to keep up, it's possible get into a bad state where we always do visible painting and never get a chance to paint ahead of the fold. This shows up as flickering at the bottom of the page. This patch has two parts. First, it uses a scroll prediction when choosing what to paint (both for 'visible' and off-screen painting). Second, it adds a very simple scroll predictor based on the change in the visibleContentRect. The second part should almost certainly be improved (use impl-thread scroll/animation directions/velocities) but this provides an initial estimate that helps in the most important case (basic scrolling of big layers). This doesn't actually change the priorities of textures in the scroll direction (but changing the visible rect does this partially). This is not an issue currently since the what-to-paint logic doesn't strictly adhere to priority order. BUG=121957 Review URL: https://chromiumcodereview.appspot.com/11193010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163665 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/tiled_layer.h')
-rw-r--r--cc/tiled_layer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/cc/tiled_layer.h b/cc/tiled_layer.h
index 0712c5f..d3ec856 100644
--- a/cc/tiled_layer.h
+++ b/cc/tiled_layer.h
@@ -83,6 +83,7 @@ private:
bool haveTexturesForTiles(int left, int top, int right, int bottom, bool ignoreOcclusions);
IntRect markTilesForUpdate(int left, int top, int right, int bottom, bool ignoreOcclusions);
void updateTileTextures(const IntRect& paintRect, int left, int top, int right, int bottom, TextureUpdateQueue&, const OcclusionTracker*, RenderingStats&);
+ void updateScrollPrediction();
UpdatableTile* tileAt(int, int) const;
UpdatableTile* createTile(int, int);
@@ -91,6 +92,12 @@ private:
bool m_skipsDraw;
bool m_failedUpdate;
+ // Used for predictive painting.
+ IntSize m_predictedScroll;
+ IntRect m_predictedVisibleRect;
+ IntRect m_previousVisibleRect;
+ IntSize m_previousContentBounds;
+
TilingOption m_tilingOption;
scoped_ptr<LayerTilingData> m_tiler;
};