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

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

Issue 2712983003: [cc] Set BeginFrame sequence numbers on CompositorFrames from Scheduler. (Closed)
Patch Set: sync Created 3 years, 9 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 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_sequence_number(BeginFrameArgs::kInvalidFrameNumber),
185 latest_confirmed_begin_frame_sequence_number(
186 BeginFrameArgs::kInvalidFrameNumber) {}
183 187
184 LayerTreeHostImpl::FrameData::~FrameData() {} 188 LayerTreeHostImpl::FrameData::~FrameData() {}
185 189
186 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( 190 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create(
187 const LayerTreeSettings& settings, 191 const LayerTreeSettings& settings,
188 LayerTreeHostImplClient* client, 192 LayerTreeHostImplClient* client,
189 TaskRunnerProvider* task_runner_provider, 193 TaskRunnerProvider* task_runner_provider,
190 RenderingStatsInstrumentation* rendering_stats_instrumentation, 194 RenderingStatsInstrumentation* rendering_stats_instrumentation,
191 TaskGraphRunner* task_graph_runner, 195 TaskGraphRunner* task_graph_runner,
192 std::unique_ptr<MutatorHost> mutator_host, 196 std::unique_ptr<MutatorHost> mutator_host,
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 1695
1692 // Collect all resource ids in the render passes into a single array. 1696 // Collect all resource ids in the render passes into a single array.
1693 ResourceProvider::ResourceIdArray resources; 1697 ResourceProvider::ResourceIdArray resources;
1694 for (const auto& render_pass : frame->render_passes) { 1698 for (const auto& render_pass : frame->render_passes) {
1695 for (auto* quad : render_pass->quad_list) { 1699 for (auto* quad : render_pass->quad_list) {
1696 for (ResourceId resource_id : quad->resources) 1700 for (ResourceId resource_id : quad->resources)
1697 resources.push_back(resource_id); 1701 resources.push_back(resource_id);
1698 } 1702 }
1699 } 1703 }
1700 1704
1705 DCHECK_LE(BeginFrameArgs::kStartingFrameNumber,
1706 frame->begin_frame_sequence_number);
1707 metadata.begin_frame_source_id = frame->begin_frame_source_id;
1708 metadata.begin_frame_sequence_number = frame->begin_frame_sequence_number;
1709 metadata.latest_confirmed_begin_frame_sequence_number =
1710 frame->latest_confirmed_begin_frame_sequence_number;
1711
1701 CompositorFrame compositor_frame; 1712 CompositorFrame compositor_frame;
1702 compositor_frame.metadata = std::move(metadata); 1713 compositor_frame.metadata = std::move(metadata);
1703 resource_provider_->PrepareSendToParent(resources, 1714 resource_provider_->PrepareSendToParent(resources,
1704 &compositor_frame.resource_list); 1715 &compositor_frame.resource_list);
1705 compositor_frame.render_pass_list = std::move(frame->render_passes); 1716 compositor_frame.render_pass_list = std::move(frame->render_passes);
1706 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); 1717 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame));
1707 1718
1708 // Clears the list of swap promises after calling DidSwap on each of them to 1719 // Clears the list of swap promises after calling DidSwap on each of them to
1709 // signal that the swap is over. 1720 // signal that the swap is over.
1710 active_tree()->ClearSwapPromises(); 1721 active_tree()->ClearSwapPromises();
(...skipping 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after
4131 worker_context_visibility_ = 4142 worker_context_visibility_ =
4132 worker_context->CacheController()->ClientBecameVisible(); 4143 worker_context->CacheController()->ClientBecameVisible();
4133 } else { 4144 } else {
4134 worker_context->CacheController()->ClientBecameNotVisible( 4145 worker_context->CacheController()->ClientBecameNotVisible(
4135 std::move(worker_context_visibility_)); 4146 std::move(worker_context_visibility_));
4136 } 4147 }
4137 } 4148 }
4138 } 4149 }
4139 4150
4140 } // namespace cc 4151 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698