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

Side by Side Diff: cc/resources/picture_layer_tiling.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_RESOURCES_PICTURE_LAYER_TILING_H_ 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_
6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 WhichTree tree, 129 WhichTree tree,
130 gfx::Size device_viewport, 130 gfx::Size device_viewport,
131 const gfx::RectF& viewport_in_layer_space, 131 const gfx::RectF& viewport_in_layer_space,
132 const gfx::RectF& visible_layer_rect, 132 const gfx::RectF& visible_layer_rect,
133 gfx::Size last_layer_bounds, 133 gfx::Size last_layer_bounds,
134 gfx::Size current_layer_bounds, 134 gfx::Size current_layer_bounds,
135 float last_layer_contents_scale, 135 float last_layer_contents_scale,
136 float current_layer_contents_scale, 136 float current_layer_contents_scale,
137 const gfx::Transform& last_screen_transform, 137 const gfx::Transform& last_screen_transform,
138 const gfx::Transform& current_screen_transform, 138 const gfx::Transform& current_screen_transform,
139 int current_source_frame_number, 139 double current_frame_time_in_seconds,
140 double current_frame_time,
141 bool store_screen_space_quads_on_tiles, 140 bool store_screen_space_quads_on_tiles,
142 size_t max_tiles_for_interest_area); 141 size_t max_tiles_for_interest_area);
143 142
144 // Copies the src_tree priority into the dst_tree priority for all tiles. 143 // Copies the src_tree priority into the dst_tree priority for all tiles.
145 // The src_tree priority is reset to the lowest priority possible. This 144 // The src_tree priority is reset to the lowest priority possible. This
146 // also updates the pile on each tile to be the current client's pile. 145 // also updates the pile on each tile to be the current client's pile.
147 void DidBecomeActive(); 146 void DidBecomeActive();
148 147
148 bool NeedsUpdateForFrameAtTime(double frame_time_in_seconds) {
149 return frame_time_in_seconds != last_impl_frame_time_in_seconds_;
150 }
151
149 scoped_ptr<base::Value> AsValue() const; 152 scoped_ptr<base::Value> AsValue() const;
150 153
151 static gfx::Rect ExpandRectEquallyToAreaBoundedBy( 154 static gfx::Rect ExpandRectEquallyToAreaBoundedBy(
152 gfx::Rect starting_rect, 155 gfx::Rect starting_rect,
153 int64 target_area, 156 int64 target_area,
154 gfx::Rect bounding_rect); 157 gfx::Rect bounding_rect);
155 158
156 protected: 159 protected:
157 typedef std::pair<int, int> TileMapKey; 160 typedef std::pair<int, int> TileMapKey;
158 typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap; 161 typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap;
(...skipping 10 matching lines...) Expand all
169 gfx::Size layer_bounds_; 172 gfx::Size layer_bounds_;
170 TileResolution resolution_; 173 TileResolution resolution_;
171 PictureLayerTilingClient* client_; 174 PictureLayerTilingClient* client_;
172 175
173 // Internal data. 176 // Internal data.
174 TilingData tiling_data_; 177 TilingData tiling_data_;
175 TileMap tiles_; // It is not legal to have a NULL tile in the tiles_ map. 178 TileMap tiles_; // It is not legal to have a NULL tile in the tiles_ map.
176 gfx::Rect live_tiles_rect_; 179 gfx::Rect live_tiles_rect_;
177 180
178 // State saved for computing velocities based upon finite differences. 181 // State saved for computing velocities based upon finite differences.
179 int last_source_frame_number_; 182 double last_impl_frame_time_in_seconds_;
180 double last_impl_frame_time_;
181 183
182 friend class CoverageIterator; 184 friend class CoverageIterator;
183 185
184 private: 186 private:
185 DISALLOW_ASSIGN(PictureLayerTiling); 187 DISALLOW_ASSIGN(PictureLayerTiling);
186 }; 188 };
187 189
188 } // namespace cc 190 } // namespace cc
189 191
190 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ 192 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698