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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 } | 421 } |
422 } | 422 } |
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(UpdateAfterLayoutFlags flags) | 431 void CompositedLayerMapping::updateAfterLayout(bool needsFullRepaint, bool isUpd
ateRoot) |
432 { | 432 { |
433 RenderLayerCompositor* layerCompositor = compositor(); | 433 RenderLayerCompositor* layerCompositor = compositor(); |
434 if (!layerCompositor->compositingLayersNeedRebuild()) { | 434 if (!layerCompositor->compositingLayersNeedRebuild()) { |
435 // Calling updateGraphicsLayerGeometry() here gives incorrect results, b
ecause the | 435 // Calling updateGraphicsLayerGeometry() here gives incorrect results, b
ecause the |
436 // position of this layer's GraphicsLayer depends on the position of our
compositing | 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 | 437 // ancestor's GraphicsLayer. That cannot be determined until all the des
cendant |
438 // RenderLayers of that ancestor have been processed via updateLayerPosi
tions(). | 438 // RenderLayers of that ancestor have been processed via updateLayerPosi
tions(). |
439 // | 439 // |
440 // The solution is to update compositing children of this layer here, | 440 // The solution is to update compositing children of this layer here, |
441 // via updateCompositingChildrenGeometry(). | 441 // via updateCompositingChildrenGeometry(). |
442 updateCompositedBounds(GraphicsLayerUpdater::ForceUpdate); | 442 updateCompositedBounds(GraphicsLayerUpdater::ForceUpdate); |
443 layerCompositor->updateCompositingDescendantGeometry(m_owningLayer.stack
ingNode(), &m_owningLayer, flags & CompositingChildrenOnly); | 443 layerCompositor->updateCompositingDescendantGeometry(m_owningLayer.stack
ingNode(), &m_owningLayer); |
444 | 444 |
445 if (flags & IsUpdateRoot) { | 445 if (isUpdateRoot) { |
446 updateGraphicsLayerGeometry(GraphicsLayerUpdater::ForceUpdate); | 446 updateGraphicsLayerGeometry(GraphicsLayerUpdater::ForceUpdate); |
447 layerCompositor->updateRootLayerPosition(); | 447 layerCompositor->updateRootLayerPosition(); |
448 RenderLayerStackingNode* stackingContainer = m_owningLayer.stackingN
ode()->enclosingStackingContainerNode(); | 448 RenderLayerStackingNode* stackingContainer = m_owningLayer.stackingN
ode()->enclosingStackingContainerNode(); |
449 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont
ainer && (stackingContainer != m_owningLayer.stackingNode())) | 449 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont
ainer && (stackingContainer != m_owningLayer.stackingNode())) |
450 layerCompositor->updateCompositingDescendantGeometry(stackingCon
tainer, stackingContainer->layer(), flags & CompositingChildrenOnly); | 450 layerCompositor->updateCompositingDescendantGeometry(stackingCon
tainer, stackingContainer->layer()); |
451 } | 451 } |
452 } | 452 } |
453 | 453 |
454 if (flags & NeedsFullRepaint && !paintsIntoCompositedAncestor()) | 454 if (needsFullRepaint && !paintsIntoCompositedAncestor()) |
455 setContentsNeedDisplay(); | 455 setContentsNeedDisplay(); |
456 } | 456 } |
457 | 457 |
458 bool CompositedLayerMapping::updateGraphicsLayerConfiguration(GraphicsLayerUpdat
er::UpdateType updateType) | 458 bool CompositedLayerMapping::updateGraphicsLayerConfiguration(GraphicsLayerUpdat
er::UpdateType updateType) |
459 { | 459 { |
460 if (!shouldUpdateGraphicsLayer(updateType)) | 460 if (!shouldUpdateGraphicsLayer(updateType)) |
461 return false; | 461 return false; |
462 | 462 |
463 RenderLayerCompositor* compositor = this->compositor(); | 463 RenderLayerCompositor* compositor = this->compositor(); |
464 RenderObject* renderer = this->renderer(); | 464 RenderObject* renderer = this->renderer(); |
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2179 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2180 name = "Scrolling Contents Layer"; | 2180 name = "Scrolling Contents Layer"; |
2181 } else { | 2181 } else { |
2182 ASSERT_NOT_REACHED(); | 2182 ASSERT_NOT_REACHED(); |
2183 } | 2183 } |
2184 | 2184 |
2185 return name; | 2185 return name; |
2186 } | 2186 } |
2187 | 2187 |
2188 } // namespace WebCore | 2188 } // namespace WebCore |
OLD | NEW |