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

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

Issue 265883013: cc: Add a flag to layers that returns true if the layer is in RSLL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: perftest fix Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/layer_impl.cc ('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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 if (!page_scale_layer && root_scroll) 781 if (!page_scale_layer && root_scroll)
782 page_scale_layer = root_scroll->parent(); 782 page_scale_layer = root_scroll->parent();
783 783
784 if (hud_layer_) { 784 if (hud_layer_) {
785 hud_layer_->PrepareForCalculateDrawProperties( 785 hud_layer_->PrepareForCalculateDrawProperties(
786 device_viewport_size(), device_scale_factor_); 786 device_viewport_size(), device_scale_factor_);
787 } 787 }
788 788
789 TRACE_EVENT0("cc", "LayerTreeHost::UpdateLayers::CalcDrawProps"); 789 TRACE_EVENT0("cc", "LayerTreeHost::UpdateLayers::CalcDrawProps");
790 bool can_render_to_separate_surface = true; 790 bool can_render_to_separate_surface = true;
791 // TODO(vmpstr): Passing 0 as the current render surface layer list id means
792 // that we won't be able to detect if a layer is part of |update_list|.
793 // Change this if this information is required.
794 int render_surface_layer_list_id = 0;
791 LayerTreeHostCommon::CalcDrawPropsMainInputs inputs( 795 LayerTreeHostCommon::CalcDrawPropsMainInputs inputs(
792 root_layer, 796 root_layer,
793 device_viewport_size(), 797 device_viewport_size(),
794 gfx::Transform(), 798 gfx::Transform(),
795 device_scale_factor_, 799 device_scale_factor_,
796 page_scale_factor_, 800 page_scale_factor_,
797 page_scale_layer, 801 page_scale_layer,
798 GetRendererCapabilities().max_texture_size, 802 GetRendererCapabilities().max_texture_size,
799 settings_.can_use_lcd_text, 803 settings_.can_use_lcd_text,
800 can_render_to_separate_surface, 804 can_render_to_separate_surface,
801 settings_.layer_transforms_should_scale_layer_contents, 805 settings_.layer_transforms_should_scale_layer_contents,
802 &update_list); 806 &update_list,
807 render_surface_layer_list_id);
803 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 808 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
804 809
805 if (total_frames_used_for_lcd_text_metrics_ <= 810 if (total_frames_used_for_lcd_text_metrics_ <=
806 kTotalFramesToUseForLCDTextMetrics) { 811 kTotalFramesToUseForLCDTextMetrics) {
807 LayerTreeHostCommon::CallFunctionForSubtree( 812 LayerTreeHostCommon::CallFunctionForSubtree(
808 root_layer, 813 root_layer,
809 base::Bind(&LayerTreeHost::CalculateLCDTextMetricsCallback, 814 base::Bind(&LayerTreeHost::CalculateLCDTextMetricsCallback,
810 base::Unretained(this))); 815 base::Unretained(this)));
811 total_frames_used_for_lcd_text_metrics_++; 816 total_frames_used_for_lcd_text_metrics_++;
812 } 817 }
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 swap_promise_list_.push_back(swap_promise.Pass()); 1262 swap_promise_list_.push_back(swap_promise.Pass());
1258 } 1263 }
1259 1264
1260 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { 1265 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
1261 for (size_t i = 0; i < swap_promise_list_.size(); i++) 1266 for (size_t i = 0; i < swap_promise_list_.size(); i++)
1262 swap_promise_list_[i]->DidNotSwap(reason); 1267 swap_promise_list_[i]->DidNotSwap(reason);
1263 swap_promise_list_.clear(); 1268 swap_promise_list_.clear();
1264 } 1269 }
1265 1270
1266 } // namespace cc 1271 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_host_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698