OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 tile->m_partialUpdate = true; | 448 tile->m_partialUpdate = true; |
449 else if (tileNeedsBufferedUpdate(tile) && layerTreeHost()) { | 449 else if (tileNeedsBufferedUpdate(tile) && layerTreeHost()) { |
450 layerTreeHost()->deleteTextureAfterCommit(tile->managedTexture()
->steal()); | 450 layerTreeHost()->deleteTextureAfterCommit(tile->managedTexture()
->steal()); |
451 // Sets the dirty rect to a full-sized tile with border texels. | 451 // Sets the dirty rect to a full-sized tile with border texels. |
452 tile->m_dirtyRect = m_tiler->tileRect(tile); | 452 tile->m_dirtyRect = m_tiler->tileRect(tile); |
453 } | 453 } |
454 | 454 |
455 if (!tile->managedTexture()->reserve(m_tiler->tileSize(), m_textureF
ormat)) { | 455 if (!tile->managedTexture()->reserve(m_tiler->tileSize(), m_textureF
ormat)) { |
456 m_skipsIdlePaint = true; | 456 m_skipsIdlePaint = true; |
457 if (!idle) { | 457 if (!idle) { |
458 // If the background covers the viewport, always draw this | 458 m_skipsDraw = true; |
459 // layer so that checkerboarded tiles will still draw. | |
460 if (!backgroundCoversViewport()) | |
461 m_skipsDraw = true; | |
462 m_tiler->reset(); | 459 m_tiler->reset(); |
463 m_paintRect = IntRect(); | 460 m_paintRect = IntRect(); |
464 m_requestedUpdateTilesRect = IntRect(); | 461 m_requestedUpdateTilesRect = IntRect(); |
465 } | 462 } |
466 return; | 463 return; |
467 } | 464 } |
468 | 465 |
469 dirtyLayerRect.unite(tile->m_dirtyRect); | 466 dirtyLayerRect.unite(tile->m_dirtyRect); |
470 } | 467 } |
471 } | 468 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 if (!tile->managedTexture()->reserve(m_tiler->tileSize(), m_textureF
ormat)) | 572 if (!tile->managedTexture()->reserve(m_tiler->tileSize(), m_textureF
ormat)) |
576 return; | 573 return; |
577 } | 574 } |
578 } | 575 } |
579 } | 576 } |
580 | 577 |
581 Region TiledLayerChromium::visibleContentOpaqueRegion() const | 578 Region TiledLayerChromium::visibleContentOpaqueRegion() const |
582 { | 579 { |
583 if (m_skipsDraw) | 580 if (m_skipsDraw) |
584 return Region(); | 581 return Region(); |
585 | 582 if (opaque()) |
| 583 return visibleLayerRect(); |
586 return m_tiler->opaqueRegionInLayerRect(visibleLayerRect()); | 584 return m_tiler->opaqueRegionInLayerRect(visibleLayerRect()); |
587 } | 585 } |
588 | 586 |
589 void TiledLayerChromium::resetUpdateState() | 587 void TiledLayerChromium::resetUpdateState() |
590 { | 588 { |
591 // Reset m_updateRect for all tiles. | 589 // Reset m_updateRect for all tiles. |
592 CCLayerTilingData::TileMap::const_iterator end = m_tiler->tiles().end(); | 590 CCLayerTilingData::TileMap::const_iterator end = m_tiler->tiles().end(); |
593 for (CCLayerTilingData::TileMap::const_iterator iter = m_tiler->tiles().begi
n(); iter != end; ++iter) { | 591 for (CCLayerTilingData::TileMap::const_iterator iter = m_tiler->tiles().begi
n(); iter != end; ++iter) { |
594 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second.get()); | 592 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second.get()); |
595 tile->m_updateRect = IntRect(); | 593 tile->m_updateRect = IntRect(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // - only reserve idle paint tiles up to a memory reclaim threshold and | 740 // - only reserve idle paint tiles up to a memory reclaim threshold and |
743 // - insure we play nicely with other layers | 741 // - insure we play nicely with other layers |
744 prepaintRect.inflateX(m_tiler->tileSize().width()); | 742 prepaintRect.inflateX(m_tiler->tileSize().width()); |
745 prepaintRect.inflateY(m_tiler->tileSize().height()); | 743 prepaintRect.inflateY(m_tiler->tileSize().height()); |
746 prepaintRect.intersect(IntRect(IntPoint::zero(), contentBounds())); | 744 prepaintRect.intersect(IntRect(IntPoint::zero(), contentBounds())); |
747 return prepaintRect; | 745 return prepaintRect; |
748 } | 746 } |
749 | 747 |
750 } | 748 } |
751 #endif // USE(ACCELERATED_COMPOSITING) | 749 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |