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

Side by Side Diff: cc/layer_tree_impl.h

Issue 12093015: Move page scale ownership to LayerTreeImpl. (Closed) Base URL: http://git.chromium.org/chromium/src.git@coordchange3
Patch Set: Created 7 years, 11 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
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 12 matching lines...) Expand all
23 23
24 class DebugRectHistory; 24 class DebugRectHistory;
25 class FrameRateCounter; 25 class FrameRateCounter;
26 class HeadsUpDisplayLayerImpl; 26 class HeadsUpDisplayLayerImpl;
27 class LayerTreeDebugState; 27 class LayerTreeDebugState;
28 class LayerTreeHostImpl; 28 class LayerTreeHostImpl;
29 class LayerTreeImpl; 29 class LayerTreeImpl;
30 class LayerTreeSettings; 30 class LayerTreeSettings;
31 class OutputSurface; 31 class OutputSurface;
32 class PaintTimeCounter; 32 class PaintTimeCounter;
33 class PinchZoomViewport;
34 class Proxy; 33 class Proxy;
35 class ResourceProvider; 34 class ResourceProvider;
36 class TileManager; 35 class TileManager;
37 36
38 class CC_EXPORT LayerTreeImpl { 37 class CC_EXPORT LayerTreeImpl {
39 public: 38 public:
40 typedef std::vector<LayerImpl*> LayerList; 39 typedef std::vector<LayerImpl*> LayerList;
41 40
42 static scoped_ptr<LayerTreeImpl> create(LayerTreeHostImpl* layer_tree_host_imp l) 41 static scoped_ptr<LayerTreeImpl> create(LayerTreeHostImpl* layer_tree_host_imp l)
43 { 42 {
(...skipping 22 matching lines...) Expand all
66 void SetNeedsRedraw(); 65 void SetNeedsRedraw();
67 66
68 // TODO(nduca): These are implemented in cc files temporarily, but will become 67 // TODO(nduca): These are implemented in cc files temporarily, but will become
69 // trivial accessors in a followup patch. 68 // trivial accessors in a followup patch.
70 const LayerTreeDebugState& debug_state() const; 69 const LayerTreeDebugState& debug_state() const;
71 float device_scale_factor() const; 70 float device_scale_factor() const;
72 const gfx::Size& device_viewport_size() const; 71 const gfx::Size& device_viewport_size() const;
73 const gfx::Size& layout_viewport_size() const; 72 const gfx::Size& layout_viewport_size() const;
74 std::string layer_tree_as_text() const; 73 std::string layer_tree_as_text() const;
75 DebugRectHistory* debug_rect_history() const; 74 DebugRectHistory* debug_rect_history() const;
76 const PinchZoomViewport& pinch_zoom_viewport() const;
77 75
78 // Other public methods 76 // Other public methods
79 // --------------------------------------------------------------------------- 77 // ---------------------------------------------------------------------------
80 LayerImpl* RootLayer() const { return root_layer_.get(); } 78 LayerImpl* RootLayer() const { return root_layer_.get(); }
81 void SetRootLayer(scoped_ptr<LayerImpl>); 79 void SetRootLayer(scoped_ptr<LayerImpl>);
82 scoped_ptr<LayerImpl> DetachLayerTree(); 80 scoped_ptr<LayerImpl> DetachLayerTree();
83 81
84 int source_frame_number() const { return source_frame_number_; } 82 int source_frame_number() const { return source_frame_number_; }
85 void set_source_frame_number(int frame_number) { 83 void set_source_frame_number(int frame_number) {
86 source_frame_number_ = frame_number; 84 source_frame_number_ = frame_number;
(...skipping 24 matching lines...) Expand all
111 void set_has_transparent_background(bool transparent) { 109 void set_has_transparent_background(bool transparent) {
112 has_transparent_background_ = transparent; 110 has_transparent_background_ = transparent;
113 } 111 }
114 112
115 enum UpdateDrawPropertiesReason { 113 enum UpdateDrawPropertiesReason {
116 UPDATE_PENDING_TREE, 114 UPDATE_PENDING_TREE,
117 UPDATE_ACTIVE_TREE, 115 UPDATE_ACTIVE_TREE,
118 UPDATE_ACTIVE_TREE_FOR_DRAW 116 UPDATE_ACTIVE_TREE_FOR_DRAW
119 }; 117 };
120 118
119 gfx::Transform ImplTransform() const;
120
121 void SetPageScaleFactorAndLimits(float page_scale_factor,
122 float min_page_scale_factor, float max_page_scale_factor);
123 void SetPageScaleDelta(float delta);
124 float total_page_scale_factor() const {
125 return page_scale_factor_ * page_scale_delta_;
126 }
127 float page_scale_factor() const { return page_scale_factor_; }
128 float min_page_scale_factor() const { return min_page_scale_factor_; }
129 float max_page_scale_factor() const { return max_page_scale_factor_; }
130 float page_scale_delta() const { return page_scale_delta_; }
131 void set_sent_page_scale_delta(float delta) {
132 sent_page_scale_delta_ = delta;
133 }
134 float sent_page_scale_delta() const { return sent_page_scale_delta_; }
135
121 // Updates draw properties and render surface layer list 136 // Updates draw properties and render surface layer list
122 void UpdateDrawProperties(UpdateDrawPropertiesReason reason); 137 void UpdateDrawProperties(UpdateDrawPropertiesReason reason);
123 void set_needs_update_draw_properties() { 138 void set_needs_update_draw_properties() {
124 needs_update_draw_properties_ = true; 139 needs_update_draw_properties_ = true;
125 } 140 }
126 bool needs_update_draw_properties() const { 141 bool needs_update_draw_properties() const {
127 return needs_update_draw_properties_; 142 return needs_update_draw_properties_;
128 } 143 }
129 144
130 void ClearRenderSurfaces(); 145 void ClearRenderSurfaces();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 177
163 LayerTreeHostImpl* layer_tree_host_impl_; 178 LayerTreeHostImpl* layer_tree_host_impl_;
164 int source_frame_number_; 179 int source_frame_number_;
165 scoped_ptr<LayerImpl> root_layer_; 180 scoped_ptr<LayerImpl> root_layer_;
166 HeadsUpDisplayLayerImpl* hud_layer_; 181 HeadsUpDisplayLayerImpl* hud_layer_;
167 LayerImpl* root_scroll_layer_; 182 LayerImpl* root_scroll_layer_;
168 LayerImpl* currently_scrolling_layer_; 183 LayerImpl* currently_scrolling_layer_;
169 SkColor background_color_; 184 SkColor background_color_;
170 bool has_transparent_background_; 185 bool has_transparent_background_;
171 186
187 float page_scale_factor_;
188 float page_scale_delta_;
189 float sent_page_scale_delta_;
190 float min_page_scale_factor_;
191 float max_page_scale_factor_;
192
172 typedef base::hash_map<int, LayerImpl*> LayerIdMap; 193 typedef base::hash_map<int, LayerImpl*> LayerIdMap;
173 LayerIdMap layer_id_map_; 194 LayerIdMap layer_id_map_;
174 195
175 // Persisted state for non-impl-side-painting. 196 // Persisted state for non-impl-side-painting.
176 int scrolling_layer_id_from_previous_tree_; 197 int scrolling_layer_id_from_previous_tree_;
177 198
178 // List of visible layers for the most recently prepared frame. Used for 199 // List of visible layers for the most recently prepared frame. Used for
179 // rendering and input event hit testing. 200 // rendering and input event hit testing.
180 LayerList render_surface_layer_list_; 201 LayerList render_surface_layer_list_;
181 202
182 bool contents_textures_purged_; 203 bool contents_textures_purged_;
183 bool needs_update_draw_properties_; 204 bool needs_update_draw_properties_;
184 205
185 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 206 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
186 }; 207 };
187 208
188 } 209 }
189 210
190 #endif // CC_LAYER_TREE_IMPL_H_ 211 #endif // CC_LAYER_TREE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698