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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { | 405 void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { |
406 DCHECK(!IsRemoteServer()); | 406 DCHECK(!IsRemoteServer()); |
407 DCHECK(task_runner_provider_->IsImplThread()); | 407 DCHECK(task_runner_provider_->IsImplThread()); |
408 | 408 |
409 bool is_new_trace; | 409 bool is_new_trace; |
410 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); | 410 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); |
411 if (is_new_trace && | 411 if (is_new_trace && |
412 frame_viewer_instrumentation::IsTracingLayerTreeSnapshots() && | 412 frame_viewer_instrumentation::IsTracingLayerTreeSnapshots() && |
413 root_layer()) { | 413 root_layer()) { |
414 LayerTreeHostCommon::CallFunctionForEveryLayer( | 414 LayerTreeHostCommon::CallFunctionForEveryLayer( |
415 this, [](Layer* layer) { layer->DidBeginTracing(); }, | 415 this, [](Layer* layer) { layer->DidBeginTracing(); }); |
416 CallFunctionLayerType::ALL_LAYERS); | |
417 } | 416 } |
418 | 417 |
419 LayerTreeImpl* sync_tree = host_impl->sync_tree(); | 418 LayerTreeImpl* sync_tree = host_impl->sync_tree(); |
420 | 419 |
421 if (next_commit_forces_redraw_) { | 420 if (next_commit_forces_redraw_) { |
422 sync_tree->ForceRedrawNextActivation(); | 421 sync_tree->ForceRedrawNextActivation(); |
423 next_commit_forces_redraw_ = false; | 422 next_commit_forces_redraw_ = false; |
424 } | 423 } |
425 | 424 |
426 sync_tree->set_source_frame_number(source_frame_number()); | 425 sync_tree->set_source_frame_number(source_frame_number()); |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 // It is required to create new PropertyTrees before deserializing it. | 1642 // It is required to create new PropertyTrees before deserializing it. |
1644 property_trees_ = PropertyTrees(); | 1643 property_trees_ = PropertyTrees(); |
1645 property_trees_.FromProtobuf(proto.property_trees()); | 1644 property_trees_.FromProtobuf(proto.property_trees()); |
1646 | 1645 |
1647 // Forcefully override the sequence number of all layers in the tree to have | 1646 // Forcefully override the sequence number of all layers in the tree to have |
1648 // a valid sequence number. Changing the sequence number for a layer does not | 1647 // a valid sequence number. Changing the sequence number for a layer does not |
1649 // need a commit, so the value will become out of date for layers that are not | 1648 // need a commit, so the value will become out of date for layers that are not |
1650 // updated for other reasons. All layers that at this point are part of the | 1649 // updated for other reasons. All layers that at this point are part of the |
1651 // layer tree are valid, so it is OK that they have a valid sequence number. | 1650 // layer tree are valid, so it is OK that they have a valid sequence number. |
1652 int seq_num = property_trees_.sequence_number; | 1651 int seq_num = property_trees_.sequence_number; |
1653 LayerTreeHostCommon::CallFunctionForEveryLayer( | 1652 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { |
1654 this, | 1653 layer->set_property_tree_sequence_number(seq_num); |
1655 [seq_num](Layer* layer) { | 1654 }); |
1656 layer->set_property_tree_sequence_number(seq_num); | |
1657 }, | |
1658 CallFunctionLayerType::ALL_LAYERS); | |
1659 | 1655 |
1660 surface_id_namespace_ = proto.surface_id_namespace(); | 1656 surface_id_namespace_ = proto.surface_id_namespace(); |
1661 next_surface_sequence_ = proto.next_surface_sequence(); | 1657 next_surface_sequence_ = proto.next_surface_sequence(); |
1662 } | 1658 } |
1663 | 1659 |
1664 } // namespace cc | 1660 } // namespace cc |
OLD | NEW |