OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_LAYER_TILING_DATA_H_ | 5 #ifndef CC_RESOURCES_LAYER_TILING_DATA_H_ |
6 #define CC_RESOURCES_LAYER_TILING_DATA_H_ | 6 #define CC_RESOURCES_LAYER_TILING_DATA_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 i_ = i; | 62 i_ = i; |
63 j_ = j; | 63 j_ = j; |
64 } | 64 } |
65 | 65 |
66 private: | 66 private: |
67 int i_; | 67 int i_; |
68 int j_; | 68 int j_; |
69 DISALLOW_COPY_AND_ASSIGN(Tile); | 69 DISALLOW_COPY_AND_ASSIGN(Tile); |
70 }; | 70 }; |
71 typedef std::pair<int, int> TileMapKey; | 71 typedef std::pair<int, int> TileMapKey; |
72 typedef base::ScopedPtrHashMap<TileMapKey, Tile> TileMap; | 72 typedef base::ScopedPtrHashMap<TileMapKey, scoped_ptr<Tile>> TileMap; |
73 | 73 |
74 void AddTile(scoped_ptr<Tile> tile, int i, int j); | 74 void AddTile(scoped_ptr<Tile> tile, int i, int j); |
75 scoped_ptr<Tile> TakeTile(int i, int j); | 75 scoped_ptr<Tile> TakeTile(int i, int j); |
76 Tile* TileAt(int i, int j) const; | 76 Tile* TileAt(int i, int j) const; |
77 const TileMap& tiles() const { return tiles_; } | 77 const TileMap& tiles() const { return tiles_; } |
78 | 78 |
79 void SetTilingSize(const gfx::Size& tiling_size); | 79 void SetTilingSize(const gfx::Size& tiling_size); |
80 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } | 80 gfx::Size tiling_size() const { return tiling_data_.tiling_size(); } |
81 | 81 |
82 void ContentRectToTileIndices(const gfx::Rect& rect, | 82 void ContentRectToTileIndices(const gfx::Rect& rect, |
(...skipping 10 matching lines...) Expand all Loading... |
93 | 93 |
94 TileMap tiles_; | 94 TileMap tiles_; |
95 TilingData tiling_data_; | 95 TilingData tiling_data_; |
96 | 96 |
97 DISALLOW_COPY(LayerTilingData); | 97 DISALLOW_COPY(LayerTilingData); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace cc | 100 } // namespace cc |
101 | 101 |
102 #endif // CC_RESOURCES_LAYER_TILING_DATA_H_ | 102 #endif // CC_RESOURCES_LAYER_TILING_DATA_H_ |
OLD | NEW |