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

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: Rebase to 179503 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
« no previous file with comments | « cc/layer_tree_host_unittest.cc ('k') | cc/layer_tree_impl.cc » ('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 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 23 matching lines...) Expand all
67 void SetNeedsRedraw(); 66 void SetNeedsRedraw();
68 67
69 // TODO(nduca): These are implemented in cc files temporarily, but will become 68 // TODO(nduca): These are implemented in cc files temporarily, but will become
70 // trivial accessors in a followup patch. 69 // trivial accessors in a followup patch.
71 const LayerTreeDebugState& debug_state() const; 70 const LayerTreeDebugState& debug_state() const;
72 float device_scale_factor() const; 71 float device_scale_factor() const;
73 const gfx::Size& device_viewport_size() const; 72 const gfx::Size& device_viewport_size() const;
74 const gfx::Size& layout_viewport_size() const; 73 const gfx::Size& layout_viewport_size() const;
75 std::string layer_tree_as_text() const; 74 std::string layer_tree_as_text() const;
76 DebugRectHistory* debug_rect_history() const; 75 DebugRectHistory* debug_rect_history() const;
77 const PinchZoomViewport& pinch_zoom_viewport() 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
83 void pushPropertiesTo(LayerTreeImpl*);
84
85 int source_frame_number() const { return source_frame_number_; } 85 int source_frame_number() const { return source_frame_number_; }
86 void set_source_frame_number(int frame_number) { 86 void set_source_frame_number(int frame_number) {
87 source_frame_number_ = frame_number; 87 source_frame_number_ = frame_number;
88 } 88 }
89 89
90 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } 90 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; }
91 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { 91 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) {
92 hud_layer_ = layer_impl; 92 hud_layer_ = layer_impl;
93 } 93 }
94 94
(...skipping 17 matching lines...) Expand all
112 void set_has_transparent_background(bool transparent) { 112 void set_has_transparent_background(bool transparent) {
113 has_transparent_background_ = transparent; 113 has_transparent_background_ = transparent;
114 } 114 }
115 115
116 enum UpdateDrawPropertiesReason { 116 enum UpdateDrawPropertiesReason {
117 UPDATE_PENDING_TREE, 117 UPDATE_PENDING_TREE,
118 UPDATE_ACTIVE_TREE, 118 UPDATE_ACTIVE_TREE,
119 UPDATE_ACTIVE_TREE_FOR_DRAW 119 UPDATE_ACTIVE_TREE_FOR_DRAW
120 }; 120 };
121 121
122 gfx::Transform ImplTransform() const;
123
124 void SetPageScaleFactorAndLimits(float page_scale_factor,
125 float min_page_scale_factor, float max_page_scale_factor);
126 void SetPageScaleDelta(float delta);
127 float total_page_scale_factor() const {
128 return page_scale_factor_ * page_scale_delta_;
129 }
130 float page_scale_factor() const { return page_scale_factor_; }
131 float min_page_scale_factor() const { return min_page_scale_factor_; }
132 float max_page_scale_factor() const { return max_page_scale_factor_; }
133 float page_scale_delta() const { return page_scale_delta_; }
134 void set_sent_page_scale_delta(float delta) {
135 sent_page_scale_delta_ = delta;
136 }
137 float sent_page_scale_delta() const { return sent_page_scale_delta_; }
138
122 // Updates draw properties and render surface layer list 139 // Updates draw properties and render surface layer list
123 void UpdateDrawProperties(UpdateDrawPropertiesReason reason); 140 void UpdateDrawProperties(UpdateDrawPropertiesReason reason);
124 void set_needs_update_draw_properties() { 141 void set_needs_update_draw_properties() {
125 needs_update_draw_properties_ = true; 142 needs_update_draw_properties_ = true;
126 } 143 }
127 bool needs_update_draw_properties() const { 144 bool needs_update_draw_properties() const {
128 return needs_update_draw_properties_; 145 return needs_update_draw_properties_;
129 } 146 }
130 147
131 void ClearRenderSurfaces(); 148 void ClearRenderSurfaces();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 180
164 LayerTreeHostImpl* layer_tree_host_impl_; 181 LayerTreeHostImpl* layer_tree_host_impl_;
165 int source_frame_number_; 182 int source_frame_number_;
166 scoped_ptr<LayerImpl> root_layer_; 183 scoped_ptr<LayerImpl> root_layer_;
167 HeadsUpDisplayLayerImpl* hud_layer_; 184 HeadsUpDisplayLayerImpl* hud_layer_;
168 LayerImpl* root_scroll_layer_; 185 LayerImpl* root_scroll_layer_;
169 LayerImpl* currently_scrolling_layer_; 186 LayerImpl* currently_scrolling_layer_;
170 SkColor background_color_; 187 SkColor background_color_;
171 bool has_transparent_background_; 188 bool has_transparent_background_;
172 189
190 float page_scale_factor_;
191 float page_scale_delta_;
192 float sent_page_scale_delta_;
193 float min_page_scale_factor_;
194 float max_page_scale_factor_;
195
173 typedef base::hash_map<int, LayerImpl*> LayerIdMap; 196 typedef base::hash_map<int, LayerImpl*> LayerIdMap;
174 LayerIdMap layer_id_map_; 197 LayerIdMap layer_id_map_;
175 198
176 // Persisted state for non-impl-side-painting. 199 // Persisted state for non-impl-side-painting.
177 int scrolling_layer_id_from_previous_tree_; 200 int scrolling_layer_id_from_previous_tree_;
178 201
179 // List of visible layers for the most recently prepared frame. Used for 202 // List of visible layers for the most recently prepared frame. Used for
180 // rendering and input event hit testing. 203 // rendering and input event hit testing.
181 LayerList render_surface_layer_list_; 204 LayerList render_surface_layer_list_;
182 205
183 bool contents_textures_purged_; 206 bool contents_textures_purged_;
184 bool needs_update_draw_properties_; 207 bool needs_update_draw_properties_;
185 208
186 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 209 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
187 }; 210 };
188 211
189 } 212 }
190 213
191 #endif // CC_LAYER_TREE_IMPL_H_ 214 #endif // CC_LAYER_TREE_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layer_tree_host_unittest.cc ('k') | cc/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698