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 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2295 break; | 2295 break; |
2296 | 2296 |
2297 if (layerIndex == m_squashedLayers.size()) | 2297 if (layerIndex == m_squashedLayers.size()) |
2298 return; | 2298 return; |
2299 | 2299 |
2300 m_squashedLayers.remove(layerIndex); | 2300 m_squashedLayers.remove(layerIndex); |
2301 } | 2301 } |
2302 | 2302 |
2303 void CompositedDeprecatedPaintLayerMapping::finishAccumulatingSquashingLayers(si
ze_t nextSquashedLayerIndex) | 2303 void CompositedDeprecatedPaintLayerMapping::finishAccumulatingSquashingLayers(si
ze_t nextSquashedLayerIndex) |
2304 { | 2304 { |
2305 // Any additional squashed Layers in the array no longer exist, and removing
invalidates the | |
2306 // squashingLayer contents. | |
2307 if (nextSquashedLayerIndex < m_squashedLayers.size()) { | 2305 if (nextSquashedLayerIndex < m_squashedLayers.size()) { |
2308 for (size_t i = m_squashedLayers.size(); i > nextSquashedLayerIndex; --i
) | 2306 // Any additional squashed Layers in the array no longer belong here, bu
t they might have been |
2309 m_squashedLayers[i-1].paintLayer->setGroupedMapping(nullptr, Depreca
tedPaintLayer::DoNotInvalidateLayerAndRemoveFromMapping); | 2307 // added already at an earlier index. Clear pointers on those that do no
t appear in the valid set |
| 2308 // before removing all the extra entries. |
| 2309 for (size_t i = nextSquashedLayerIndex; i < m_squashedLayers.size(); ++i
) { |
| 2310 DeprecatedPaintLayer* layerToRemove = m_squashedLayers[i].paintLayer
; |
| 2311 size_t previousIndex = 0; |
| 2312 for (; previousIndex < nextSquashedLayerIndex; ++previousIndex) { |
| 2313 if (m_squashedLayers[previousIndex].paintLayer == layerToRemove) |
| 2314 break; |
| 2315 } |
| 2316 if (previousIndex == nextSquashedLayerIndex) |
| 2317 layerToRemove->setGroupedMapping(nullptr, DeprecatedPaintLayer::
DoNotInvalidateLayerAndRemoveFromMapping); |
| 2318 } |
2310 m_squashedLayers.remove(nextSquashedLayerIndex, m_squashedLayers.size()
- nextSquashedLayerIndex); | 2319 m_squashedLayers.remove(nextSquashedLayerIndex, m_squashedLayers.size()
- nextSquashedLayerIndex); |
2311 } | 2320 } |
2312 } | 2321 } |
2313 | 2322 |
2314 String CompositedDeprecatedPaintLayerMapping::debugName(const GraphicsLayer* gra
phicsLayer) | 2323 String CompositedDeprecatedPaintLayerMapping::debugName(const GraphicsLayer* gra
phicsLayer) |
2315 { | 2324 { |
2316 String name; | 2325 String name; |
2317 if (graphicsLayer == m_graphicsLayer.get()) { | 2326 if (graphicsLayer == m_graphicsLayer.get()) { |
2318 name = m_owningLayer.debugName(); | 2327 name = m_owningLayer.debugName(); |
2319 } else if (graphicsLayer == m_squashingContainmentLayer.get()) { | 2328 } else if (graphicsLayer == m_squashingContainmentLayer.get()) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2351 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2360 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
2352 name = "Scrolling Block Selection Layer"; | 2361 name = "Scrolling Block Selection Layer"; |
2353 } else { | 2362 } else { |
2354 ASSERT_NOT_REACHED(); | 2363 ASSERT_NOT_REACHED(); |
2355 } | 2364 } |
2356 | 2365 |
2357 return name; | 2366 return name; |
2358 } | 2367 } |
2359 | 2368 |
2360 } // namespace blink | 2369 } // namespace blink |
OLD | NEW |