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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 14092003: Add compositor support for the LatencyInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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_impl.h » ('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 bfa05e39fa1d0f480db280aa7fe9a21f413508bc..faa76125d249fd3b8bc513c8b123dc87c0b0fd0c 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -875,6 +875,8 @@ 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;
@@ -1019,6 +1021,7 @@ CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const {
return metadata;
metadata.root_scroll_offset = RootScrollLayer()->TotalScrollOffset();
+ metadata.latency_info = active_tree_->GetLatencyInfo();
return metadata;
}
@@ -1118,7 +1121,10 @@ const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const {
bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
if (frame.has_no_damage)
return false;
- return renderer_->SwapBuffers();
+ bool result = renderer_->SwapBuffers(frame.latency_info);
+ if (result)
+ active_tree_->ClearLatencyInfo();
+ return result;
}
void LayerTreeHostImpl::EnableVSyncNotification(bool enable) {
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698