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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2527283003: cc: Introduce BeginFrame sequence numbers and acknowledgements.
Patch Set: Address Sami's comments, DisplayScheduler observes while BFSObservers exist. Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 173
174 } // namespace 174 } // namespace
175 175
176 DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer, 176 DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer,
177 "Scheduling.%s.PendingTreeDuration"); 177 "Scheduling.%s.PendingTreeDuration");
178 178
179 LayerTreeHostImpl::FrameData::FrameData() 179 LayerTreeHostImpl::FrameData::FrameData()
180 : render_surface_layer_list(nullptr), 180 : render_surface_layer_list(nullptr),
181 has_no_damage(false), 181 has_no_damage(false),
182 may_contain_video(false) {} 182 may_contain_video(false),
183 begin_frame_source_id(0),
184 begin_frame_number(0),
185 oldest_incorporated_frame(0) {}
183 186
184 LayerTreeHostImpl::FrameData::~FrameData() {} 187 LayerTreeHostImpl::FrameData::~FrameData() {}
185 188
186 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( 189 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create(
187 const LayerTreeSettings& settings, 190 const LayerTreeSettings& settings,
188 LayerTreeHostImplClient* client, 191 LayerTreeHostImplClient* client,
189 TaskRunnerProvider* task_runner_provider, 192 TaskRunnerProvider* task_runner_provider,
190 RenderingStatsInstrumentation* rendering_stats_instrumentation, 193 RenderingStatsInstrumentation* rendering_stats_instrumentation,
191 TaskGraphRunner* task_graph_runner, 194 TaskGraphRunner* task_graph_runner,
192 std::unique_ptr<MutatorHost> mutator_host, 195 std::unique_ptr<MutatorHost> mutator_host,
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 1654
1652 // Collect all resource ids in the render passes into a single array. 1655 // Collect all resource ids in the render passes into a single array.
1653 ResourceProvider::ResourceIdArray resources; 1656 ResourceProvider::ResourceIdArray resources;
1654 for (const auto& render_pass : frame->render_passes) { 1657 for (const auto& render_pass : frame->render_passes) {
1655 for (auto* quad : render_pass->quad_list) { 1658 for (auto* quad : render_pass->quad_list) {
1656 for (ResourceId resource_id : quad->resources) 1659 for (ResourceId resource_id : quad->resources)
1657 resources.push_back(resource_id); 1660 resources.push_back(resource_id);
1658 } 1661 }
1659 } 1662 }
1660 1663
1664 metadata.begin_frame_source_id = frame->begin_frame_source_id;
1665 metadata.begin_frame_number = frame->begin_frame_number;
1666 metadata.oldest_incorporated_frame = frame->oldest_incorporated_frame;
1661 1667
1662 CompositorFrame compositor_frame; 1668 CompositorFrame compositor_frame;
1663 compositor_frame.metadata = std::move(metadata); 1669 compositor_frame.metadata = std::move(metadata);
1664 resource_provider_->PrepareSendToParent(resources, 1670 resource_provider_->PrepareSendToParent(resources,
1665 &compositor_frame.resource_list); 1671 &compositor_frame.resource_list);
1666 compositor_frame.render_pass_list = std::move(frame->render_passes); 1672 compositor_frame.render_pass_list = std::move(frame->render_passes);
1667 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); 1673 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame));
1668 1674
1669 // The next frame should start by assuming nothing has changed, and changes 1675 // The next frame should start by assuming nothing has changed, and changes
1670 // are noted as they occur. 1676 // are noted as they occur.
(...skipping 2412 matching lines...) Expand 10 before | Expand all | Expand 10 after
4083 worker_context_visibility_ = 4089 worker_context_visibility_ =
4084 worker_context->CacheController()->ClientBecameVisible(); 4090 worker_context->CacheController()->ClientBecameVisible();
4085 } else { 4091 } else {
4086 worker_context->CacheController()->ClientBecameNotVisible( 4092 worker_context->CacheController()->ClientBecameNotVisible(
4087 std::move(worker_context_visibility_)); 4093 std::move(worker_context_visibility_));
4088 } 4094 }
4089 } 4095 }
4090 } 4096 }
4091 4097
4092 } // namespace cc 4098 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698