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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
239 event_listener_properties_(), | 239 event_listener_properties_(), |
240 did_complete_scale_animation_(false), | 240 did_complete_scale_animation_(false), |
241 in_paint_layer_contents_(false), | 241 in_paint_layer_contents_(false), |
242 id_(s_layer_tree_host_sequence_number.GetNext() + 1), | 242 id_(s_layer_tree_host_sequence_number.GetNext() + 1), |
243 next_commit_forces_redraw_(false), | 243 next_commit_forces_redraw_(false), |
244 shared_bitmap_manager_(params->shared_bitmap_manager), | 244 shared_bitmap_manager_(params->shared_bitmap_manager), |
245 gpu_memory_buffer_manager_(params->gpu_memory_buffer_manager), | 245 gpu_memory_buffer_manager_(params->gpu_memory_buffer_manager), |
246 task_graph_runner_(params->task_graph_runner), | 246 task_graph_runner_(params->task_graph_runner), |
247 image_serialization_processor_(params->image_serialization_processor), | 247 image_serialization_processor_(params->image_serialization_processor), |
248 surface_id_namespace_(0u), | 248 surface_id_namespace_(0u), |
249 next_surface_sequence_(1u) { | 249 next_surface_sequence_(1u), |
250 has_fixed_raster_scale_blurry_content_(false), | |
251 has_fixed_raster_scale_potential_performance_regression_(false) { | |
250 DCHECK(task_graph_runner_); | 252 DCHECK(task_graph_runner_); |
251 | 253 |
252 animation_host_ = AnimationHost::Create(ThreadInstance::MAIN); | 254 animation_host_ = AnimationHost::Create(ThreadInstance::MAIN); |
253 animation_host_->SetMutatorHostClient(this); | 255 animation_host_->SetMutatorHostClient(this); |
254 | 256 |
255 rendering_stats_instrumentation_->set_record_rendering_stats( | 257 rendering_stats_instrumentation_->set_record_rendering_stats( |
256 debug_state_.RecordRenderingStats()); | 258 debug_state_.RecordRenderingStats()); |
257 } | 259 } |
258 | 260 |
259 void LayerTreeHost::InitializeThreaded( | 261 void LayerTreeHost::InitializeThreaded( |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
539 // We don't track changes to effect tree on main thread. But, to preserve any | 541 // We don't track changes to effect tree on main thread. But, to preserve any |
540 // change tracking done on active tree's effect tree, we copy it to the main | 542 // change tracking done on active tree's effect tree, we copy it to the main |
541 // thread's effect tree before we push the main thread property trees to | 543 // thread's effect tree before we push the main thread property trees to |
542 // active tree. | 544 // active tree. |
543 if (property_trees_changed_on_active_tree) | 545 if (property_trees_changed_on_active_tree) |
544 property_trees_.ResetAllChangeTracking( | 546 property_trees_.ResetAllChangeTracking( |
545 PropertyTrees::ResetFlags::ALL_TREES); | 547 PropertyTrees::ResetFlags::ALL_TREES); |
546 else | 548 else |
547 property_trees_.ResetAllChangeTracking( | 549 property_trees_.ResetAllChangeTracking( |
548 PropertyTrees::ResetFlags::TRANSFORM_TREE); | 550 PropertyTrees::ResetFlags::TRANSFORM_TREE); |
551 | |
552 has_fixed_raster_scale_blurry_content_ = | |
danakj
2016/05/10 22:05:30
What happened to sending them in begin main frame?
vmpstr
2016/05/13 00:13:34
Leftover code from the previous patch. Removed.
| |
553 host_impl->has_fixed_raster_scale_blurry_content(); | |
554 has_fixed_raster_scale_potential_performance_regression_ = | |
555 host_impl->HasFixedRasterScalePotentialPerformanceRegression(); | |
549 } | 556 } |
550 | 557 |
551 void LayerTreeHost::WillCommit() { | 558 void LayerTreeHost::WillCommit() { |
552 OnCommitForSwapPromises(); | 559 OnCommitForSwapPromises(); |
553 client_->WillCommit(); | 560 client_->WillCommit(); |
554 } | 561 } |
555 | 562 |
556 void LayerTreeHost::UpdateHudLayer() { | 563 void LayerTreeHost::UpdateHudLayer() { |
557 if (debug_state_.ShowHudInfo()) { | 564 if (debug_state_.ShowHudInfo()) { |
558 if (!hud_layer_.get()) { | 565 if (!hud_layer_.get()) { |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
951 PropertyTreeBuilder::PreCalculateMetaInformation(root_layer_.get()); | 958 PropertyTreeBuilder::PreCalculateMetaInformation(root_layer_.get()); |
952 gfx::Transform identity_transform; | 959 gfx::Transform identity_transform; |
953 PropertyTreeBuilder::BuildPropertyTrees( | 960 PropertyTreeBuilder::BuildPropertyTrees( |
954 root_layer_.get(), page_scale_layer_.get(), | 961 root_layer_.get(), page_scale_layer_.get(), |
955 inner_viewport_scroll_layer_.get(), outer_viewport_scroll_layer_.get(), | 962 inner_viewport_scroll_layer_.get(), outer_viewport_scroll_layer_.get(), |
956 overscroll_elasticity_layer_.get(), elastic_overscroll_, | 963 overscroll_elasticity_layer_.get(), elastic_overscroll_, |
957 page_scale_factor_, device_scale_factor_, | 964 page_scale_factor_, device_scale_factor_, |
958 gfx::Rect(device_viewport_size_), identity_transform, &property_trees_); | 965 gfx::Rect(device_viewport_size_), identity_transform, &property_trees_); |
959 } | 966 } |
960 | 967 |
968 void LayerTreeHost::ReportFixedRasterScaleUseCounters( | |
969 bool has_fixed_raster_scale_blurry_content, | |
970 bool has_fixed_raster_scale_potential_performance_regression) { | |
971 client_->ReportFixedRasterScaleUseCounters( | |
972 has_fixed_raster_scale_blurry_content_, | |
danakj
2016/05/10 22:05:30
whats going on here? receive vars as args, but use
vmpstr
2016/05/13 00:13:34
Fixed.
| |
973 has_fixed_raster_scale_potential_performance_regression_); | |
974 } | |
975 | |
961 bool LayerTreeHost::UsingSharedMemoryResources() { | 976 bool LayerTreeHost::UsingSharedMemoryResources() { |
962 return GetRendererCapabilities().using_shared_memory_resources; | 977 return GetRendererCapabilities().using_shared_memory_resources; |
963 } | 978 } |
964 | 979 |
965 bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) { | 980 bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) { |
966 TRACE_EVENT1("cc", "LayerTreeHost::DoUpdateLayers", "source_frame_number", | 981 TRACE_EVENT1("cc", "LayerTreeHost::DoUpdateLayers", "source_frame_number", |
967 source_frame_number()); | 982 source_frame_number()); |
968 | 983 |
969 UpdateHudLayer(); | 984 UpdateHudLayer(); |
970 | 985 |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1637 int seq_num = property_trees_.sequence_number; | 1652 int seq_num = property_trees_.sequence_number; |
1638 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { | 1653 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { |
1639 layer->set_property_tree_sequence_number(seq_num); | 1654 layer->set_property_tree_sequence_number(seq_num); |
1640 }); | 1655 }); |
1641 | 1656 |
1642 surface_id_namespace_ = proto.surface_id_namespace(); | 1657 surface_id_namespace_ = proto.surface_id_namespace(); |
1643 next_surface_sequence_ = proto.next_surface_sequence(); | 1658 next_surface_sequence_ = proto.next_surface_sequence(); |
1644 } | 1659 } |
1645 | 1660 |
1646 } // namespace cc | 1661 } // namespace cc |
OLD | NEW |