| 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_in_process.h" | 5 #include "cc/trees/layer_tree_host_in_process.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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 } | 414 } |
| 415 | 415 |
| 416 void LayerTreeHostInProcess::RequestMainFrameUpdate() { | 416 void LayerTreeHostInProcess::RequestMainFrameUpdate() { |
| 417 client_->UpdateLayerTreeHost(); | 417 client_->UpdateLayerTreeHost(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 // This function commits the LayerTreeHost to an impl tree. When modifying | 420 // This function commits the LayerTreeHost to an impl tree. When modifying |
| 421 // this function, keep in mind that the function *runs* on the impl thread! Any | 421 // this function, keep in mind that the function *runs* on the impl thread! Any |
| 422 // code that is logically a main thread operation, e.g. deletion of a Layer, | 422 // code that is logically a main thread operation, e.g. deletion of a Layer, |
| 423 // should be delayed until the LayerTreeHostInProcess::CommitComplete, which | 423 // should be delayed until the LayerTreeHostInProcess::CommitComplete, which |
| 424 // will run | 424 // will run after the commit, but on the main thread. |
| 425 // after the commit, but on the main thread. | |
| 426 void LayerTreeHostInProcess::FinishCommitOnImplThread( | 425 void LayerTreeHostInProcess::FinishCommitOnImplThread( |
| 427 LayerTreeHostImpl* host_impl) { | 426 LayerTreeHostImpl* host_impl) { |
| 428 DCHECK(!IsRemoteServer()); | 427 DCHECK(!IsRemoteServer()); |
| 429 DCHECK(task_runner_provider_->IsImplThread()); | 428 DCHECK(task_runner_provider_->IsImplThread()); |
| 430 | 429 |
| 431 bool is_new_trace; | 430 bool is_new_trace; |
| 432 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); | 431 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); |
| 433 if (is_new_trace && | 432 if (is_new_trace && |
| 434 frame_viewer_instrumentation::IsTracingLayerTreeSnapshots() && | 433 frame_viewer_instrumentation::IsTracingLayerTreeSnapshots() && |
| 435 layer_tree_->root_layer()) { | 434 layer_tree_->root_layer()) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 host_impl->SetDebugState(debug_state_); | 470 host_impl->SetDebugState(debug_state_); |
| 472 | 471 |
| 473 sync_tree->set_ui_resource_request_queue( | 472 sync_tree->set_ui_resource_request_queue( |
| 474 ui_resource_manager_->TakeUIResourcesRequests()); | 473 ui_resource_manager_->TakeUIResourcesRequests()); |
| 475 | 474 |
| 476 { | 475 { |
| 477 TRACE_EVENT0("cc", "LayerTreeHostInProcess::PushProperties"); | 476 TRACE_EVENT0("cc", "LayerTreeHostInProcess::PushProperties"); |
| 478 | 477 |
| 479 TreeSynchronizer::PushLayerProperties(layer_tree_.get(), sync_tree); | 478 TreeSynchronizer::PushLayerProperties(layer_tree_.get(), sync_tree); |
| 480 | 479 |
| 480 // This must happen after synchronizing property trees and after pushing |
| 481 // properties, which updates the clobber_active_value flag. |
| 482 sync_tree->UpdatePropertyTreeScrollOffset(layer_tree_->property_trees()); |
| 483 |
| 481 // This must happen after synchronizing property trees and after push | 484 // This must happen after synchronizing property trees and after push |
| 482 // properties, which updates property tree indices, but before animation | 485 // properties, which updates property tree indices, but before animation |
| 483 // host pushes properties as animation host push properties can change | 486 // host pushes properties as animation host push properties can change |
| 484 // Animation::InEffect and we want the old InEffect value for updating | 487 // Animation::InEffect and we want the old InEffect value for updating |
| 485 // property tree scrolling and animation. | 488 // property tree scrolling and animation. |
| 486 sync_tree->UpdatePropertyTreeScrollingAndAnimationFromMainThread(); | 489 sync_tree->UpdatePropertyTreeScrollingAndAnimationFromMainThread(); |
| 487 | 490 |
| 488 TRACE_EVENT0("cc", "LayerTreeHostInProcess::AnimationHost::PushProperties"); | 491 TRACE_EVENT0("cc", "LayerTreeHostInProcess::AnimationHost::PushProperties"); |
| 489 DCHECK(host_impl->animation_host()); | 492 DCHECK(host_impl->animation_host()); |
| 490 layer_tree_->animation_host()->PushPropertiesTo( | 493 layer_tree_->animation_host()->PushPropertiesTo( |
| 491 host_impl->animation_host()); | 494 host_impl->animation_host()); |
| 492 } | 495 } |
| 493 | 496 |
| 494 // This must happen after synchronizing property trees and after pushing | |
| 495 // properties, which updates the clobber_active_value flag. | |
| 496 sync_tree->UpdatePropertyTreeScrollOffset(layer_tree_->property_trees()); | |
| 497 | |
| 498 micro_benchmark_controller_.ScheduleImplBenchmarks(host_impl); | 497 micro_benchmark_controller_.ScheduleImplBenchmarks(host_impl); |
| 499 layer_tree_->property_trees()->ResetAllChangeTracking(); | 498 layer_tree_->property_trees()->ResetAllChangeTracking(); |
| 500 } | 499 } |
| 501 | 500 |
| 502 void LayerTreeHostInProcess::WillCommit() { | 501 void LayerTreeHostInProcess::WillCommit() { |
| 503 swap_promise_manager_.WillCommit(); | 502 swap_promise_manager_.WillCommit(); |
| 504 client_->WillCommit(); | 503 client_->WillCommit(); |
| 505 } | 504 } |
| 506 | 505 |
| 507 void LayerTreeHostInProcess::UpdateHudLayer() {} | 506 void LayerTreeHostInProcess::UpdateHudLayer() {} |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 | 1037 |
| 1039 debug_state_.FromProtobuf(proto.debug_state()); | 1038 debug_state_.FromProtobuf(proto.debug_state()); |
| 1040 has_gpu_rasterization_trigger_ = proto.has_gpu_rasterization_trigger(); | 1039 has_gpu_rasterization_trigger_ = proto.has_gpu_rasterization_trigger(); |
| 1041 content_is_suitable_for_gpu_rasterization_ = | 1040 content_is_suitable_for_gpu_rasterization_ = |
| 1042 proto.content_is_suitable_for_gpu_rasterization(); | 1041 proto.content_is_suitable_for_gpu_rasterization(); |
| 1043 id_ = proto.id(); | 1042 id_ = proto.id(); |
| 1044 next_commit_forces_redraw_ = proto.next_commit_forces_redraw(); | 1043 next_commit_forces_redraw_ = proto.next_commit_forces_redraw(); |
| 1045 } | 1044 } |
| 1046 | 1045 |
| 1047 } // namespace cc | 1046 } // namespace cc |
| OLD | NEW |