| OLD | NEW |
| 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 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 namespace cc { | 22 namespace cc { |
| 23 | 23 |
| 24 class PictureLayerTiling; | 24 class PictureLayerTiling; |
| 25 | 25 |
| 26 class PictureLayerTilingClient { | 26 class PictureLayerTilingClient { |
| 27 public: | 27 public: |
| 28 // Create a tile at the given content_rect (in the contents scale of the | 28 // Create a tile at the given content_rect (in the contents scale of the |
| 29 // tiling) This might return null if the client cannot create such a tile. | 29 // tiling) This might return null if the client cannot create such a tile. |
| 30 virtual scoped_refptr<Tile> CreateTile( | 30 virtual scoped_refptr<Tile> CreateTile( |
| 31 PictureLayerTiling* tiling, | 31 const PictureLayerTiling* tiling, |
| 32 gfx::Rect content_rect) = 0; | 32 gfx::Rect content_rect) = 0; |
| 33 virtual void UpdatePile(Tile* tile) = 0; | 33 virtual void UpdatePile(Tile* tile) = 0; |
| 34 virtual gfx::Size CalculateTileSize( | 34 virtual gfx::Size CalculateTileSize( |
| 35 gfx::Size content_bounds) = 0; | 35 gfx::Size content_bounds) = 0; |
| 36 virtual const Region* GetInvalidation() = 0; | 36 virtual const Region* GetInvalidation() = 0; |
| 37 virtual const PictureLayerTiling* GetTwinTiling( | 37 virtual const PictureLayerTiling* GetTwinTiling( |
| 38 const PictureLayerTiling* tiling) = 0; | 38 const PictureLayerTiling* tiling) = 0; |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 virtual ~PictureLayerTilingClient() {} | 41 virtual ~PictureLayerTilingClient() {} |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 return frame_time_in_seconds != last_impl_frame_time_in_seconds_; | 149 return frame_time_in_seconds != last_impl_frame_time_in_seconds_; |
| 150 } | 150 } |
| 151 | 151 |
| 152 scoped_ptr<base::Value> AsValue() const; | 152 scoped_ptr<base::Value> AsValue() const; |
| 153 | 153 |
| 154 static gfx::Rect ExpandRectEquallyToAreaBoundedBy( | 154 static gfx::Rect ExpandRectEquallyToAreaBoundedBy( |
| 155 gfx::Rect starting_rect, | 155 gfx::Rect starting_rect, |
| 156 int64 target_area, | 156 int64 target_area, |
| 157 gfx::Rect bounding_rect); | 157 gfx::Rect bounding_rect); |
| 158 | 158 |
| 159 bool has_ever_been_updated() const { |
| 160 return last_impl_frame_time_in_seconds_ != 0.0; |
| 161 } |
| 162 |
| 159 protected: | 163 protected: |
| 160 typedef std::pair<int, int> TileMapKey; | 164 typedef std::pair<int, int> TileMapKey; |
| 161 typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap; | 165 typedef base::hash_map<TileMapKey, scoped_refptr<Tile> > TileMap; |
| 162 | 166 |
| 163 PictureLayerTiling(float contents_scale, | 167 PictureLayerTiling(float contents_scale, |
| 164 gfx::Size layer_bounds, | 168 gfx::Size layer_bounds, |
| 165 PictureLayerTilingClient* client); | 169 PictureLayerTilingClient* client); |
| 166 void SetLiveTilesRect(gfx::Rect live_tiles_rect); | 170 void SetLiveTilesRect(gfx::Rect live_tiles_rect); |
| 167 void CreateTile(int i, int j); | 171 void CreateTile(int i, int j); |
| 168 Tile* TileAt(int, int) const; | 172 Tile* TileAt(int, int) const; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 183 | 187 |
| 184 friend class CoverageIterator; | 188 friend class CoverageIterator; |
| 185 | 189 |
| 186 private: | 190 private: |
| 187 DISALLOW_ASSIGN(PictureLayerTiling); | 191 DISALLOW_ASSIGN(PictureLayerTiling); |
| 188 }; | 192 }; |
| 189 | 193 |
| 190 } // namespace cc | 194 } // namespace cc |
| 191 | 195 |
| 192 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 196 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |