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 a500663336cfee853bb751abce136f043f9cf430..bfa05e39fa1d0f480db280aa7fe9a21f413508bc 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -990,6 +990,9 @@ void LayerTreeHostImpl::OnSendFrameToParentCompositorAck( |
// TODO(piman): We may need to do some validation on this ack before |
// processing it. |
renderer_->ReceiveCompositorFrameAck(ack); |
+ |
+ // When using compositor frame data, the ack doubles as a swap complete ack. |
+ OnSwapBuffersComplete(); |
} |
void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { |
@@ -1149,7 +1152,11 @@ const LayerTreeSettings& LayerTreeHostImpl::Settings() const { |
} |
void LayerTreeHostImpl::DidLoseOutputSurface() { |
- client_->DidLoseOutputSurfaceOnImplThread(); |
+ // 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. |
+ if (renderer_) |
+ client_->DidLoseOutputSurfaceOnImplThread(); |
} |
void LayerTreeHostImpl::OnSwapBuffersComplete() { |