diff options
author | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-09 17:28:19 +0000 |
---|---|---|
committer | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-09 17:28:19 +0000 |
commit | 39643fb25a2dc4a62ba16898c5a77d9598a7dbaa (patch) | |
tree | 773c35d2cea9ee51da04f41c5f1a8faa37b9cb80 /cc | |
parent | afebae164ec8e050af2b1952be53b5fecd3400f7 (diff) | |
download | chromium_src-39643fb25a2dc4a62ba16898c5a77d9598a7dbaa.zip chromium_src-39643fb25a2dc4a62ba16898c5a77d9598a7dbaa.tar.gz chromium_src-39643fb25a2dc4a62ba16898c5a77d9598a7dbaa.tar.bz2 |
cc: Make sure we check for completed tile uploads after activating pending tree.
The NotifyReadyToActivate signal produced by the tile manager
indicates that all tiles required for activation will be ready
to draw next time CheckForCompletedTileUploads() is called. The
pending tree can be activated once this signal is received but
we need to ensure that we always check for completed tiles
before we draw.
This makes LTHI::PrepareToDraw perform this check if not already
done by the scheduler.
BUG=257596
Review URL: https://chromiumcodereview.appspot.com/18854013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210592 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 14 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.h | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 50ca880..018bbc3 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -195,7 +195,8 @@ LayerTreeHostImpl::LayerTreeHostImpl( device_scale_factor_(1.f), overdraw_bottom_height_(0.f), animation_registrar_(AnimationRegistrar::Create()), - rendering_stats_instrumentation_(rendering_stats_instrumentation) { + rendering_stats_instrumentation_(rendering_stats_instrumentation), + need_check_for_completed_tile_uploads_before_draw_(false) { DCHECK(proxy_->IsImplThread()); DidVisibilityChange(this, visible_); @@ -945,6 +946,11 @@ bool LayerTreeHostImpl::PrepareToDraw(FrameData* frame, gfx::Rect device_viewport_damage_rect) { TRACE_EVENT0("cc", "LayerTreeHostImpl::PrepareToDraw"); + if (need_check_for_completed_tile_uploads_before_draw_) { + DCHECK(tile_manager_); + tile_manager_->CheckForCompletedTileUploads(); + } + active_tree_->UpdateDrawProperties(); frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList(); @@ -1032,8 +1038,10 @@ void LayerTreeHostImpl::DidInitializeVisibleTile() { } void LayerTreeHostImpl::NotifyReadyToActivate() { - if (pending_tree_) + if (pending_tree_) { + need_check_for_completed_tile_uploads_before_draw_ = true; ActivatePendingTree(); + } } bool LayerTreeHostImpl::ShouldClearRootRenderPass() const { @@ -1364,6 +1372,8 @@ void LayerTreeHostImpl::CheckForCompletedTileUploads() { "spurious redraws."; if (tile_manager_) tile_manager_->CheckForCompletedTileUploads(); + + need_check_for_completed_tile_uploads_before_draw_ = false; } void LayerTreeHostImpl::ActivatePendingTreeIfNeeded() { diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 98f8020..8c41ece 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -533,6 +533,8 @@ class CC_EXPORT LayerTreeHostImpl RenderingStatsInstrumentation* rendering_stats_instrumentation_; + bool need_check_for_completed_tile_uploads_before_draw_; + DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); }; |