diff options
author | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-20 05:34:17 +0000 |
---|---|---|
committer | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-20 05:34:17 +0000 |
commit | ed3307fb8dcf971d28daa5a1d008b20d4508990c (patch) | |
tree | 0e8c2b2f5afad1c80e1b42b6d008b430f15a95b0 /cc | |
parent | 6ec70cc7ef252a95464f34ede4fcd86ff34f1bfd (diff) | |
download | chromium_src-ed3307fb8dcf971d28daa5a1d008b20d4508990c.zip chromium_src-ed3307fb8dcf971d28daa5a1d008b20d4508990c.tar.gz chromium_src-ed3307fb8dcf971d28daa5a1d008b20d4508990c.tar.bz2 |
CC: Cache non-ideal tiles, but don't paint them.
This patch never paints _new_ non-ideal tiles. The old ones
exist only because they are still being used (the ideal
resolution hasn't covered all non-ideal tiles yet).
BUG=307206
Review URL: https://codereview.chromium.org/71753003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236163 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/resources/tile_manager.cc | 24 | ||||
-rw-r--r-- | cc/test/test_tile_priorities.cc | 2 |
2 files changed, 19 insertions, 7 deletions
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 85c7fa1..84842fe 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -372,24 +372,36 @@ void TileManager::GetTilesWithAssignedBins(PrioritizedTileSet* tiles) { TilePriority pending_priority = tile->priority(PENDING_TREE); ManagedTileBin pending_bin = BinFromTilePriority(pending_priority); + bool pending_is_low_res = + pending_priority.resolution == LOW_RESOLUTION; + bool pending_is_non_ideal = + pending_priority.resolution == NON_IDEAL_RESOLUTION; + bool active_is_non_ideal = + active_priority.resolution == NON_IDEAL_RESOLUTION; + // Adjust pending bin state for low res tiles. This prevents // pending tree low-res tiles from being initialized before // high-res tiles. - if (pending_priority.resolution == LOW_RESOLUTION) + if (pending_is_low_res) pending_bin = std::max(pending_bin, EVENTUALLY_BIN); - // Compute combined bin. - ManagedTileBin combined_bin = std::min(active_bin, pending_bin); - // Adjust bin state based on if ready to draw. active_bin = kBinReadyToDrawMap[tile_is_ready_to_draw][active_bin]; pending_bin = kBinReadyToDrawMap[tile_is_ready_to_draw][pending_bin]; - combined_bin = kBinReadyToDrawMap[tile_is_ready_to_draw][combined_bin]; // Adjust bin state based on if active. active_bin = kBinIsActiveMap[tile_is_active][active_bin]; pending_bin = kBinIsActiveMap[tile_is_active][pending_bin]; - combined_bin = kBinIsActiveMap[tile_is_active][combined_bin]; + + // We never want to paint new non-ideal tiles, as we always have + // a high-res tile covering that content (paint that instead). + if (!tile_is_ready_to_draw && active_is_non_ideal) + active_bin = NEVER_BIN; + if (!tile_is_ready_to_draw && pending_is_non_ideal) + pending_bin = NEVER_BIN; + + // Compute combined bin. + ManagedTileBin combined_bin = std::min(active_bin, pending_bin); ManagedTileBin tree_bin[NUM_TREES]; tree_bin[ACTIVE_TREE] = kBinPolicyMap[memory_policy][active_bin]; diff --git a/cc/test/test_tile_priorities.cc b/cc/test/test_tile_priorities.cc index f83f9b9..9d3aae2 100644 --- a/cc/test/test_tile_priorities.cc +++ b/cc/test/test_tile_priorities.cc @@ -10,7 +10,7 @@ TilePriorityForSoonBin::TilePriorityForSoonBin() : TilePriority(HIGH_RESOLUTION, 0.5, 300.0) {} TilePriorityForEventualBin::TilePriorityForEventualBin() - : TilePriority(NON_IDEAL_RESOLUTION, 1.0, 315.0) {} + : TilePriority(HIGH_RESOLUTION, 2.0, 315.0) {} TilePriorityForNowBin::TilePriorityForNowBin() : TilePriority(HIGH_RESOLUTION, 0, 0) {} |