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

Side by Side Diff: cc/layer_tree_impl.h

Issue 12212156: cc: Only allow trees created at the current viewport size to draw. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | 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_LAYER_TREE_IMPL_H_ 5 #ifndef CC_LAYER_TREE_IMPL_H_
6 #define CC_LAYER_TREE_IMPL_H_ 6 #define CC_LAYER_TREE_IMPL_H_
7 7
8 #include "base/hash_tables.h" 8 #include "base/hash_tables.h"
9 #include "cc/layer_impl.h" 9 #include "cc/layer_impl.h"
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 base::TimeTicks CurrentFrameTime() const; 64 base::TimeTicks CurrentFrameTime() const;
65 65
66 // Tree specific methods exposed to layer-impl tree. 66 // Tree specific methods exposed to layer-impl tree.
67 // --------------------------------------------------------------------------- 67 // ---------------------------------------------------------------------------
68 void SetNeedsRedraw(); 68 void SetNeedsRedraw();
69 69
70 // TODO(nduca): These are implemented in cc files temporarily, but will become 70 // TODO(nduca): These are implemented in cc files temporarily, but will become
71 // trivial accessors in a followup patch. 71 // trivial accessors in a followup patch.
72 const LayerTreeDebugState& debug_state() const; 72 const LayerTreeDebugState& debug_state() const;
73 float device_scale_factor() const; 73 float device_scale_factor() const;
74 const gfx::Size& device_viewport_size() const;
75 const gfx::Size& layout_viewport_size() const;
76 std::string layer_tree_as_text() const; 74 std::string layer_tree_as_text() const;
77 DebugRectHistory* debug_rect_history() const; 75 DebugRectHistory* debug_rect_history() const;
78 76
79 // Other public methods 77 // Other public methods
80 // --------------------------------------------------------------------------- 78 // ---------------------------------------------------------------------------
81 LayerImpl* RootLayer() const { return root_layer_.get(); } 79 LayerImpl* RootLayer() const { return root_layer_.get(); }
82 void SetRootLayer(scoped_ptr<LayerImpl>); 80 void SetRootLayer(scoped_ptr<LayerImpl>);
83 scoped_ptr<LayerImpl> DetachLayerTree(); 81 scoped_ptr<LayerImpl> DetachLayerTree();
84 82
85 void pushPropertiesTo(LayerTreeImpl*); 83 void pushPropertiesTo(LayerTreeImpl*);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 129 }
132 float page_scale_factor() const { return page_scale_factor_; } 130 float page_scale_factor() const { return page_scale_factor_; }
133 float min_page_scale_factor() const { return min_page_scale_factor_; } 131 float min_page_scale_factor() const { return min_page_scale_factor_; }
134 float max_page_scale_factor() const { return max_page_scale_factor_; } 132 float max_page_scale_factor() const { return max_page_scale_factor_; }
135 float page_scale_delta() const { return page_scale_delta_; } 133 float page_scale_delta() const { return page_scale_delta_; }
136 void set_sent_page_scale_delta(float delta) { 134 void set_sent_page_scale_delta(float delta) {
137 sent_page_scale_delta_ = delta; 135 sent_page_scale_delta_ = delta;
138 } 136 }
139 float sent_page_scale_delta() const { return sent_page_scale_delta_; } 137 float sent_page_scale_delta() const { return sent_page_scale_delta_; }
140 138
139 void SetDeviceViewportSize(const gfx::Size& device_viewport_size);
140 const gfx::Size& device_viewport_size() const { return device_viewport_size_; }
141
141 // Updates draw properties and render surface layer list 142 // Updates draw properties and render surface layer list
142 void UpdateDrawProperties(UpdateDrawPropertiesReason reason); 143 void UpdateDrawProperties(UpdateDrawPropertiesReason reason);
143 void set_needs_update_draw_properties() { 144 void set_needs_update_draw_properties() {
144 needs_update_draw_properties_ = true; 145 needs_update_draw_properties_ = true;
145 } 146 }
146 bool needs_update_draw_properties() const { 147 bool needs_update_draw_properties() const {
147 return needs_update_draw_properties_; 148 return needs_update_draw_properties_;
148 } 149 }
149 150
150 void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; } 151 void set_needs_full_tree_sync(bool needs) { needs_full_tree_sync_ = needs; }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 LayerImpl* currently_scrolling_layer_; 192 LayerImpl* currently_scrolling_layer_;
192 SkColor background_color_; 193 SkColor background_color_;
193 bool has_transparent_background_; 194 bool has_transparent_background_;
194 195
195 float page_scale_factor_; 196 float page_scale_factor_;
196 float page_scale_delta_; 197 float page_scale_delta_;
197 float sent_page_scale_delta_; 198 float sent_page_scale_delta_;
198 float min_page_scale_factor_; 199 float min_page_scale_factor_;
199 float max_page_scale_factor_; 200 float max_page_scale_factor_;
200 201
202 gfx::Size device_viewport_size_;
203
201 typedef base::hash_map<int, LayerImpl*> LayerIdMap; 204 typedef base::hash_map<int, LayerImpl*> LayerIdMap;
202 LayerIdMap layer_id_map_; 205 LayerIdMap layer_id_map_;
203 206
204 // Persisted state for non-impl-side-painting. 207 // Persisted state for non-impl-side-painting.
205 int scrolling_layer_id_from_previous_tree_; 208 int scrolling_layer_id_from_previous_tree_;
206 209
207 // List of visible layers for the most recently prepared frame. Used for 210 // List of visible layers for the most recently prepared frame. Used for
208 // rendering and input event hit testing. 211 // rendering and input event hit testing.
209 LayerList render_surface_layer_list_; 212 LayerList render_surface_layer_list_;
210 213
211 bool contents_textures_purged_; 214 bool contents_textures_purged_;
212 bool needs_update_draw_properties_; 215 bool needs_update_draw_properties_;
213 216
214 // In impl-side painting mode, this is true when the tree may contain 217 // In impl-side painting mode, this is true when the tree may contain
215 // structural differences relative to the active tree. 218 // structural differences relative to the active tree.
216 bool needs_full_tree_sync_; 219 bool needs_full_tree_sync_;
217 220
218 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 221 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
219 }; 222 };
220 223
221 } 224 }
222 225
223 #endif // CC_LAYER_TREE_IMPL_H_ 226 #endif // CC_LAYER_TREE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698