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.cc | |
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.cc')
-rw-r--r-- | cc/layer_tiling_data.cc | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/cc/layer_tiling_data.cc b/cc/layer_tiling_data.cc index 10086da..ccfa205 100644 --- a/cc/layer_tiling_data.cc +++ b/cc/layer_tiling_data.cc @@ -7,8 +7,6 @@ #include "cc/layer_tiling_data.h" -#include "IntRect.h" -#include "IntSize.h" #include "base/logging.h" using namespace std; @@ -21,7 +19,7 @@ scoped_ptr<LayerTilingData> LayerTilingData::create(const gfx::Size& tileSize, B } LayerTilingData::LayerTilingData(const gfx::Size& tileSize, BorderTexelOption border) - : m_tilingData(cc::IntSize(tileSize), cc::IntSize(), border == HasBorderTexels) + : m_tilingData(tileSize, gfx::Size(), border == HasBorderTexels) { setTileSize(tileSize); } @@ -37,12 +35,12 @@ void LayerTilingData::setTileSize(const gfx::Size& size) reset(); - m_tilingData.setMaxTextureSize(cc::IntSize(size)); + m_tilingData.SetMaxTextureSize(size); } gfx::Size LayerTilingData::tileSize() const { - return cc::IntSize(m_tilingData.maxTextureSize()); + return m_tilingData.max_texture_size(); } void LayerTilingData::setBorderTexelOption(BorderTexelOption borderTexelOption) @@ -52,7 +50,7 @@ void LayerTilingData::setBorderTexelOption(BorderTexelOption borderTexelOption) return; reset(); - m_tilingData.setHasBorderTexels(borderTexels); + m_tilingData.SetHasBorderTexels(borderTexels); } const LayerTilingData& LayerTilingData::operator=(const LayerTilingData& tiler) @@ -91,15 +89,15 @@ void LayerTilingData::contentRectToTileIndices(const gfx::Rect& contentRect, int // since the normal use of this function is to enumerate some tiles. DCHECK(!contentRect.IsEmpty()); - left = m_tilingData.tileXIndexFromSrcCoord(contentRect.x()); - top = m_tilingData.tileYIndexFromSrcCoord(contentRect.y()); - right = m_tilingData.tileXIndexFromSrcCoord(contentRect.right() - 1); - bottom = m_tilingData.tileYIndexFromSrcCoord(contentRect.bottom() - 1); + left = m_tilingData.TileXIndexFromSrcCoord(contentRect.x()); + top = m_tilingData.TileYIndexFromSrcCoord(contentRect.y()); + right = m_tilingData.TileXIndexFromSrcCoord(contentRect.right() - 1); + bottom = m_tilingData.TileYIndexFromSrcCoord(contentRect.bottom() - 1); } gfx::Rect LayerTilingData::tileRect(const Tile* tile) const { - gfx::Rect tileRect = cc::IntRect(m_tilingData.tileBoundsWithBorder(tile->i(), tile->j())); + gfx::Rect tileRect = m_tilingData.TileBoundsWithBorder(tile->i(), tile->j()); tileRect.set_size(tileSize()); return tileRect; } @@ -127,7 +125,7 @@ Region LayerTilingData::opaqueRegionInContentRect(const gfx::Rect& contentRect) void LayerTilingData::setBounds(const gfx::Size& size) { - m_tilingData.setTotalSize(cc::IntSize(size)); + m_tilingData.SetTotalSize(size); if (size.IsEmpty()) { m_tiles.clear(); return; @@ -147,7 +145,7 @@ void LayerTilingData::setBounds(const gfx::Size& size) gfx::Size LayerTilingData::bounds() const { - return cc::IntSize(m_tilingData.totalSize()); + return m_tilingData.total_size(); } } // namespace cc |