OLD | NEW |
---|---|
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 Loading... | |
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 SetNeedsPushPropertiesForLayer(Layer* layer) { | |
219 layer->SetNeedsPushProperties(); | |
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 Loading... | |
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/02/20 17:13:18
AFAICT LayerDebugInfo is not an actual type name,
| |
310 // the impl side. | |
danakj
2015/02/20 17:13:18
Can you help fill me in on how this DebugInfo work
| |
311 bool will_snapshot_layer_tree; | |
312 TRACE_EVENT_CATEGORY_GROUP_ENABLED( | |
313 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT( | |
314 "devtools.timeline.layers"), | |
danakj
2015/02/20 17:13:18
If it's reasonable, I would much prefer we expose
| |
315 &will_snapshot_layer_tree); | |
316 if (will_snapshot_layer_tree) { | |
317 LayerTreeHostCommon::CallFunctionForSubtree( | |
318 root_layer(), base::Bind(SetNeedsPushPropertiesForLayer)); | |
danakj
2015/02/20 17:13:18
I think that walking all the layers to make us wal
| |
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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1338 bool children_need_begin_frames) const { | 1359 bool children_need_begin_frames) const { |
1339 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); | 1360 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); |
1340 } | 1361 } |
1341 | 1362 |
1342 void LayerTreeHost::SendBeginFramesToChildren( | 1363 void LayerTreeHost::SendBeginFramesToChildren( |
1343 const BeginFrameArgs& args) const { | 1364 const BeginFrameArgs& args) const { |
1344 client_->SendBeginFramesToChildren(args); | 1365 client_->SendBeginFramesToChildren(args); |
1345 } | 1366 } |
1346 | 1367 |
1347 } // namespace cc | 1368 } // namespace cc |
OLD | NEW |