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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 // so don't clip these, either. | 343 // so don't clip these, either. |
344 if (!compositor()->clippedByAncestor(&m_owningLayer)) | 344 if (!compositor()->clippedByAncestor(&m_owningLayer)) |
345 return true; | 345 return true; |
346 | 346 |
347 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() != m_ownin
gLayer.ancestorScrollingLayer()) | 347 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() != m_ownin
gLayer.ancestorScrollingLayer()) |
348 return true; | 348 return true; |
349 | 349 |
350 return false; | 350 return false; |
351 } | 351 } |
352 | 352 |
353 void CompositedLayerMapping::updateCompositedBounds() | 353 void CompositedLayerMapping::updateCompositedBounds(GraphicsLayerUpdater::Update
Type updateType) |
354 { | 354 { |
| 355 if (!m_needToUpdateGeometry && updateType != GraphicsLayerUpdater::ForceUpda
te) |
| 356 return; |
| 357 |
355 // We need to know if we draw content in order to update our bounds (this ha
s an effect | 358 // We need to know if we draw content in order to update our bounds (this ha
s an effect |
356 // on whether or not descendands will paint into our backing). Update this v
alue now. | 359 // on whether or not descendands will paint into our backing). Update this v
alue now. |
357 updateDrawsContent(); | 360 updateDrawsContent(); |
358 | 361 |
359 LayoutRect layerBounds = compositor()->calculateCompositedBounds(&m_owningLa
yer, &m_owningLayer); | 362 LayoutRect layerBounds = compositor()->calculateCompositedBounds(&m_owningLa
yer, &m_owningLayer); |
360 | 363 |
361 // Clip to the size of the document or enclosing overflow-scroll layer. | 364 // Clip to the size of the document or enclosing overflow-scroll layer. |
362 // If this or an ancestor is transformed, we can't currently compute the cor
rect rect to intersect with. | 365 // If this or an ancestor is transformed, we can't currently compute the cor
rect rect to intersect with. |
363 // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet
exist. | 366 // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet
exist. |
364 if (shouldClipCompositedBounds()) { | 367 if (shouldClipCompositedBounds()) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 { | 421 { |
419 RenderLayerCompositor* layerCompositor = compositor(); | 422 RenderLayerCompositor* layerCompositor = compositor(); |
420 if (!layerCompositor->compositingLayersNeedRebuild()) { | 423 if (!layerCompositor->compositingLayersNeedRebuild()) { |
421 // Calling updateGraphicsLayerGeometry() here gives incorrect results, b
ecause the | 424 // Calling updateGraphicsLayerGeometry() here gives incorrect results, b
ecause the |
422 // position of this layer's GraphicsLayer depends on the position of our
compositing | 425 // position of this layer's GraphicsLayer depends on the position of our
compositing |
423 // ancestor's GraphicsLayer. That cannot be determined until all the des
cendant | 426 // ancestor's GraphicsLayer. That cannot be determined until all the des
cendant |
424 // RenderLayers of that ancestor have been processed via updateLayerPosi
tions(). | 427 // RenderLayers of that ancestor have been processed via updateLayerPosi
tions(). |
425 // | 428 // |
426 // The solution is to update compositing children of this layer here, | 429 // The solution is to update compositing children of this layer here, |
427 // via updateCompositingChildrenGeometry(). | 430 // via updateCompositingChildrenGeometry(). |
428 updateCompositedBounds(); | 431 updateCompositedBounds(GraphicsLayerUpdater::ForceUpdate); |
429 layerCompositor->updateCompositingDescendantGeometry(m_owningLayer.stack
ingNode(), &m_owningLayer, flags & CompositingChildrenOnly); | 432 layerCompositor->updateCompositingDescendantGeometry(m_owningLayer.stack
ingNode(), &m_owningLayer, flags & CompositingChildrenOnly); |
430 | 433 |
431 if (flags & IsUpdateRoot) { | 434 if (flags & IsUpdateRoot) { |
432 updateGraphicsLayerGeometry(GraphicsLayerUpdater::ForceUpdate); | 435 updateGraphicsLayerGeometry(GraphicsLayerUpdater::ForceUpdate); |
433 layerCompositor->updateRootLayerPosition(); | 436 layerCompositor->updateRootLayerPosition(); |
434 RenderLayerStackingNode* stackingContainer = m_owningLayer.stackingN
ode()->enclosingStackingContainerNode(); | 437 RenderLayerStackingNode* stackingContainer = m_owningLayer.stackingN
ode()->enclosingStackingContainerNode(); |
435 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont
ainer && (stackingContainer != m_owningLayer.stackingNode())) | 438 if (!layerCompositor->compositingLayersNeedRebuild() && stackingCont
ainer && (stackingContainer != m_owningLayer.stackingNode())) |
436 layerCompositor->updateCompositingDescendantGeometry(stackingCon
tainer, stackingContainer->layer(), flags & CompositingChildrenOnly); | 439 layerCompositor->updateCompositingDescendantGeometry(stackingCon
tainer, stackingContainer->layer(), flags & CompositingChildrenOnly); |
437 } | 440 } |
438 } | 441 } |
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2146 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2149 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2147 name = "Scrolling Contents Layer"; | 2150 name = "Scrolling Contents Layer"; |
2148 } else { | 2151 } else { |
2149 ASSERT_NOT_REACHED(); | 2152 ASSERT_NOT_REACHED(); |
2150 } | 2153 } |
2151 | 2154 |
2152 return name; | 2155 return name; |
2153 } | 2156 } |
2154 | 2157 |
2155 } // namespace WebCore | 2158 } // namespace WebCore |
OLD | NEW |