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

Side by Side Diff: cc/trees/layer_tree_impl.h

Issue 12259027: cc: Simplify the logic for deciding to update tile priorities. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add early-out and unit test Created 7 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_
6 #define CC_TREES_LAYER_TREE_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 SkColor background_color() const { return background_color_; } 114 SkColor background_color() const { return background_color_; }
115 void set_background_color(SkColor color) { background_color_ = color; } 115 void set_background_color(SkColor color) { background_color_ = color; }
116 116
117 bool has_transparent_background() const { 117 bool has_transparent_background() const {
118 return has_transparent_background_; 118 return has_transparent_background_;
119 } 119 }
120 void set_has_transparent_background(bool transparent) { 120 void set_has_transparent_background(bool transparent) {
121 has_transparent_background_ = transparent; 121 has_transparent_background_ = transparent;
122 } 122 }
123 123
124 enum UpdateDrawPropertiesReason {
125 UPDATE_PENDING_TREE,
126 UPDATE_ACTIVE_TREE,
127 UPDATE_ACTIVE_TREE_FOR_DRAW
128 };
129
130 void SetPageScaleFactorAndLimits(float page_scale_factor, 124 void SetPageScaleFactorAndLimits(float page_scale_factor,
131 float min_page_scale_factor, float max_page_scale_factor); 125 float min_page_scale_factor, float max_page_scale_factor);
132 void SetPageScaleDelta(float delta); 126 void SetPageScaleDelta(float delta);
133 float total_page_scale_factor() const { 127 float total_page_scale_factor() const {
134 return page_scale_factor_ * page_scale_delta_; 128 return page_scale_factor_ * page_scale_delta_;
135 } 129 }
136 float page_scale_factor() const { return page_scale_factor_; } 130 float page_scale_factor() const { return page_scale_factor_; }
137 float min_page_scale_factor() const { return min_page_scale_factor_; } 131 float min_page_scale_factor() const { return min_page_scale_factor_; }
138 float max_page_scale_factor() const { return max_page_scale_factor_; } 132 float max_page_scale_factor() const { return max_page_scale_factor_; }
139 float page_scale_delta() const { return page_scale_delta_; } 133 float page_scale_delta() const { return page_scale_delta_; }
140 void set_sent_page_scale_delta(float delta) { 134 void set_sent_page_scale_delta(float delta) {
141 sent_page_scale_delta_ = delta; 135 sent_page_scale_delta_ = delta;
142 } 136 }
143 float sent_page_scale_delta() const { return sent_page_scale_delta_; } 137 float sent_page_scale_delta() const { return sent_page_scale_delta_; }
144 138
145 // Updates draw properties and render surface layer list 139 // Updates draw properties and render surface layer list, as well as tile
146 void UpdateDrawProperties(UpdateDrawPropertiesReason reason); 140 // priorities.
141 void UpdateDrawProperties();
142
147 void set_needs_update_draw_properties() { 143 void set_needs_update_draw_properties() {
148 needs_update_draw_properties_ = true; 144 needs_update_draw_properties_ = true;
149 } 145 }
150 bool needs_update_draw_properties() const { 146 bool needs_update_draw_properties() const {
151 return needs_update_draw_properties_; 147 return needs_update_draw_properties_;
152 } 148 }
153 149
154 void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; } 150 void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; }
155 bool needs_full_tree_sync() const { return needs_full_tree_sync_; } 151 bool needs_full_tree_sync() const { return needs_full_tree_sync_; }
156 152
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 bool needs_full_tree_sync_; 253 bool needs_full_tree_sync_;
258 254
259 LatencyInfo latency_info_; 255 LatencyInfo latency_info_;
260 256
261 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 257 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
262 }; 258 };
263 259
264 } // namespace cc 260 } // namespace cc
265 261
266 #endif // CC_TREES_LAYER_TREE_IMPL_H_ 262 #endif // CC_TREES_LAYER_TREE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698