| 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 CCLayerTilingData_h | 6 #ifndef CCLayerTilingData_h |
| 7 #define CCLayerTilingData_h | 7 #define CCLayerTilingData_h |
| 8 | 8 |
| 9 #if USE(ACCELERATED_COMPOSITING) | 9 #if USE(ACCELERATED_COMPOSITING) |
| 10 | 10 |
| 11 #include "IntRect.h" | 11 #include "IntRect.h" |
| 12 #include "Region.h" | 12 #include "Region.h" |
| 13 #include "TilingData.h" | 13 #include "TilingData.h" |
| 14 #include <wtf/HashMap.h> | 14 #include <wtf/HashMap.h> |
| 15 #include <wtf/HashTraits.h> | 15 #include <wtf/HashTraits.h> |
| 16 #include <wtf/PassOwnPtr.h> | 16 #include <wtf/PassOwnPtr.h> |
| 17 | 17 |
| 18 namespace WebCore { | 18 namespace cc { |
| 19 | 19 |
| 20 class CCLayerTilingData { | 20 class CCLayerTilingData { |
| 21 public: | 21 public: |
| 22 enum BorderTexelOption { HasBorderTexels, NoBorderTexels }; | 22 enum BorderTexelOption { HasBorderTexels, NoBorderTexels }; |
| 23 | 23 |
| 24 static PassOwnPtr<CCLayerTilingData> create(const IntSize& tileSize, BorderT
exelOption); | 24 static PassOwnPtr<CCLayerTilingData> create(const IntSize& tileSize, BorderT
exelOption); |
| 25 | 25 |
| 26 bool hasEmptyBounds() const { return m_tilingData.hasEmptyBounds(); } | 26 bool hasEmptyBounds() const { return m_tilingData.hasEmptyBounds(); } |
| 27 int numTilesX() const { return m_tilingData.numTilesX(); } | 27 int numTilesX() const { return m_tilingData.numTilesX(); } |
| 28 int numTilesY() const { return m_tilingData.numTilesY(); } | 28 int numTilesY() const { return m_tilingData.numTilesY(); } |
| 29 IntRect tileBounds(int i, int j) const { return m_tilingData.tileBounds(i, j
); } | 29 IntRect tileBounds(int i, int j) const { return m_tilingData.tileBounds(i, j
); } |
| 30 IntPoint textureOffset(int xIndex, int yIndex) const { return m_tilingData.t
extureOffset(xIndex, yIndex); } | 30 IntPoint textureOffset(int xIndex, int yIndex) const { return m_tilingData.t
extureOffset(xIndex, yIndex); } |
| 31 | 31 |
| 32 // Change the tile size. This may invalidate all the existing tiles. | 32 // Change the tile size. This may invalidate all the existing tiles. |
| 33 void setTileSize(const IntSize&); | 33 void setTileSize(const IntSize&); |
| 34 const IntSize& tileSize() const; | 34 IntSize tileSize() const; |
| 35 // Change the border texel setting. This may invalidate all existing tiles. | 35 // Change the border texel setting. This may invalidate all existing tiles. |
| 36 void setBorderTexelOption(BorderTexelOption); | 36 void setBorderTexelOption(BorderTexelOption); |
| 37 bool hasBorderTexels() const { return m_tilingData.borderTexels(); } | 37 bool hasBorderTexels() const { return m_tilingData.borderTexels(); } |
| 38 | 38 |
| 39 bool isEmpty() const { return hasEmptyBounds() || !tiles().size(); } | 39 bool isEmpty() const { return hasEmptyBounds() || !tiles().size(); } |
| 40 | 40 |
| 41 const CCLayerTilingData& operator=(const CCLayerTilingData&); | 41 const CCLayerTilingData& operator=(const CCLayerTilingData&); |
| 42 | 42 |
| 43 class Tile { | 43 class Tile { |
| 44 WTF_MAKE_NONCOPYABLE(Tile); | 44 WTF_MAKE_NONCOPYABLE(Tile); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 TileMap m_tiles; | 90 TileMap m_tiles; |
| 91 TilingData m_tilingData; | 91 TilingData m_tilingData; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } | 94 } |
| 95 | 95 |
| 96 #endif // USE(ACCELERATED_COMPOSITING) | 96 #endif // USE(ACCELERATED_COMPOSITING) |
| 97 | 97 |
| 98 #endif | 98 #endif |
| OLD | NEW |