| 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" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 if (size.isEmpty()) { | 125 if (size.isEmpty()) { |
| 126 m_tiles.clear(); | 126 m_tiles.clear(); |
| 127 return; | 127 return; |
| 128 } | 128 } |
| 129 | 129 |
| 130 // Any tiles completely outside our new bounds are invalid and should be dro
pped. | 130 // Any tiles completely outside our new bounds are invalid and should be dro
pped. |
| 131 int left, top, right, bottom; | 131 int left, top, right, bottom; |
| 132 contentRectToTileIndices(IntRect(IntPoint(), size), left, top, right, bottom
); | 132 contentRectToTileIndices(IntRect(IntPoint(), size), left, top, right, bottom
); |
| 133 Vector<TileMapKey> invalidTileKeys; | 133 Vector<TileMapKey> invalidTileKeys; |
| 134 for (TileMap::const_iterator it = m_tiles.begin(); it != m_tiles.end(); ++it
) { | 134 for (TileMap::const_iterator it = m_tiles.begin(); it != m_tiles.end(); ++it
) { |
| 135 #if WTF_NEW_HASHMAP_ITERATORS_INTERFACE |
| 136 if (it->key.first > right || it->key.second > bottom) |
| 137 invalidTileKeys.append(it->key); |
| 138 #else |
| 135 if (it->first.first > right || it->first.second > bottom) | 139 if (it->first.first > right || it->first.second > bottom) |
| 136 invalidTileKeys.append(it->first); | 140 invalidTileKeys.append(it->first); |
| 141 #endif |
| 137 } | 142 } |
| 138 for (size_t i = 0; i < invalidTileKeys.size(); ++i) | 143 for (size_t i = 0; i < invalidTileKeys.size(); ++i) |
| 139 m_tiles.remove(invalidTileKeys[i]); | 144 m_tiles.remove(invalidTileKeys[i]); |
| 140 } | 145 } |
| 141 | 146 |
| 142 IntSize CCLayerTilingData::bounds() const | 147 IntSize CCLayerTilingData::bounds() const |
| 143 { | 148 { |
| 144 return m_tilingData.totalSize(); | 149 return m_tilingData.totalSize(); |
| 145 } | 150 } |
| 146 | 151 |
| 147 } // namespace cc | 152 } // namespace cc |
| 148 | 153 |
| 149 #endif // USE(ACCELERATED_COMPOSITING) | 154 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |