diff options
author | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-01 13:13:23 +0000 |
---|---|---|
committer | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-01 13:13:23 +0000 |
commit | a4e454984bd0f758bab24c5c8bd4eef68eb19f6f (patch) | |
tree | f81e39b6e9939f00a47aab5c1640bb902365aeed /cc | |
parent | 3cf8fe52af3d6266fe041a70a7c079391cd8b8af (diff) | |
download | chromium_src-a4e454984bd0f758bab24c5c8bd4eef68eb19f6f.zip chromium_src-a4e454984bd0f758bab24c5c8bd4eef68eb19f6f.tar.gz chromium_src-a4e454984bd0f758bab24c5c8bd4eef68eb19f6f.tar.bz2 |
Revert of cc: Change required_for_activation bookkeeping. (https://codereview.chromium.org/257773009/)
Reason for revert:
Caused context_lost tests to hang on Win and Mac GPU bots. See original CL for links to failing builds.
Original issue's description:
> cc: Change required_for_activation bookkeeping.
>
> This patch changes the bookkeeping of whether required for activation
> tiles all received memory during AssignGpuMemory. The new approach
> doesn't rely on the fact that we process every tile in that loop, thus
> allowing us to early out or use another approach at getting tiles that
> does not guarantee that every tile will be visited.
>
> The end goal is to evaluate if we can activate when the rasterizer
> notifies us that all tasks given to it that are required for
> activation are finished rather than trying to figure this out
> when we schedule tasks.
>
> R=reveman, enne
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267400
TBR=enne@chromium.org,reveman@chromium.org,vmpstr@chromium.org
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/269633006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267521 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/layers/picture_layer_impl.cc | 20 | ||||
-rw-r--r-- | cc/layers/picture_layer_impl.h | 14 | ||||
-rw-r--r-- | cc/resources/tile_manager.cc | 28 | ||||
-rw-r--r-- | cc/test/fake_tile_manager_client.h | 2 |
4 files changed, 10 insertions, 54 deletions
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc index 5d3fb86..1475232 100644 --- a/cc/layers/picture_layer_impl.cc +++ b/cc/layers/picture_layer_impl.cc @@ -56,9 +56,7 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, int id) should_update_tile_priorities_(false), should_use_low_res_tiling_(tree_impl->settings().create_low_res_tiling), use_gpu_rasterization_(false), - layer_needs_to_register_itself_(true), - uninitialized_tiles_required_for_activation_count_(0) { -} + layer_needs_to_register_itself_(true) {} PictureLayerImpl::~PictureLayerImpl() { if (!layer_needs_to_register_itself_) @@ -407,7 +405,6 @@ void PictureLayerImpl::UpdateTilePriorities() { contents_scale_x(), current_frame_time_in_seconds); - uninitialized_tiles_required_for_activation_count_ = 0; if (layer_tree_impl()->IsPendingTree()) MarkVisibleResourcesAsRequired(); @@ -420,13 +417,6 @@ void PictureLayerImpl::NotifyTileInitialized(const Tile* tile) { gfx::RectF layer_damage_rect = gfx::ScaleRect(tile->content_rect(), 1.f / tile->contents_scale()); AddDamageRect(layer_damage_rect); - - DCHECK_EQ(0, uninitialized_tiles_required_for_activation_count_); - } else if (layer_tree_impl()->IsPendingTree()) { - if (tile->required_for_activation()) { - DCHECK_GT(uninitialized_tiles_required_for_activation_count_, 0); - --uninitialized_tiles_required_for_activation_count_; - } } } @@ -745,7 +735,7 @@ ResourceProvider::ResourceId PictureLayerImpl::ContentsResourceId() const { return tile_version.get_resource_id(); } -void PictureLayerImpl::MarkVisibleResourcesAsRequired() { +void PictureLayerImpl::MarkVisibleResourcesAsRequired() const { DCHECK(layer_tree_impl()->IsPendingTree()); DCHECK(!layer_tree_impl()->needs_update_draw_properties()); DCHECK(ideal_contents_scale_); @@ -853,7 +843,7 @@ bool PictureLayerImpl::MarkVisibleTilesAsRequired( const PictureLayerTiling* optional_twin_tiling, float contents_scale, const gfx::Rect& rect, - const Region& missing_region) { + const Region& missing_region) const { bool twin_had_missing_tile = false; for (PictureLayerTiling::CoverageIterator iter(tiling, contents_scale, @@ -880,10 +870,8 @@ bool PictureLayerImpl::MarkVisibleTilesAsRequired( continue; } } - DCHECK(!tile->required_for_activation()); + tile->MarkRequiredForActivation(); - if (!tile->IsReadyToDraw()) - ++uninitialized_tiles_required_for_activation_count_; } return twin_had_missing_tile; } diff --git a/cc/layers/picture_layer_impl.h b/cc/layers/picture_layer_impl.h index fc43b07..bf24251 100644 --- a/cc/layers/picture_layer_impl.h +++ b/cc/layers/picture_layer_impl.h @@ -140,14 +140,6 @@ class CC_EXPORT PictureLayerImpl WhichTree GetTree() const; bool IsOnActiveOrPendingTree() const; - // Return the count of tiles on this layer that meet both of the following - // conditions: - // 1. The tile is required for activation. - // 2. The tile needs initialization (ie, it's not ready to draw). - int UninitializedTilesRequiredForActivationCount() const { - return uninitialized_tiles_required_for_activation_count_; - } - protected: friend class LayerRasterTileIterator; @@ -171,13 +163,13 @@ class CC_EXPORT PictureLayerImpl float SnappedContentsScale(float new_contents_scale); void UpdateLCDTextStatus(bool new_status); void ResetRasterScale(); - void MarkVisibleResourcesAsRequired(); + void MarkVisibleResourcesAsRequired() const; bool MarkVisibleTilesAsRequired( PictureLayerTiling* tiling, const PictureLayerTiling* optional_twin_tiling, float contents_scale, const gfx::Rect& rect, - const Region& missing_region); + const Region& missing_region) const; void DoPostCommitInitializationIfNeeded() { if (needs_post_commit_initialization_) @@ -229,8 +221,6 @@ class CC_EXPORT PictureLayerImpl gfx::Size viewport_size_for_tile_priority_; gfx::Transform screen_space_transform_for_tile_priority_; - int uninitialized_tiles_required_for_activation_count_; - friend class PictureLayer; DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); }; diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index eb389c5..38948c3 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -675,8 +675,7 @@ void TileManager::GetTilesWithAssignedBins(PrioritizedTileSet* tiles) { // should keep it in the prioritized tile set to ensure that AssignGpuMemory // can visit it. if (mts.bin == NEVER_BIN && - !mts.tile_versions[mts.raster_mode].raster_task_ && - !tile->required_for_activation()) { + !mts.tile_versions[mts.raster_mode].raster_task_) { FreeResourcesForTile(tile); continue; } @@ -841,7 +840,6 @@ void TileManager::AssignGpuMemoryToTiles( size_t max_raster_bytes = max_raster_usage_bytes_ / 2; size_t raster_bytes = 0; - int processed_required_for_activation_tile_count = 0; unsigned schedule_priority = 1u; for (PrioritizedTileSet::Iterator it(tiles, true); it; ++it) { Tile* tile = *it; @@ -861,8 +859,6 @@ void TileManager::AssignGpuMemoryToTiles( // If the tile is not needed, free it up. if (mts.bin == NEVER_BIN) { FreeResourcesForTile(tile); - if (tile->required_for_activation()) - ++processed_required_for_activation_tile_count; continue; } @@ -921,10 +917,8 @@ void TileManager::AssignGpuMemoryToTiles( hard_bytes_left -= tile_bytes; soft_bytes_left = (soft_bytes_left > tile_bytes) ? soft_bytes_left - tile_bytes : 0; - if (tile_version.resource_) { - DCHECK(tile->IsReadyToDraw()); + if (tile_version.resource_) continue; - } } DCHECK(!tile_version.resource_); @@ -943,30 +937,16 @@ void TileManager::AssignGpuMemoryToTiles( if (!can_schedule_tile) { all_tiles_that_need_to_be_rasterized_have_memory_ = false; + if (tile->required_for_activation()) + all_tiles_required_for_activation_have_memory_ = false; it.DisablePriorityOrdering(); continue; } raster_bytes = raster_bytes_if_rastered; tiles_that_need_to_be_rasterized->push_back(tile); - if (tile->required_for_activation()) - ++processed_required_for_activation_tile_count; - } - - int total_required_for_activation_tile_count = 0; - for (std::vector<PictureLayerImpl*>::const_iterator it = layers_.begin(); - it != layers_.end(); - ++it) { - if ((*it)->GetTree() == PENDING_TREE) { - total_required_for_activation_tile_count += - (*it)->UninitializedTilesRequiredForActivationCount(); - } } - all_tiles_required_for_activation_have_memory_ = - processed_required_for_activation_tile_count == - total_required_for_activation_tile_count; - // OOM reporting uses hard-limit, soft-OOM is normal depending on limit. ever_exceeded_memory_budget_ |= oomed_hard; if (ever_exceeded_memory_budget_) { diff --git a/cc/test/fake_tile_manager_client.h b/cc/test/fake_tile_manager_client.h index 5e76e27..dd368b9 100644 --- a/cc/test/fake_tile_manager_client.h +++ b/cc/test/fake_tile_manager_client.h @@ -9,8 +9,6 @@ namespace cc { -class Tile; - class FakeTileManagerClient : public TileManagerClient { public: virtual ~FakeTileManagerClient() {} |