Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2610)

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 1688563002: cc :: Move some tracking of layer_property_changed to main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "cc/layers/painted_scrollbar_layer.h" 43 #include "cc/layers/painted_scrollbar_layer.h"
44 #include "cc/proto/gfx_conversions.h" 44 #include "cc/proto/gfx_conversions.h"
45 #include "cc/proto/layer_tree_host.pb.h" 45 #include "cc/proto/layer_tree_host.pb.h"
46 #include "cc/resources/ui_resource_request.h" 46 #include "cc/resources/ui_resource_request.h"
47 #include "cc/scheduler/begin_frame_source.h" 47 #include "cc/scheduler/begin_frame_source.h"
48 #include "cc/trees/draw_property_utils.h" 48 #include "cc/trees/draw_property_utils.h"
49 #include "cc/trees/layer_tree_host_client.h" 49 #include "cc/trees/layer_tree_host_client.h"
50 #include "cc/trees/layer_tree_host_common.h" 50 #include "cc/trees/layer_tree_host_common.h"
51 #include "cc/trees/layer_tree_host_impl.h" 51 #include "cc/trees/layer_tree_host_impl.h"
52 #include "cc/trees/layer_tree_impl.h" 52 #include "cc/trees/layer_tree_impl.h"
53 #include "cc/trees/property_tree_builder.h"
53 #include "cc/trees/proxy_main.h" 54 #include "cc/trees/proxy_main.h"
54 #include "cc/trees/remote_channel_impl.h" 55 #include "cc/trees/remote_channel_impl.h"
55 #include "cc/trees/single_thread_proxy.h" 56 #include "cc/trees/single_thread_proxy.h"
56 #include "cc/trees/tree_synchronizer.h" 57 #include "cc/trees/tree_synchronizer.h"
57 #include "ui/gfx/geometry/size_conversions.h" 58 #include "ui/gfx/geometry/size_conversions.h"
58 #include "ui/gfx/geometry/vector2d_conversions.h" 59 #include "ui/gfx/geometry/vector2d_conversions.h"
59 60
60 namespace { 61 namespace {
61 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number; 62 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number;
62 } 63 }
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 content_is_suitable_for_gpu_rasterization_); 881 content_is_suitable_for_gpu_rasterization_);
881 // Record how many pages actually get gpu rasterization when enabled. 882 // Record how many pages actually get gpu rasterization when enabled.
882 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationUsed", 883 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationUsed",
883 (has_gpu_rasterization_trigger_ && 884 (has_gpu_rasterization_trigger_ &&
884 content_is_suitable_for_gpu_rasterization_)); 885 content_is_suitable_for_gpu_rasterization_));
885 } 886 }
886 887
887 gpu_rasterization_histogram_recorded_ = true; 888 gpu_rasterization_histogram_recorded_ = true;
888 } 889 }
889 890
891 void LayerTreeHost::BuildPropertyTreesForTesting() {
892 LayerTreeHostCommon::PreCalculateMetaInformationForTesting(root_layer_.get());
893 gfx::Transform identity_transform;
894 PropertyTreeBuilder::BuildPropertyTrees(
895 root_layer_.get(), page_scale_layer_.get(),
896 inner_viewport_scroll_layer_.get(), outer_viewport_scroll_layer_.get(),
897 overscroll_elasticity_layer_.get(), elastic_overscroll_,
898 page_scale_factor_, device_scale_factor_,
899 gfx::Rect(device_viewport_size_), identity_transform, &property_trees_);
900 }
901
890 bool LayerTreeHost::UsingSharedMemoryResources() { 902 bool LayerTreeHost::UsingSharedMemoryResources() {
891 return GetRendererCapabilities().using_shared_memory_resources; 903 return GetRendererCapabilities().using_shared_memory_resources;
892 } 904 }
893 905
894 bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) { 906 bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
895 TRACE_EVENT1("cc", "LayerTreeHost::DoUpdateLayers", "source_frame_number", 907 TRACE_EVENT1("cc", "LayerTreeHost::DoUpdateLayers", "source_frame_number",
896 source_frame_number()); 908 source_frame_number());
897 909
898 UpdateHudLayer(); 910 UpdateHudLayer();
899 911
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 LayerTreeHostCommon::CallFunctionForSubtree( 1588 LayerTreeHostCommon::CallFunctionForSubtree(
1577 root_layer(), [seq_num](Layer* layer) { 1589 root_layer(), [seq_num](Layer* layer) {
1578 layer->set_property_tree_sequence_number(seq_num); 1590 layer->set_property_tree_sequence_number(seq_num);
1579 }); 1591 });
1580 1592
1581 surface_id_namespace_ = proto.surface_id_namespace(); 1593 surface_id_namespace_ = proto.surface_id_namespace();
1582 next_surface_sequence_ = proto.next_surface_sequence(); 1594 next_surface_sequence_ = proto.next_surface_sequence();
1583 } 1595 }
1584 1596
1585 } // namespace cc 1597 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698