| 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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 content_is_suitable_for_gpu_rasterization_); | 750 content_is_suitable_for_gpu_rasterization_); |
| 751 // Record how many pages actually get gpu rasterization when enabled. | 751 // Record how many pages actually get gpu rasterization when enabled. |
| 752 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationUsed", | 752 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationUsed", |
| 753 (has_gpu_rasterization_trigger_ && | 753 (has_gpu_rasterization_trigger_ && |
| 754 content_is_suitable_for_gpu_rasterization_)); | 754 content_is_suitable_for_gpu_rasterization_)); |
| 755 } | 755 } |
| 756 | 756 |
| 757 gpu_rasterization_histogram_recorded_ = true; | 757 gpu_rasterization_histogram_recorded_ = true; |
| 758 } | 758 } |
| 759 | 759 |
| 760 void LayerTreeHost::BuildPropertyTreesForTesting() { | |
| 761 PropertyTreeBuilder::PreCalculateMetaInformation(layer_tree_->root_layer()); | |
| 762 gfx::Transform identity_transform; | |
| 763 PropertyTreeBuilder::BuildPropertyTrees( | |
| 764 layer_tree_->root_layer(), layer_tree_->page_scale_layer(), | |
| 765 layer_tree_->inner_viewport_scroll_layer(), | |
| 766 layer_tree_->outer_viewport_scroll_layer(), | |
| 767 layer_tree_->overscroll_elasticity_layer(), | |
| 768 layer_tree_->elastic_overscroll(), layer_tree_->page_scale_factor(), | |
| 769 layer_tree_->device_scale_factor(), | |
| 770 gfx::Rect(layer_tree_->device_viewport_size()), identity_transform, | |
| 771 layer_tree_->property_trees()); | |
| 772 } | |
| 773 | |
| 774 bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) { | 760 bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) { |
| 775 TRACE_EVENT1("cc", "LayerTreeHost::DoUpdateLayers", "source_frame_number", | 761 TRACE_EVENT1("cc", "LayerTreeHost::DoUpdateLayers", "source_frame_number", |
| 776 SourceFrameNumber()); | 762 SourceFrameNumber()); |
| 777 | 763 |
| 778 layer_tree_->UpdateHudLayer(debug_state_.ShowHudInfo()); | 764 layer_tree_->UpdateHudLayer(debug_state_.ShowHudInfo()); |
| 779 UpdateHudLayer(); | 765 UpdateHudLayer(); |
| 780 | 766 |
| 781 Layer* root_scroll = | 767 Layer* root_scroll = |
| 782 PropertyTreeBuilder::FindFirstScrollableLayer(root_layer); | 768 PropertyTreeBuilder::FindFirstScrollableLayer(root_layer); |
| 783 Layer* page_scale_layer = layer_tree_->page_scale_layer(); | 769 Layer* page_scale_layer = layer_tree_->page_scale_layer(); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 | 1033 |
| 1048 debug_state_.FromProtobuf(proto.debug_state()); | 1034 debug_state_.FromProtobuf(proto.debug_state()); |
| 1049 has_gpu_rasterization_trigger_ = proto.has_gpu_rasterization_trigger(); | 1035 has_gpu_rasterization_trigger_ = proto.has_gpu_rasterization_trigger(); |
| 1050 content_is_suitable_for_gpu_rasterization_ = | 1036 content_is_suitable_for_gpu_rasterization_ = |
| 1051 proto.content_is_suitable_for_gpu_rasterization(); | 1037 proto.content_is_suitable_for_gpu_rasterization(); |
| 1052 id_ = proto.id(); | 1038 id_ = proto.id(); |
| 1053 next_commit_forces_redraw_ = proto.next_commit_forces_redraw(); | 1039 next_commit_forces_redraw_ = proto.next_commit_forces_redraw(); |
| 1054 } | 1040 } |
| 1055 | 1041 |
| 1056 } // namespace cc | 1042 } // namespace cc |
| OLD | NEW |