| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 Apple 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 3433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3444 for (; layerIndex < m_squashedLayers.size(); ++layerIndex) { | 3444 for (; layerIndex < m_squashedLayers.size(); ++layerIndex) { |
| 3445 if (m_squashedLayers[layerIndex].paintLayer == layer) | 3445 if (m_squashedLayers[layerIndex].paintLayer == layer) |
| 3446 break; | 3446 break; |
| 3447 } | 3447 } |
| 3448 | 3448 |
| 3449 // Assert on incorrect mappings between layers and groups | 3449 // Assert on incorrect mappings between layers and groups |
| 3450 DCHECK_LT(layerIndex, m_squashedLayers.size()); | 3450 DCHECK_LT(layerIndex, m_squashedLayers.size()); |
| 3451 if (layerIndex == m_squashedLayers.size()) | 3451 if (layerIndex == m_squashedLayers.size()) |
| 3452 return; | 3452 return; |
| 3453 | 3453 |
| 3454 m_squashedLayers.remove(layerIndex); | 3454 m_squashedLayers.erase(layerIndex); |
| 3455 } | 3455 } |
| 3456 | 3456 |
| 3457 #if DCHECK_IS_ON() | 3457 #if DCHECK_IS_ON() |
| 3458 bool CompositedLayerMapping::verifyLayerInSquashingVector( | 3458 bool CompositedLayerMapping::verifyLayerInSquashingVector( |
| 3459 const PaintLayer* layer) { | 3459 const PaintLayer* layer) { |
| 3460 for (size_t layerIndex = 0; layerIndex < m_squashedLayers.size(); | 3460 for (size_t layerIndex = 0; layerIndex < m_squashedLayers.size(); |
| 3461 ++layerIndex) { | 3461 ++layerIndex) { |
| 3462 if (m_squashedLayers[layerIndex].paintLayer == layer) | 3462 if (m_squashedLayers[layerIndex].paintLayer == layer) |
| 3463 return true; | 3463 return true; |
| 3464 } | 3464 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 3475 // they might have been added already at an earlier index. Clear pointers on | 3475 // they might have been added already at an earlier index. Clear pointers on |
| 3476 // those that do not appear in the valid set before removing all the extra | 3476 // those that do not appear in the valid set before removing all the extra |
| 3477 // entries. | 3477 // entries. |
| 3478 for (size_t i = nextSquashedLayerIndex; i < m_squashedLayers.size(); ++i) { | 3478 for (size_t i = nextSquashedLayerIndex; i < m_squashedLayers.size(); ++i) { |
| 3479 if (invalidateLayerIfNoPrecedingEntry(i)) | 3479 if (invalidateLayerIfNoPrecedingEntry(i)) |
| 3480 m_squashedLayers[i].paintLayer->setGroupedMapping( | 3480 m_squashedLayers[i].paintLayer->setGroupedMapping( |
| 3481 nullptr, PaintLayer::DoNotInvalidateLayerAndRemoveFromMapping); | 3481 nullptr, PaintLayer::DoNotInvalidateLayerAndRemoveFromMapping); |
| 3482 layersNeedingPaintInvalidation.push_back(m_squashedLayers[i].paintLayer); | 3482 layersNeedingPaintInvalidation.push_back(m_squashedLayers[i].paintLayer); |
| 3483 } | 3483 } |
| 3484 | 3484 |
| 3485 m_squashedLayers.remove(nextSquashedLayerIndex, | 3485 m_squashedLayers.erase(nextSquashedLayerIndex, |
| 3486 m_squashedLayers.size() - nextSquashedLayerIndex); | 3486 m_squashedLayers.size() - nextSquashedLayerIndex); |
| 3487 } | 3487 } |
| 3488 } | 3488 } |
| 3489 | 3489 |
| 3490 String CompositedLayerMapping::debugName( | 3490 String CompositedLayerMapping::debugName( |
| 3491 const GraphicsLayer* graphicsLayer) const { | 3491 const GraphicsLayer* graphicsLayer) const { |
| 3492 String name; | 3492 String name; |
| 3493 if (graphicsLayer == m_graphicsLayer.get()) { | 3493 if (graphicsLayer == m_graphicsLayer.get()) { |
| 3494 name = m_owningLayer.debugName(); | 3494 name = m_owningLayer.debugName(); |
| 3495 } else if (graphicsLayer == m_squashingContainmentLayer.get()) { | 3495 } else if (graphicsLayer == m_squashingContainmentLayer.get()) { |
| 3496 name = "Squashing Containment Layer"; | 3496 name = "Squashing Containment Layer"; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3533 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { | 3533 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { |
| 3534 name = "Decoration Layer"; | 3534 name = "Decoration Layer"; |
| 3535 } else { | 3535 } else { |
| 3536 NOTREACHED(); | 3536 NOTREACHED(); |
| 3537 } | 3537 } |
| 3538 | 3538 |
| 3539 return name; | 3539 return name; |
| 3540 } | 3540 } |
| 3541 | 3541 |
| 3542 } // namespace blink | 3542 } // namespace blink |
| OLD | NEW |