Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6477)

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 16871016: cc: Use BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@bfargs2
Patch Set: Fixed all existing tests! New tests pending... Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index f88cf8a0e54614dc94f855504c396c8ea9bc46ee..9c74244a10133094dc2ea893b7a056d123e39c56 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -106,7 +106,6 @@ class LayerTreeHostImplTimeSourceAdapter : public TimeSourceClient {
new DebugScopedSetImplThread(layer_tree_host_impl_->proxy()));
}
- // TODO(enne): This should probably happen post-animate.
if (layer_tree_host_impl_->pending_tree()) {
layer_tree_host_impl_->ActivatePendingTreeIfNeeded();
@@ -169,6 +168,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
RenderingStatsInstrumentation* rendering_stats_instrumentation)
: client_(client),
proxy_(proxy),
+ output_surface_lost_(true),
input_handler_client_(NULL),
did_lock_scrolling_layer_(false),
should_bubble_scrolls_(false),
@@ -1271,7 +1271,7 @@ const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const {
}
bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
- if (frame.has_no_damage)
+ if (frame.has_no_damage || output_surface_lost_)
return false;
renderer_->SwapBuffers();
active_tree_->ClearLatencyInfo();
@@ -1305,6 +1305,7 @@ void LayerTreeHostImpl::DidLoseOutputSurface() {
// TODO(jamesr): The renderer_ check is needed to make some of the
// LayerTreeHostContextTest tests pass, but shouldn't be necessary (or
// important) in production. We should adjust the test to not need this.
+ output_surface_lost_ = true;
if (renderer_)
client_->DidLoseOutputSurfaceOnImplThread();
}
@@ -1422,6 +1423,8 @@ void LayerTreeHostImpl::ActivatePendingTree() {
root_layer_scroll_offset_delegate_);
active_tree_->DidBecomeActive();
+ client_->DidActivatePendingTree();
+
// Reduce wasted memory now that unlinked resources are guaranteed not
// to be used.
client_->ReduceWastedContentsTextureMemoryOnImplThread();
@@ -1438,8 +1441,6 @@ void LayerTreeHostImpl::ActivatePendingTree() {
stats.total_paint_time + stats.total_record_time +
stats.total_rasterize_time_for_now_bins_on_pending_tree);
}
-
- client_->DidActivatePendingTree();
}
void LayerTreeHostImpl::SetVisible(bool visible) {
@@ -1547,6 +1548,7 @@ bool LayerTreeHostImpl::InitializeRenderer(
tile_manager_.reset();
resource_provider_.reset();
output_surface_.reset();
+ output_surface_lost_ = true;
if (!output_surface->BindToClient(this))
return false;
@@ -1592,6 +1594,7 @@ bool LayerTreeHostImpl::InitializeRenderer(
resource_provider_ = resource_provider.Pass();
output_surface_ = output_surface.Pass();
+ output_surface_lost_ = false;
client_->OnCanDrawStateChanged(CanDraw());

Powered by Google App Engine
This is Rietveld 408576698