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

Side by Side Diff: cc/resources/picture_layer_tiling.h

Issue 505913003: cc: Remove and Create the correct tiles when resizing live tiles rect (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: livetiles: comment Created 6 years, 3 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_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 <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 friend class TilingRasterTileIterator; 291 friend class TilingRasterTileIterator;
292 friend class TilingEvictionTileIterator; 292 friend class TilingEvictionTileIterator;
293 293
294 typedef std::pair<int, int> TileMapKey; 294 typedef std::pair<int, int> TileMapKey;
295 typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap; 295 typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap;
296 296
297 PictureLayerTiling(float contents_scale, 297 PictureLayerTiling(float contents_scale,
298 const gfx::Size& layer_bounds, 298 const gfx::Size& layer_bounds,
299 PictureLayerTilingClient* client); 299 PictureLayerTilingClient* client);
300 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); 300 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect);
301 void VerifyLiveTilesRect();
301 Tile* CreateTile(int i, int j, const PictureLayerTiling* twin_tiling); 302 Tile* CreateTile(int i, int j, const PictureLayerTiling* twin_tiling);
302 void RemoveTileAt(int i, int j); 303 // Returns true if the Tile existed and was removed from the tiling.
304 bool RemoveTileAt(int i, int j, PictureLayerTiling* recycled_twin);
303 305
304 // Computes a skewport. The calculation extrapolates the last visible 306 // Computes a skewport. The calculation extrapolates the last visible
305 // rect and the current visible rect to expand the skewport to where it 307 // rect and the current visible rect to expand the skewport to where it
306 // would be in |skewport_target_time| seconds. Note that the skewport 308 // would be in |skewport_target_time| seconds. Note that the skewport
307 // is guaranteed to contain the current visible rect. 309 // is guaranteed to contain the current visible rect.
308 gfx::Rect ComputeSkewport(double current_frame_time_in_seconds, 310 gfx::Rect ComputeSkewport(double current_frame_time_in_seconds,
309 const gfx::Rect& visible_rect_in_content_space) 311 const gfx::Rect& visible_rect_in_content_space)
310 const; 312 const;
311 313
312 void UpdateEvictionCacheIfNeeded(TreePriority tree_priority); 314 void UpdateEvictionCacheIfNeeded(TreePriority tree_priority);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 361
360 private: 362 private:
361 DISALLOW_ASSIGN(PictureLayerTiling); 363 DISALLOW_ASSIGN(PictureLayerTiling);
362 364
363 RectExpansionCache expansion_cache_; 365 RectExpansionCache expansion_cache_;
364 }; 366 };
365 367
366 } // namespace cc 368 } // namespace cc
367 369
368 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ 370 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698