| 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" |
| 11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
| 12 #include "base/containers/scoped_ptr_hash_map.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 14 #include "cc/base/region.h" | 15 #include "cc/base/region.h" |
| 15 #include "cc/base/scoped_ptr_hash_map.h" | |
| 16 #include "cc/base/tiling_data.h" | 16 #include "cc/base/tiling_data.h" |
| 17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
| 18 | 18 |
| 19 namespace cc { | 19 namespace cc { |
| 20 | 20 |
| 21 class CC_EXPORT LayerTilingData { | 21 class CC_EXPORT LayerTilingData { |
| 22 public: | 22 public: |
| 23 enum BorderTexelOption { | 23 enum BorderTexelOption { |
| 24 HAS_BORDER_TEXELS, | 24 HAS_BORDER_TEXELS, |
| 25 NO_BORDER_TEXELS | 25 NO_BORDER_TEXELS |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 gfx::Rect opaque_rect() const { return opaque_rect_; } | 66 gfx::Rect opaque_rect() const { return opaque_rect_; } |
| 67 void set_opaque_rect(gfx::Rect opaque_rect) { opaque_rect_ = opaque_rect; } | 67 void set_opaque_rect(gfx::Rect opaque_rect) { opaque_rect_ = opaque_rect; } |
| 68 private: | 68 private: |
| 69 int i_; | 69 int i_; |
| 70 int j_; | 70 int j_; |
| 71 gfx::Rect opaque_rect_; | 71 gfx::Rect opaque_rect_; |
| 72 DISALLOW_COPY_AND_ASSIGN(Tile); | 72 DISALLOW_COPY_AND_ASSIGN(Tile); |
| 73 }; | 73 }; |
| 74 typedef std::pair<int, int> TileMapKey; | 74 typedef std::pair<int, int> TileMapKey; |
| 75 typedef ScopedPtrHashMap<TileMapKey, Tile> TileMap; | 75 typedef base::ScopedPtrHashMap<TileMapKey, Tile> TileMap; |
| 76 | 76 |
| 77 void AddTile(scoped_ptr<Tile> tile, int i, int j); | 77 void AddTile(scoped_ptr<Tile> tile, int i, int j); |
| 78 scoped_ptr<Tile> TakeTile(int i, int j); | 78 scoped_ptr<Tile> TakeTile(int i, int j); |
| 79 Tile* TileAt(int i, int j) const; | 79 Tile* TileAt(int i, int j) const; |
| 80 const TileMap& tiles() const { return tiles_; } | 80 const TileMap& tiles() const { return tiles_; } |
| 81 | 81 |
| 82 void SetBounds(gfx::Size size); | 82 void SetBounds(gfx::Size size); |
| 83 gfx::Size bounds() const { return tiling_data_.total_size(); } | 83 gfx::Size bounds() const { return tiling_data_.total_size(); } |
| 84 | 84 |
| 85 void ContentRectToTileIndices(gfx::Rect rect, | 85 void ContentRectToTileIndices(gfx::Rect rect, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 98 | 98 |
| 99 TileMap tiles_; | 99 TileMap tiles_; |
| 100 TilingData tiling_data_; | 100 TilingData tiling_data_; |
| 101 | 101 |
| 102 DISALLOW_COPY(LayerTilingData); | 102 DISALLOW_COPY(LayerTilingData); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 } // namespace cc | 105 } // namespace cc |
| 106 | 106 |
| 107 #endif // CC_RESOURCES_LAYER_TILING_DATA_H_ | 107 #endif // CC_RESOURCES_LAYER_TILING_DATA_H_ |
| OLD | NEW |