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

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

Issue 924973003: CC: Force push properties for all layers when tracing is started (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce Layer::DidBeginTracing(), call SetNeedsPushProperties() from there Created 5 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
« cc/layers/layer.cc ('K') | « cc/layers/layer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 #include <string> 9 #include <string>
10 10
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 208 }
209 209
210 void LayerTreeHost::SetLayerTreeHostClientReady() { 210 void LayerTreeHost::SetLayerTreeHostClientReady() {
211 proxy_->SetLayerTreeHostClientReady(); 211 proxy_->SetLayerTreeHostClientReady();
212 } 212 }
213 213
214 static void LayerTreeHostOnOutputSurfaceCreatedCallback(Layer* layer) { 214 static void LayerTreeHostOnOutputSurfaceCreatedCallback(Layer* layer) {
215 layer->OnOutputSurfaceCreated(); 215 layer->OnOutputSurfaceCreated();
216 } 216 }
217 217
218 static void LayerTreeHostDidBeginTracingCallback(Layer* layer) {
219 layer->DidBeginTracing();
220 }
221
218 void LayerTreeHost::DeleteContentsTexturesOnImplThread( 222 void LayerTreeHost::DeleteContentsTexturesOnImplThread(
219 ResourceProvider* resource_provider) { 223 ResourceProvider* resource_provider) {
220 DCHECK(proxy_->IsImplThread()); 224 DCHECK(proxy_->IsImplThread());
221 if (contents_texture_manager_) 225 if (contents_texture_manager_)
222 contents_texture_manager_->ClearAllMemory(resource_provider); 226 contents_texture_manager_->ClearAllMemory(resource_provider);
223 } 227 }
224 228
225 void LayerTreeHost::WillBeginMainFrame() { 229 void LayerTreeHost::WillBeginMainFrame() {
226 devtools_instrumentation::WillBeginMainThreadFrame(id(), 230 devtools_instrumentation::WillBeginMainThreadFrame(id(),
227 source_frame_number()); 231 source_frame_number());
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 295
292 LayerTreeImpl* sync_tree = host_impl->sync_tree(); 296 LayerTreeImpl* sync_tree = host_impl->sync_tree();
293 297
294 if (next_commit_forces_redraw_) { 298 if (next_commit_forces_redraw_) {
295 sync_tree->ForceRedrawNextActivation(); 299 sync_tree->ForceRedrawNextActivation();
296 next_commit_forces_redraw_ = false; 300 next_commit_forces_redraw_ = false;
297 } 301 }
298 302
299 sync_tree->set_source_frame_number(source_frame_number()); 303 sync_tree->set_source_frame_number(source_frame_number());
300 304
305 bool is_new_trace;
306 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace);
307 if (is_new_trace) {
308 // We're about to start tracing snaphsots of layer tree, so force
309 // push properties for all layers to propagate LayerDebugInfo to
danakj 2015/03/06 18:50:12 I see, LayerDebugInfo is a type, up in ui/composit
310 // the impl side.
311 bool will_snapshot_layer_tree;
312 TRACE_EVENT_CATEGORY_GROUP_ENABLED(
313 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT(
danakj 2015/03/06 18:50:12 I don't like that these magic categories appear he
314 "devtools.timeline.layers"),
315 &will_snapshot_layer_tree);
316 if (will_snapshot_layer_tree) {
317 LayerTreeHostCommon::CallFunctionForSubtree(
318 root_layer(), base::Bind(LayerTreeHostDidBeginTracingCallback));
danakj 2015/03/06 18:50:12 This will need a rebase.
319 }
320 }
321
301 if (needs_full_tree_sync_) { 322 if (needs_full_tree_sync_) {
302 sync_tree->SetRootLayer(TreeSynchronizer::SynchronizeTrees( 323 sync_tree->SetRootLayer(TreeSynchronizer::SynchronizeTrees(
303 root_layer(), sync_tree->DetachLayerTree(), sync_tree)); 324 root_layer(), sync_tree->DetachLayerTree(), sync_tree));
304 } 325 }
305 sync_tree->set_needs_full_tree_sync(needs_full_tree_sync_); 326 sync_tree->set_needs_full_tree_sync(needs_full_tree_sync_);
306 needs_full_tree_sync_ = false; 327 needs_full_tree_sync_ = false;
307 328
308 if (hud_layer_.get()) { 329 if (hud_layer_.get()) {
309 LayerImpl* hud_impl = LayerTreeHostCommon::FindLayerInSubtree( 330 LayerImpl* hud_impl = LayerTreeHostCommon::FindLayerInSubtree(
310 sync_tree->root_layer(), hud_layer_->id()); 331 sync_tree->root_layer(), hud_layer_->id());
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 bool children_need_begin_frames) const { 1348 bool children_need_begin_frames) const {
1328 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); 1349 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames);
1329 } 1350 }
1330 1351
1331 void LayerTreeHost::SendBeginFramesToChildren( 1352 void LayerTreeHost::SendBeginFramesToChildren(
1332 const BeginFrameArgs& args) const { 1353 const BeginFrameArgs& args) const {
1333 client_->SendBeginFramesToChildren(args); 1354 client_->SendBeginFramesToChildren(args);
1334 } 1355 }
1335 1356
1336 } // namespace cc 1357 } // namespace cc
OLDNEW
« cc/layers/layer.cc ('K') | « cc/layers/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698