| 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 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
| 8 | 8 |
| 9 #include "TiledLayerChromium.h" | 9 #include "TiledLayerChromium.h" |
| 10 | 10 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 int j = iter->key.second; | 208 int j = iter->key.second; |
| 209 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->value.get()); | 209 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->value.get()); |
| 210 #else | 210 #else |
| 211 int i = iter->first.first; | 211 int i = iter->first.first; |
| 212 int j = iter->first.second; | 212 int j = iter->first.second; |
| 213 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second.get()); | 213 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second.get()); |
| 214 #endif | 214 #endif |
| 215 // FIXME: This should not ever be null. | 215 // FIXME: This should not ever be null. |
| 216 if (!tile) | 216 if (!tile) |
| 217 continue; | 217 continue; |
| 218 | |
| 219 tile->isInUseOnImpl = false; | 218 tile->isInUseOnImpl = false; |
| 220 | |
| 221 if (!tile->managedTexture()->haveBackingTexture()) { | 219 if (!tile->managedTexture()->haveBackingTexture()) { |
| 222 // Evicted tiles get deleted from both layers | |
| 223 invalidTiles.append(tile); | 220 invalidTiles.append(tile); |
| 224 continue; | 221 continue; |
| 225 } | 222 } |
| 226 | 223 if (!tile->validForFrame) |
| 227 if (!tile->validForFrame) { | |
| 228 // Invalidated tiles are set so they can get different debug colors. | |
| 229 tiledLayer->pushInvalidTile(i, j); | |
| 230 continue; | 224 continue; |
| 231 } | |
| 232 | 225 |
| 233 tiledLayer->pushTileProperties(i, j, tile->managedTexture()->resourceId(
), tile->opaqueRect()); | 226 tiledLayer->pushTileProperties(i, j, tile->managedTexture()->resourceId(
), tile->opaqueRect()); |
| 234 tile->isInUseOnImpl = true; | 227 tile->isInUseOnImpl = true; |
| 235 } | 228 } |
| 236 for (Vector<UpdatableTile*>::const_iterator iter = invalidTiles.begin(); ite
r != invalidTiles.end(); ++iter) | 229 for (Vector<UpdatableTile*>::const_iterator iter = invalidTiles.begin(); ite
r != invalidTiles.end(); ++iter) |
| 237 m_tiler->takeTile((*iter)->i(), (*iter)->j()); | 230 m_tiler->takeTile((*iter)->i(), (*iter)->j()); |
| 238 } | 231 } |
| 239 | 232 |
| 240 CCPrioritizedTextureManager* TiledLayerChromium::textureManager() const | 233 CCPrioritizedTextureManager* TiledLayerChromium::textureManager() const |
| 241 { | 234 { |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 prepaintRect.inflateX(m_tiler->tileSize().width()); | 802 prepaintRect.inflateX(m_tiler->tileSize().width()); |
| 810 prepaintRect.inflateY(m_tiler->tileSize().height() * 2); | 803 prepaintRect.inflateY(m_tiler->tileSize().height() * 2); |
| 811 IntRect contentRect(IntPoint::zero(), contentBounds()); | 804 IntRect contentRect(IntPoint::zero(), contentBounds()); |
| 812 prepaintRect.intersect(contentRect); | 805 prepaintRect.intersect(contentRect); |
| 813 | 806 |
| 814 return prepaintRect; | 807 return prepaintRect; |
| 815 } | 808 } |
| 816 | 809 |
| 817 } | 810 } |
| 818 #endif // USE(ACCELERATED_COMPOSITING) | 811 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |