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

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

Issue 563313002: Revert of Generalize scroll parent work in CalculateDrawProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_common.h » ('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 <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 #include <string> 9 #include <string>
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 has_gpu_rasterization_trigger_(false), 116 has_gpu_rasterization_trigger_(false),
117 content_is_suitable_for_gpu_rasterization_(true), 117 content_is_suitable_for_gpu_rasterization_(true),
118 gpu_rasterization_histogram_recorded_(false), 118 gpu_rasterization_histogram_recorded_(false),
119 background_color_(SK_ColorWHITE), 119 background_color_(SK_ColorWHITE),
120 has_transparent_background_(false), 120 has_transparent_background_(false),
121 partial_texture_update_requests_(0), 121 partial_texture_update_requests_(0),
122 in_paint_layer_contents_(false), 122 in_paint_layer_contents_(false),
123 total_frames_used_for_lcd_text_metrics_(0), 123 total_frames_used_for_lcd_text_metrics_(0),
124 id_(s_layer_tree_host_sequence_number.GetNext() + 1), 124 id_(s_layer_tree_host_sequence_number.GetNext() + 1),
125 next_commit_forces_redraw_(false), 125 next_commit_forces_redraw_(false),
126 shared_bitmap_manager_(manager), 126 shared_bitmap_manager_(manager) {
127 render_surface_layer_list_id_(0) {
128 if (settings_.accelerated_animation_enabled) 127 if (settings_.accelerated_animation_enabled)
129 animation_registrar_ = AnimationRegistrar::Create(); 128 animation_registrar_ = AnimationRegistrar::Create();
130 rendering_stats_instrumentation_->set_record_rendering_stats( 129 rendering_stats_instrumentation_->set_record_rendering_stats(
131 debug_state_.RecordRenderingStats()); 130 debug_state_.RecordRenderingStats());
132 } 131 }
133 132
134 void LayerTreeHost::InitializeThreaded( 133 void LayerTreeHost::InitializeThreaded(
135 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 134 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
136 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { 135 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) {
137 InitializeProxy( 136 InitializeProxy(
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 if (!page_scale_layer && root_scroll) 820 if (!page_scale_layer && root_scroll)
822 page_scale_layer = root_scroll->parent(); 821 page_scale_layer = root_scroll->parent();
823 822
824 if (hud_layer_.get()) { 823 if (hud_layer_.get()) {
825 hud_layer_->PrepareForCalculateDrawProperties( 824 hud_layer_->PrepareForCalculateDrawProperties(
826 device_viewport_size(), device_scale_factor_); 825 device_viewport_size(), device_scale_factor_);
827 } 826 }
828 827
829 TRACE_EVENT0("cc", "LayerTreeHost::UpdateLayers::CalcDrawProps"); 828 TRACE_EVENT0("cc", "LayerTreeHost::UpdateLayers::CalcDrawProps");
830 bool can_render_to_separate_surface = true; 829 bool can_render_to_separate_surface = true;
831 ++render_surface_layer_list_id_; 830 // TODO(vmpstr): Passing 0 as the current render surface layer list id means
831 // that we won't be able to detect if a layer is part of |update_list|.
832 // Change this if this information is required.
833 int render_surface_layer_list_id = 0;
832 LayerTreeHostCommon::CalcDrawPropsMainInputs inputs( 834 LayerTreeHostCommon::CalcDrawPropsMainInputs inputs(
833 root_layer, 835 root_layer,
834 device_viewport_size(), 836 device_viewport_size(),
835 gfx::Transform(), 837 gfx::Transform(),
836 device_scale_factor_, 838 device_scale_factor_,
837 page_scale_factor_, 839 page_scale_factor_,
838 page_scale_layer, 840 page_scale_layer,
839 GetRendererCapabilities().max_texture_size, 841 GetRendererCapabilities().max_texture_size,
840 settings_.can_use_lcd_text, 842 settings_.can_use_lcd_text,
841 can_render_to_separate_surface, 843 can_render_to_separate_surface,
842 settings_.layer_transforms_should_scale_layer_contents, 844 settings_.layer_transforms_should_scale_layer_contents,
843 &update_list, 845 &update_list,
844 render_surface_layer_list_id_); 846 render_surface_layer_list_id);
845 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 847 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
846 848
847 if (total_frames_used_for_lcd_text_metrics_ <= 849 if (total_frames_used_for_lcd_text_metrics_ <=
848 kTotalFramesToUseForLCDTextMetrics) { 850 kTotalFramesToUseForLCDTextMetrics) {
849 LayerTreeHostCommon::CallFunctionForSubtree( 851 LayerTreeHostCommon::CallFunctionForSubtree(
850 root_layer, 852 root_layer,
851 base::Bind(&LayerTreeHost::CalculateLCDTextMetricsCallback, 853 base::Bind(&LayerTreeHost::CalculateLCDTextMetricsCallback,
852 base::Unretained(this))); 854 base::Unretained(this)));
853 total_frames_used_for_lcd_text_metrics_++; 855 total_frames_used_for_lcd_text_metrics_++;
854 } 856 }
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 swap_promise_list_.push_back(swap_promise.Pass()); 1324 swap_promise_list_.push_back(swap_promise.Pass());
1323 } 1325 }
1324 1326
1325 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { 1327 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
1326 for (size_t i = 0; i < swap_promise_list_.size(); i++) 1328 for (size_t i = 0; i < swap_promise_list_.size(); i++)
1327 swap_promise_list_[i]->DidNotSwap(reason); 1329 swap_promise_list_[i]->DidNotSwap(reason);
1328 swap_promise_list_.clear(); 1330 swap_promise_list_.clear();
1329 } 1331 }
1330 1332
1331 } // namespace cc 1333 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698