| 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 #include "config.h" | 6 #include "config.h" |
| 7 | 7 |
| 8 #if USE(ACCELERATED_COMPOSITING) | 8 #if USE(ACCELERATED_COMPOSITING) |
| 9 | 9 |
| 10 #include "CCLayerTilingData.h" | 10 #include "CCLayerTilingData.h" |
| 11 | 11 |
| 12 using namespace std; | 12 using namespace std; |
| 13 | 13 |
| 14 namespace WebCore { | 14 namespace cc { |
| 15 | 15 |
| 16 PassOwnPtr<CCLayerTilingData> CCLayerTilingData::create(const IntSize& tileSize,
BorderTexelOption border) | 16 PassOwnPtr<CCLayerTilingData> CCLayerTilingData::create(const IntSize& tileSize,
BorderTexelOption border) |
| 17 { | 17 { |
| 18 return adoptPtr(new CCLayerTilingData(tileSize, border)); | 18 return adoptPtr(new CCLayerTilingData(tileSize, border)); |
| 19 } | 19 } |
| 20 | 20 |
| 21 CCLayerTilingData::CCLayerTilingData(const IntSize& tileSize, BorderTexelOption
border) | 21 CCLayerTilingData::CCLayerTilingData(const IntSize& tileSize, BorderTexelOption
border) |
| 22 : m_tilingData(tileSize, IntSize(), border == HasBorderTexels) | 22 : m_tilingData(tileSize, IntSize(), border == HasBorderTexels) |
| 23 { | 23 { |
| 24 setTileSize(tileSize); | 24 setTileSize(tileSize); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void CCLayerTilingData::setTileSize(const IntSize& size) | 27 void CCLayerTilingData::setTileSize(const IntSize& size) |
| 28 { | 28 { |
| 29 if (tileSize() == size) | 29 if (tileSize() == size) |
| 30 return; | 30 return; |
| 31 | 31 |
| 32 reset(); | 32 reset(); |
| 33 | 33 |
| 34 m_tilingData.setMaxTextureSize(size); | 34 m_tilingData.setMaxTextureSize(size); |
| 35 } | 35 } |
| 36 | 36 |
| 37 const IntSize& CCLayerTilingData::tileSize() const | 37 IntSize CCLayerTilingData::tileSize() const |
| 38 { | 38 { |
| 39 return m_tilingData.maxTextureSize(); | 39 return m_tilingData.maxTextureSize(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void CCLayerTilingData::setBorderTexelOption(BorderTexelOption borderTexelOption
) | 42 void CCLayerTilingData::setBorderTexelOption(BorderTexelOption borderTexelOption
) |
| 43 { | 43 { |
| 44 bool borderTexels = borderTexelOption == HasBorderTexels; | 44 bool borderTexels = borderTexelOption == HasBorderTexels; |
| 45 if (hasBorderTexels() == borderTexels) | 45 if (hasBorderTexels() == borderTexels) |
| 46 return; | 46 return; |
| 47 | 47 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 137 } |
| 138 for (size_t i = 0; i < invalidTileKeys.size(); ++i) | 138 for (size_t i = 0; i < invalidTileKeys.size(); ++i) |
| 139 m_tiles.remove(invalidTileKeys[i]); | 139 m_tiles.remove(invalidTileKeys[i]); |
| 140 } | 140 } |
| 141 | 141 |
| 142 IntSize CCLayerTilingData::bounds() const | 142 IntSize CCLayerTilingData::bounds() const |
| 143 { | 143 { |
| 144 return m_tilingData.totalSize(); | 144 return m_tilingData.totalSize(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace WebCore | 147 } // namespace cc |
| 148 | 148 |
| 149 #endif // USE(ACCELERATED_COMPOSITING) | 149 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |