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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1400 GraphicsLayer* hostingLayer = compositedLayerMapping->parentForSublayers(); | 1400 GraphicsLayer* hostingLayer = compositedLayerMapping->parentForSublayers(); |
1401 GraphicsLayer* rootLayer = innerCompositor->rootGraphicsLayer(); | 1401 GraphicsLayer* rootLayer = innerCompositor->rootGraphicsLayer(); |
1402 if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != r
ootLayer) { | 1402 if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != r
ootLayer) { |
1403 hostingLayer->removeAllChildren(); | 1403 hostingLayer->removeAllChildren(); |
1404 hostingLayer->addChild(rootLayer); | 1404 hostingLayer->addChild(rootLayer); |
1405 } | 1405 } |
1406 return true; | 1406 return true; |
1407 } | 1407 } |
1408 | 1408 |
1409 // Recurs down the RenderLayer tree until its finds the compositing descendants
of compositingAncestor and updates their geometry. | 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, bool compositedChildrenOnly) | 1410 void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayerStack
ingNode* compositingAncestor, RenderLayer* layer) |
1411 { | 1411 { |
1412 if (layer->stackingNode() != compositingAncestor) { | 1412 if (layer->stackingNode() != compositingAncestor) { |
1413 if (layer->hasCompositedLayerMapping()) { | 1413 if (layer->hasCompositedLayerMapping()) { |
1414 CompositedLayerMappingPtr compositedLayerMapping = layer->composited
LayerMapping(); | 1414 CompositedLayerMappingPtr compositedLayerMapping = layer->composited
LayerMapping(); |
1415 compositedLayerMapping->updateCompositedBounds(GraphicsLayerUpdater:
:ForceUpdate); | 1415 compositedLayerMapping->updateCompositedBounds(GraphicsLayerUpdater:
:ForceUpdate); |
1416 | 1416 |
1417 if (layer->reflectionInfo()) { | 1417 if (layer->reflectionInfo()) { |
1418 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflecti
onLayer(); | 1418 RenderLayer* reflectionLayer = layer->reflectionInfo()->reflecti
onLayer(); |
1419 if (reflectionLayer->hasCompositedLayerMapping()) | 1419 if (reflectionLayer->hasCompositedLayerMapping()) |
1420 reflectionLayer->compositedLayerMapping()->updateCompositedB
ounds(GraphicsLayerUpdater::ForceUpdate); | 1420 reflectionLayer->compositedLayerMapping()->updateCompositedB
ounds(GraphicsLayerUpdater::ForceUpdate); |
1421 } | 1421 } |
1422 | 1422 |
1423 compositedLayerMapping->updateGraphicsLayerGeometry(GraphicsLayerUpd
ater::ForceUpdate); | 1423 compositedLayerMapping->updateGraphicsLayerGeometry(GraphicsLayerUpd
ater::ForceUpdate); |
1424 if (compositedChildrenOnly) | 1424 return; |
1425 return; | |
1426 } | 1425 } |
1427 } | 1426 } |
1428 | 1427 |
1429 if (layer->reflectionInfo()) | 1428 if (layer->reflectionInfo()) |
1430 updateCompositingDescendantGeometry(compositingAncestor, layer->reflecti
onInfo()->reflectionLayer(), compositedChildrenOnly); | 1429 updateCompositingDescendantGeometry(compositingAncestor, layer->reflecti
onInfo()->reflectionLayer()); |
1431 | 1430 |
1432 if (!layer->hasCompositingDescendant()) | 1431 if (!layer->hasCompositingDescendant()) |
1433 return; | 1432 return; |
1434 | 1433 |
1435 #if !ASSERT_DISABLED | 1434 #if !ASSERT_DISABLED |
1436 LayerListMutationDetector mutationChecker(layer->stackingNode()); | 1435 LayerListMutationDetector mutationChecker(layer->stackingNode()); |
1437 #endif | 1436 #endif |
1438 | 1437 |
1439 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), AllChildren
); | 1438 RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), AllChildren
); |
1440 while (RenderLayerStackingNode* curNode = iterator.next()) | 1439 while (RenderLayerStackingNode* curNode = iterator.next()) |
1441 updateCompositingDescendantGeometry(compositingAncestor, curNode->layer(
), compositedChildrenOnly); | 1440 updateCompositingDescendantGeometry(compositingAncestor, curNode->layer(
)); |
1442 } | 1441 } |
1443 | 1442 |
1444 | |
1445 void RenderLayerCompositor::repaintCompositedLayers() | 1443 void RenderLayerCompositor::repaintCompositedLayers() |
1446 { | 1444 { |
1447 recursiveRepaintLayer(rootRenderLayer()); | 1445 recursiveRepaintLayer(rootRenderLayer()); |
1448 } | 1446 } |
1449 | 1447 |
1450 void RenderLayerCompositor::recursiveRepaintLayer(RenderLayer* layer) | 1448 void RenderLayerCompositor::recursiveRepaintLayer(RenderLayer* layer) |
1451 { | 1449 { |
1452 // FIXME: This method does not work correctly with transforms. | 1450 // FIXME: This method does not work correctly with transforms. |
1453 if (layer->compositingState() == PaintsIntoOwnBacking) | 1451 if (layer->compositingState() == PaintsIntoOwnBacking) |
1454 layer->repainter().setBackingNeedsRepaint(); | 1452 layer->repainter().setBackingNeedsRepaint(); |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2144 } else if (graphicsLayer == m_scrollLayer.get()) { | 2142 } else if (graphicsLayer == m_scrollLayer.get()) { |
2145 name = "LocalFrame Scrolling Layer"; | 2143 name = "LocalFrame Scrolling Layer"; |
2146 } else { | 2144 } else { |
2147 ASSERT_NOT_REACHED(); | 2145 ASSERT_NOT_REACHED(); |
2148 } | 2146 } |
2149 | 2147 |
2150 return name; | 2148 return name; |
2151 } | 2149 } |
2152 | 2150 |
2153 } // namespace WebCore | 2151 } // namespace WebCore |
OLD | NEW |