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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 423 |
424 void CompositedLayerMapping::updateCompositingReasons() | 424 void CompositedLayerMapping::updateCompositingReasons() |
425 { | 425 { |
426 // All other layers owned by this mapping will have the same compositing rea
son | 426 // All other layers owned by this mapping will have the same compositing rea
son |
427 // for their lifetime, so they are initialized only when created. | 427 // for their lifetime, so they are initialized only when created. |
428 m_graphicsLayer->setCompositingReasons(m_owningLayer.compositingReasons()); | 428 m_graphicsLayer->setCompositingReasons(m_owningLayer.compositingReasons()); |
429 } | 429 } |
430 | 430 |
431 void CompositedLayerMapping::updateAfterLayout(bool needsFullRepaint, bool isUpd
ateRoot) | 431 void CompositedLayerMapping::updateAfterLayout(bool needsFullRepaint, bool isUpd
ateRoot) |
432 { | 432 { |
433 RenderLayerCompositor* layerCompositor = compositor(); | |
434 if (!layerCompositor->compositingLayersNeedRebuild()) { | |
435 // Calling updateGraphicsLayerGeometry() here gives incorrect results, b
ecause the | |
436 // position of this layer's GraphicsLayer depends on the position of our
compositing | |
437 // ancestor's GraphicsLayer. That cannot be determined until all the des
cendant | |
438 // RenderLayers of that ancestor have been processed via updateLayerPosi
tions(). | |
439 // | |
440 // The solution is to update compositing children of this layer here, | |
441 // via updateCompositingChildrenGeometry(). | |
442 updateCompositedBounds(GraphicsLayerUpdater::ForceUpdate); | |
443 layerCompositor->updateCompositingDescendantGeometry(m_owningLayer.stack
ingNode(), &m_owningLayer); | |
444 | |
445 if (isUpdateRoot) { | |
446 updateGraphicsLayerGeometry(GraphicsLayerUpdater::ForceUpdate); | |
447 layerCompositor->updateRootLayerPosition(); | |
448 RenderLayerStackingNode* stackingContainer = m_owningLayer.stackingN
ode()->enclosingStackingContainerNode(); | |
449 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont
ainer && (stackingContainer != m_owningLayer.stackingNode())) | |
450 layerCompositor->updateCompositingDescendantGeometry(stackingCon
tainer, stackingContainer->layer()); | |
451 } | |
452 } | |
453 | |
454 if (needsFullRepaint && !paintsIntoCompositedAncestor()) | 433 if (needsFullRepaint && !paintsIntoCompositedAncestor()) |
455 setContentsNeedDisplay(); | 434 setContentsNeedDisplay(); |
456 } | 435 } |
457 | 436 |
458 bool CompositedLayerMapping::updateGraphicsLayerConfiguration(GraphicsLayerUpdat
er::UpdateType updateType) | 437 bool CompositedLayerMapping::updateGraphicsLayerConfiguration(GraphicsLayerUpdat
er::UpdateType updateType) |
459 { | 438 { |
460 if (!shouldUpdateGraphicsLayer(updateType)) | 439 if (!shouldUpdateGraphicsLayer(updateType)) |
461 return false; | 440 return false; |
462 | 441 |
463 RenderLayerCompositor* compositor = this->compositor(); | 442 RenderLayerCompositor* compositor = this->compositor(); |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2158 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2180 name = "Scrolling Contents Layer"; | 2159 name = "Scrolling Contents Layer"; |
2181 } else { | 2160 } else { |
2182 ASSERT_NOT_REACHED(); | 2161 ASSERT_NOT_REACHED(); |
2183 } | 2162 } |
2184 | 2163 |
2185 return name; | 2164 return name; |
2186 } | 2165 } |
2187 | 2166 |
2188 } // namespace WebCore | 2167 } // namespace WebCore |
OLD | NEW |