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 | 5 |
6 #ifndef CC_LAYER_TILING_DATA_H_ | 6 #ifndef CC_LAYER_TILING_DATA_H_ |
7 #define CC_LAYER_TILING_DATA_H_ | 7 #define CC_LAYER_TILING_DATA_H_ |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 int numTilesX() const { return m_tilingData.num_tiles_x(); } | 29 int numTilesX() const { return m_tilingData.num_tiles_x(); } |
30 int numTilesY() const { return m_tilingData.num_tiles_y(); } | 30 int numTilesY() const { return m_tilingData.num_tiles_y(); } |
31 gfx::Rect tileBounds(int i, int j) const { return m_tilingData.TileBounds(i,
j); } | 31 gfx::Rect tileBounds(int i, int j) const { return m_tilingData.TileBounds(i,
j); } |
32 gfx::Vector2d textureOffset(int xIndex, int yIndex) const { return m_tilingD
ata.TextureOffset(xIndex, yIndex); } | 32 gfx::Vector2d textureOffset(int xIndex, int yIndex) const { return m_tilingD
ata.TextureOffset(xIndex, yIndex); } |
33 | 33 |
34 // Change the tile size. This may invalidate all the existing tiles. | 34 // Change the tile size. This may invalidate all the existing tiles. |
35 void setTileSize(const gfx::Size&); | 35 void setTileSize(const gfx::Size&); |
36 gfx::Size tileSize() const; | 36 gfx::Size tileSize() const; |
37 // Change the border texel setting. This may invalidate all existing tiles. | 37 // Change the border texel setting. This may invalidate all existing tiles. |
38 void setBorderTexelOption(BorderTexelOption); | 38 void setBorderTexelOption(BorderTexelOption); |
39 bool hasBorderTexels() const { return m_tilingData.border_texels(); } | 39 bool hasBorderTexels() const { return !!m_tilingData.border_texels(); } |
40 | 40 |
41 bool isEmpty() const { return hasEmptyBounds() || !tiles().size(); } | 41 bool isEmpty() const { return hasEmptyBounds() || !tiles().size(); } |
42 | 42 |
43 const LayerTilingData& operator=(const LayerTilingData&); | 43 const LayerTilingData& operator=(const LayerTilingData&); |
44 | 44 |
45 class Tile { | 45 class Tile { |
46 public: | 46 public: |
47 Tile() : m_i(-1), m_j(-1) { } | 47 Tile() : m_i(-1), m_j(-1) { } |
48 virtual ~Tile() { } | 48 virtual ~Tile() { } |
49 | 49 |
(...skipping 30 matching lines...) Expand all Loading... |
80 protected: | 80 protected: |
81 LayerTilingData(const gfx::Size& tileSize, BorderTexelOption); | 81 LayerTilingData(const gfx::Size& tileSize, BorderTexelOption); |
82 | 82 |
83 TileMap m_tiles; | 83 TileMap m_tiles; |
84 TilingData m_tilingData; | 84 TilingData m_tilingData; |
85 }; | 85 }; |
86 | 86 |
87 } | 87 } |
88 | 88 |
89 #endif // CC_LAYER_TILING_DATA_H_ | 89 #endif // CC_LAYER_TILING_DATA_H_ |
OLD | NEW |