OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 switch (updateType) { | 365 switch (updateType) { |
366 case CompositingUpdateNone: | 366 case CompositingUpdateNone: |
367 ASSERT_NOT_REACHED(); | 367 ASSERT_NOT_REACHED(); |
368 break; | 368 break; |
369 case CompositingUpdateAfterStyleChange: | 369 case CompositingUpdateAfterStyleChange: |
370 m_needsToRecomputeCompositingRequirements = true; | 370 m_needsToRecomputeCompositingRequirements = true; |
371 m_needsToUpdateLayerTreeGeometry = true; | 371 m_needsToUpdateLayerTreeGeometry = true; |
372 break; | 372 break; |
373 case CompositingUpdateAfterLayout: | 373 case CompositingUpdateAfterLayout: |
374 m_needsToRecomputeCompositingRequirements = true; | 374 m_needsToRecomputeCompositingRequirements = true; |
| 375 m_needsToUpdateLayerTreeGeometry = true; |
375 break; | 376 break; |
376 case CompositingUpdateOnScroll: | 377 case CompositingUpdateOnScroll: |
377 m_needsToRecomputeCompositingRequirements = true; // Overlap can change
with scrolling, so need to check for hierarchy updates. | 378 m_needsToRecomputeCompositingRequirements = true; // Overlap can change
with scrolling, so need to check for hierarchy updates. |
378 m_needsToUpdateLayerTreeGeometry = true; | 379 m_needsToUpdateLayerTreeGeometry = true; |
379 break; | 380 break; |
380 case CompositingUpdateOnCompositedScroll: | 381 case CompositingUpdateOnCompositedScroll: |
381 m_needsToUpdateLayerTreeGeometry = true; | 382 m_needsToUpdateLayerTreeGeometry = true; |
382 break; | 383 break; |
383 case CompositingUpdateAfterCanvasContextChange: | 384 case CompositingUpdateAfterCanvasContextChange: |
384 m_needsToUpdateLayerTreeGeometry = true; | 385 m_needsToUpdateLayerTreeGeometry = true; |
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 CompositedLayerMappingPtr compositedLayerMapping = layer->compositedLayerMap
ping(); | 1400 CompositedLayerMappingPtr compositedLayerMapping = layer->compositedLayerMap
ping(); |
1400 GraphicsLayer* hostingLayer = compositedLayerMapping->parentForSublayers(); | 1401 GraphicsLayer* hostingLayer = compositedLayerMapping->parentForSublayers(); |
1401 GraphicsLayer* rootLayer = innerCompositor->rootGraphicsLayer(); | 1402 GraphicsLayer* rootLayer = innerCompositor->rootGraphicsLayer(); |
1402 if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != r
ootLayer) { | 1403 if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != r
ootLayer) { |
1403 hostingLayer->removeAllChildren(); | 1404 hostingLayer->removeAllChildren(); |
1404 hostingLayer->addChild(rootLayer); | 1405 hostingLayer->addChild(rootLayer); |
1405 } | 1406 } |
1406 return true; | 1407 return true; |
1407 } | 1408 } |
1408 | 1409 |
1409 // Recurs down the RenderLayer tree until its finds the compositing descendants
of compositingAncestor and updates their geometry. | |
1410 void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayerStack
ingNode* compositingAncestor, RenderLayer* layer) | |
1411 { | |
1412 if (layer->stackingNode() != compositingAncestor) { | |
1413 if (layer->hasCompositedLayerMapping()) { | |
1414 CompositedLayerMappingPtr compositedLayerMapping = layer->composited
LayerMapping(); | |
1415 compositedLayerMapping->updateCompositedBounds(GraphicsLayerUpdater:
:ForceUpdate); | |
1416 | |
1417 if (layer->reflectionInfo()) { | |
1418 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflecti
onLayer(); | |
1419 if (reflectionLayer->hasCompositedLayerMapping()) | |
1420 reflectionLayer->compositedLayerMapping()->updateCompositedB
ounds(GraphicsLayerUpdater::ForceUpdate); | |
1421 } | |
1422 | |
1423 compositedLayerMapping->updateGraphicsLayerGeometry(GraphicsLayerUpd
ater::ForceUpdate); | |
1424 return; | |
1425 } | |
1426 } | |
1427 | |
1428 if (layer->reflectionInfo()) | |
1429 updateCompositingDescendantGeometry(compositingAncestor, layer->reflecti
onInfo()->reflectionLayer()); | |
1430 | |
1431 if (!layer->hasCompositingDescendant()) | |
1432 return; | |
1433 | |
1434 #if !ASSERT_DISABLED | |
1435 LayerListMutationDetector mutationChecker(layer->stackingNode()); | |
1436 #endif | |
1437 | |
1438 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), AllChildren
); | |
1439 while (RenderLayerStackingNode* curNode = iterator.next()) | |
1440 updateCompositingDescendantGeometry(compositingAncestor, curNode->layer(
)); | |
1441 } | |
1442 | |
1443 void RenderLayerCompositor::repaintCompositedLayers() | 1410 void RenderLayerCompositor::repaintCompositedLayers() |
1444 { | 1411 { |
1445 recursiveRepaintLayer(rootRenderLayer()); | 1412 recursiveRepaintLayer(rootRenderLayer()); |
1446 } | 1413 } |
1447 | 1414 |
1448 void RenderLayerCompositor::recursiveRepaintLayer(RenderLayer* layer) | 1415 void RenderLayerCompositor::recursiveRepaintLayer(RenderLayer* layer) |
1449 { | 1416 { |
1450 // FIXME: This method does not work correctly with transforms. | 1417 // FIXME: This method does not work correctly with transforms. |
1451 if (layer->compositingState() == PaintsIntoOwnBacking) | 1418 if (layer->compositingState() == PaintsIntoOwnBacking) |
1452 layer->repainter().setBackingNeedsRepaint(); | 1419 layer->repainter().setBackingNeedsRepaint(); |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2142 } else if (graphicsLayer == m_scrollLayer.get()) { | 2109 } else if (graphicsLayer == m_scrollLayer.get()) { |
2143 name = "LocalFrame Scrolling Layer"; | 2110 name = "LocalFrame Scrolling Layer"; |
2144 } else { | 2111 } else { |
2145 ASSERT_NOT_REACHED(); | 2112 ASSERT_NOT_REACHED(); |
2146 } | 2113 } |
2147 | 2114 |
2148 return name; | 2115 return name; |
2149 } | 2116 } |
2150 | 2117 |
2151 } // namespace WebCore | 2118 } // namespace WebCore |
OLD | NEW |