| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 // after the commit, but on the main thread. | 351 // after the commit, but on the main thread. |
| 352 void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { | 352 void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { |
| 353 DCHECK(!IsRemoteServer()); | 353 DCHECK(!IsRemoteServer()); |
| 354 DCHECK(task_runner_provider_->IsImplThread()); | 354 DCHECK(task_runner_provider_->IsImplThread()); |
| 355 | 355 |
| 356 bool is_new_trace; | 356 bool is_new_trace; |
| 357 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); | 357 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); |
| 358 if (is_new_trace && | 358 if (is_new_trace && |
| 359 frame_viewer_instrumentation::IsTracingLayerTreeSnapshots() && | 359 frame_viewer_instrumentation::IsTracingLayerTreeSnapshots() && |
| 360 root_layer()) { | 360 root_layer()) { |
| 361 LayerTreeHostCommon::CallFunctionForSubtree( | 361 LayerTreeHostCommon::CallFunctionForEveryLayer( |
| 362 root_layer(), [](Layer* layer) { layer->DidBeginTracing(); }); | 362 root_layer(), [](Layer* layer) { layer->DidBeginTracing(); }); |
| 363 } | 363 } |
| 364 | 364 |
| 365 LayerTreeImpl* sync_tree = host_impl->sync_tree(); | 365 LayerTreeImpl* sync_tree = host_impl->sync_tree(); |
| 366 | 366 |
| 367 if (next_commit_forces_redraw_) { | 367 if (next_commit_forces_redraw_) { |
| 368 sync_tree->ForceRedrawNextActivation(); | 368 sync_tree->ForceRedrawNextActivation(); |
| 369 next_commit_forces_redraw_ = false; | 369 next_commit_forces_redraw_ = false; |
| 370 } | 370 } |
| 371 | 371 |
| (...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1560 // It is required to create new PropertyTrees before deserializing it. | 1560 // It is required to create new PropertyTrees before deserializing it. |
| 1561 property_trees_ = PropertyTrees(); | 1561 property_trees_ = PropertyTrees(); |
| 1562 property_trees_.FromProtobuf(proto.property_trees()); | 1562 property_trees_.FromProtobuf(proto.property_trees()); |
| 1563 | 1563 |
| 1564 // Forcefully override the sequence number of all layers in the tree to have | 1564 // Forcefully override the sequence number of all layers in the tree to have |
| 1565 // a valid sequence number. Changing the sequence number for a layer does not | 1565 // a valid sequence number. Changing the sequence number for a layer does not |
| 1566 // need a commit, so the value will become out of date for layers that are not | 1566 // need a commit, so the value will become out of date for layers that are not |
| 1567 // updated for other reasons. All layers that at this point are part of the | 1567 // updated for other reasons. All layers that at this point are part of the |
| 1568 // layer tree are valid, so it is OK that they have a valid sequence number. | 1568 // layer tree are valid, so it is OK that they have a valid sequence number. |
| 1569 int seq_num = property_trees_.sequence_number; | 1569 int seq_num = property_trees_.sequence_number; |
| 1570 LayerTreeHostCommon::CallFunctionForSubtree( | 1570 LayerTreeHostCommon::CallFunctionForEveryLayer( |
| 1571 root_layer(), [seq_num](Layer* layer) { | 1571 root_layer(), [seq_num](Layer* layer) { |
| 1572 layer->set_property_tree_sequence_number(seq_num); | 1572 layer->set_property_tree_sequence_number(seq_num); |
| 1573 }); | 1573 }); |
| 1574 | 1574 |
| 1575 surface_id_namespace_ = proto.surface_id_namespace(); | 1575 surface_id_namespace_ = proto.surface_id_namespace(); |
| 1576 next_surface_sequence_ = proto.next_surface_sequence(); | 1576 next_surface_sequence_ = proto.next_surface_sequence(); |
| 1577 } | 1577 } |
| 1578 | 1578 |
| 1579 } // namespace cc | 1579 } // namespace cc |
| OLD | NEW |