diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-02 15:37:41 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-02 15:37:41 +0000 |
commit | 8a03518ab1cf9d715056674230bdb4e4662b4c90 (patch) | |
tree | 4e8cec7db90927d65c83f826b62c03b140f3fbb2 /cc/layer_tiling_data.h | |
parent | e5d477340a27793e23258c2a2ed08e3682d37205 (diff) | |
download | chromium_src-8a03518ab1cf9d715056674230bdb4e4662b4c90.zip chromium_src-8a03518ab1cf9d715056674230bdb4e4662b4c90.tar.gz chromium_src-8a03518ab1cf9d715056674230bdb4e4662b4c90.tar.bz2 |
Create cc::TilingData based on WebCore::TilingData.
This is a direct port of the TilingData class from the WebKit repo, found in:
Source/WebCore/platform/graphics/gpu/TilingData.h|cpp
Previous commits from non-google folks have been:
- ossy replacing the non-copyable macro (which is not present here).
- hyatt replacing right()/bottom() with maxX()/maxY() (we use right()/bottom() again here, with gfx::Rect instead of IntRect).
- mitz using ASSERT_UNUSED instead of ASSERT guarded on NDEBUG (we use DCHECK instead here).
Covered by existing tests; this replaces the use of WebCore::TilingData with the new cc::TilingData.
R=enne
BUG=147395
Review URL: https://codereview.chromium.org/11359030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_tiling_data.h')
-rw-r--r-- | cc/layer_tiling_data.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/cc/layer_tiling_data.h b/cc/layer_tiling_data.h index a464556..5f2e5ea 100644 --- a/cc/layer_tiling_data.h +++ b/cc/layer_tiling_data.h @@ -10,12 +10,11 @@ #include "base/memory/scoped_ptr.h" #include "cc/hash_pair.h" #include "cc/scoped_ptr_hash_map.h" +#include "cc/tiling_data.h" #include "ui/gfx/rect.h" #include "Region.h" -#include "TilingData.h" namespace cc { -class IntRect; class LayerTilingData { public: @@ -25,21 +24,18 @@ public: static scoped_ptr<LayerTilingData> create(const gfx::Size& tileSize, BorderTexelOption); - bool hasEmptyBounds() const { return m_tilingData.hasEmptyBounds(); } - int numTilesX() const { return m_tilingData.numTilesX(); } - int numTilesY() const { return m_tilingData.numTilesY(); } - gfx::Rect tileBounds(int i, int j) const { return cc::IntRect(m_tilingData.tileBounds(i, j)); } - gfx::Vector2d textureOffset(int xIndex, int yIndex) const { - cc::IntPoint p(m_tilingData.textureOffset(xIndex, yIndex)); - return gfx::Vector2d(p.x(), p.y()); - } + bool hasEmptyBounds() const { return m_tilingData.has_empty_bounds(); } + int numTilesX() const { return m_tilingData.num_tiles_x(); } + int numTilesY() const { return m_tilingData.num_tiles_y(); } + gfx::Rect tileBounds(int i, int j) const { return m_tilingData.TileBounds(i, j); } + gfx::Vector2d textureOffset(int xIndex, int yIndex) const { return m_tilingData.TextureOffset(xIndex, yIndex); } // Change the tile size. This may invalidate all the existing tiles. void setTileSize(const gfx::Size&); gfx::Size tileSize() const; // Change the border texel setting. This may invalidate all existing tiles. void setBorderTexelOption(BorderTexelOption); - bool hasBorderTexels() const { return m_tilingData.borderTexels(); } + bool hasBorderTexels() const { return m_tilingData.border_texels(); } bool isEmpty() const { return hasEmptyBounds() || !tiles().size(); } |