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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 16304003: Unified OutputSurface::SwapBuffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to 205473 Created 7 years, 6 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 492df4dedb62f032c7d6769bb968c789ff44274c..ec59daebabffa8e7d12aef3499182558636e0290 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -933,8 +933,6 @@ bool LayerTreeHostImpl::PrepareToDraw(FrameData* frame,
if (!CalculateRenderPasses(frame))
return false;
- frame->latency_info = active_tree_->GetLatencyInfo();
-
// If we return true, then we expect DrawLayers() to be called before this
// function is called again.
return true;
@@ -1068,17 +1066,14 @@ void LayerTreeHostImpl::BeginFrame(base::TimeTicks frame_time) {
client_->BeginFrameOnImplThread(frame_time);
}
-void LayerTreeHostImpl::OnSendFrameToParentCompositorAck(
- const CompositorFrameAck& ack) {
- if (!renderer_)
- return;
-
+void LayerTreeHostImpl::OnSwapBuffersComplete(
+ const CompositorFrameAck* ack) {
// TODO(piman): We may need to do some validation on this ack before
// processing it.
- renderer_->ReceiveCompositorFrameAck(ack);
+ if (ack && renderer_)
+ renderer_->ReceiveSwapBuffersAck(*ack);
- // When using compositor frame data, the ack doubles as a swap complete ack.
- OnSwapBuffersComplete();
+ client_->OnSwapBuffersCompleteOnImplThread();
}
void LayerTreeHostImpl::OnCanDrawStateChangedForTree() {
@@ -1230,7 +1225,7 @@ const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const {
bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
if (frame.has_no_damage)
return false;
- renderer_->SwapBuffers(frame.latency_info);
+ renderer_->SwapBuffers();
active_tree_->ClearLatencyInfo();
return true;
}
@@ -1273,10 +1268,6 @@ void LayerTreeHostImpl::DidLoseOutputSurface() {
client_->DidLoseOutputSurfaceOnImplThread();
}
-void LayerTreeHostImpl::OnSwapBuffersComplete() {
- client_->OnSwapBuffersCompleteOnImplThread();
-}
-
void LayerTreeHostImpl::Readback(void* pixels,
gfx::Rect rect_in_device_viewport) {
DCHECK(renderer_);
@@ -1483,7 +1474,7 @@ bool LayerTreeHostImpl::DoInitializeRenderer(
if (!resource_provider)
return false;
- if (output_surface->capabilities().has_parent_compositor) {
+ if (output_surface->capabilities().delegated_rendering) {
renderer_ = DelegatingRenderer::Create(this, output_surface.get(),
resource_provider.get());
} else if (output_surface->context3d()) {
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698