| 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 bool CompositedLayerMapping::updateGraphicsLayerConfiguration() | 371 bool CompositedLayerMapping::updateGraphicsLayerConfiguration() |
| 372 { | 372 { |
| 373 ASSERT(m_owningLayer.compositor()->lifecycle().state() == DocumentLifecycle:
:InCompositingUpdate); | 373 ASSERT(m_owningLayer.compositor()->lifecycle().state() == DocumentLifecycle:
:InCompositingUpdate); |
| 374 | 374 |
| 375 // Note carefully: here we assume that the compositing state of all descenda
nts have been updated already, | 375 // Note carefully: here we assume that the compositing state of all descenda
nts have been updated already, |
| 376 // so it is legitimate to compute and cache the composited bounds for this l
ayer. | 376 // so it is legitimate to compute and cache the composited bounds for this l
ayer. |
| 377 updateCompositedBounds(); | 377 updateCompositedBounds(); |
| 378 | 378 |
| 379 if (RenderLayerReflectionInfo* reflection = m_owningLayer.reflectionInfo())
{ | 379 if (RenderLayerReflectionInfo* reflection = m_owningLayer.reflectionInfo())
{ |
| 380 if (reflection->reflectionLayer()->hasCompositedLayerMapping()) | 380 if (CompositedLayerMapping* compositedLayerMapping = reflection->reflect
ionLayer()->compositedLayerMapping()) |
| 381 reflection->reflectionLayer()->compositedLayerMapping()->updateCompo
sitedBounds(); | 381 compositedLayerMapping->updateCompositedBounds(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 RenderLayerCompositor* compositor = this->compositor(); | 384 RenderLayerCompositor* compositor = this->compositor(); |
| 385 RenderObject* renderer = this->renderer(); | 385 RenderObject* renderer = this->renderer(); |
| 386 | 386 |
| 387 bool layerConfigChanged = false; | 387 bool layerConfigChanged = false; |
| 388 setBackgroundLayerPaintsFixedRootBackground(compositor->needsFixedRootBackgr
oundLayer(&m_owningLayer)); | 388 setBackgroundLayerPaintsFixedRootBackground(compositor->needsFixedRootBackgr
oundLayer(&m_owningLayer)); |
| 389 | 389 |
| 390 // The background layer is currently only used for fixed root backgrounds. | 390 // The background layer is currently only used for fixed root backgrounds. |
| 391 if (updateBackgroundLayer(m_backgroundLayerPaintsFixedRootBackground)) | 391 if (updateBackgroundLayer(m_backgroundLayerPaintsFixedRootBackground)) |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 m_graphicsLayer->setMaskLayer(m_childClippingMaskLayer.get()); | 471 m_graphicsLayer->setMaskLayer(m_childClippingMaskLayer.get()); |
| 472 else if (hasClippingLayer()) | 472 else if (hasClippingLayer()) |
| 473 clippingLayer()->setMaskLayer(m_childClippingMaskLayer.get()); | 473 clippingLayer()->setMaskLayer(m_childClippingMaskLayer.get()); |
| 474 else if (hasScrollingLayer()) | 474 else if (hasScrollingLayer()) |
| 475 scrollingLayer()->setMaskLayer(m_childClippingMaskLayer.get()); | 475 scrollingLayer()->setMaskLayer(m_childClippingMaskLayer.get()); |
| 476 else if (isAcceleratedContents(renderer)) | 476 else if (isAcceleratedContents(renderer)) |
| 477 m_graphicsLayer->setContentsClippingMaskLayer(m_childClippingMaskLay
er.get()); | 477 m_graphicsLayer->setContentsClippingMaskLayer(m_childClippingMaskLay
er.get()); |
| 478 } | 478 } |
| 479 | 479 |
| 480 if (m_owningLayer.reflectionInfo()) { | 480 if (m_owningLayer.reflectionInfo()) { |
| 481 if (m_owningLayer.reflectionInfo()->reflectionLayer()->hasCompositedLaye
rMapping()) { | 481 if (CompositedLayerMapping* compositedLayerMapping = m_owningLayer.refle
ctionInfo()->reflectionLayer()->compositedLayerMapping()) { |
| 482 GraphicsLayer* reflectionLayer = m_owningLayer.reflectionInfo()->ref
lectionLayer()->compositedLayerMapping()->mainGraphicsLayer(); | 482 GraphicsLayer* reflectionLayer = compositedLayerMapping->mainGraphic
sLayer(); |
| 483 m_graphicsLayer->setReplicatedByLayer(reflectionLayer); | 483 m_graphicsLayer->setReplicatedByLayer(reflectionLayer); |
| 484 } | 484 } |
| 485 } else { | 485 } else { |
| 486 m_graphicsLayer->setReplicatedByLayer(0); | 486 m_graphicsLayer->setReplicatedByLayer(0); |
| 487 } | 487 } |
| 488 | 488 |
| 489 updateBackgroundColor(); | 489 updateBackgroundColor(); |
| 490 | 490 |
| 491 if (renderer->isImage()) { | 491 if (renderer->isImage()) { |
| 492 if (isDirectlyCompositedImage()) { | 492 if (isDirectlyCompositedImage()) { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 // Set opacity, if it is not animating. | 647 // Set opacity, if it is not animating. |
| 648 if (!renderer()->style()->isRunningOpacityAnimationOnCompositor()) | 648 if (!renderer()->style()->isRunningOpacityAnimationOnCompositor()) |
| 649 updateOpacity(renderer()->style()); | 649 updateOpacity(renderer()->style()); |
| 650 | 650 |
| 651 if (!renderer()->style()->isRunningFilterAnimationOnCompositor()) | 651 if (!renderer()->style()->isRunningFilterAnimationOnCompositor()) |
| 652 updateFilters(renderer()->style()); | 652 updateFilters(renderer()->style()); |
| 653 | 653 |
| 654 // We compute everything relative to the enclosing compositing layer. | 654 // We compute everything relative to the enclosing compositing layer. |
| 655 IntRect ancestorCompositingBounds; | 655 IntRect ancestorCompositingBounds; |
| 656 if (compositingContainer) { | 656 if (compositingContainer) { |
| 657 ASSERT(compositingContainer->hasCompositedLayerMapping()); | 657 CompositedLayerMapping* compositedLayerMapping = compositingContainer->c
ompositedLayerMapping(); |
| 658 ancestorCompositingBounds = compositingContainer->compositedLayerMapping
()->pixelSnappedCompositedBounds(); | 658 ASSERT(compositedLayerMapping); |
| 659 ancestorCompositingBounds = compositedLayerMapping->pixelSnappedComposit
edBounds(); |
| 659 } | 660 } |
| 660 | 661 |
| 661 IntRect localCompositingBounds; | 662 IntRect localCompositingBounds; |
| 662 IntRect relativeCompositingBounds; | 663 IntRect relativeCompositingBounds; |
| 663 LayoutPoint offsetFromCompositedAncestor; | 664 LayoutPoint offsetFromCompositedAncestor; |
| 664 IntPoint snappedOffsetFromCompositedAncestor; | 665 IntPoint snappedOffsetFromCompositedAncestor; |
| 665 computeBoundsOfOwningLayer(compositingContainer, localCompositingBounds, rel
ativeCompositingBounds, offsetFromCompositedAncestor, snappedOffsetFromComposite
dAncestor); | 666 computeBoundsOfOwningLayer(compositingContainer, localCompositingBounds, rel
ativeCompositingBounds, offsetFromCompositedAncestor, snappedOffsetFromComposite
dAncestor); |
| 666 | 667 |
| 667 IntPoint graphicsLayerParentLocation; | 668 IntPoint graphicsLayerParentLocation; |
| 668 computeGraphicsLayerParentLocation(compositingContainer, ancestorCompositing
Bounds, graphicsLayerParentLocation); | 669 computeGraphicsLayerParentLocation(compositingContainer, ancestorCompositing
Bounds, graphicsLayerParentLocation); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 FloatPoint3D compositedTransformOrigin( | 871 FloatPoint3D compositedTransformOrigin( |
| 871 relativeCompositingBounds.width() * 0.5f, | 872 relativeCompositingBounds.width() * 0.5f, |
| 872 relativeCompositingBounds.height() * 0.5f, | 873 relativeCompositingBounds.height() * 0.5f, |
| 873 0.f); | 874 0.f); |
| 874 m_graphicsLayer->setTransformOrigin(compositedTransformOrigin); | 875 m_graphicsLayer->setTransformOrigin(compositedTransformOrigin); |
| 875 } | 876 } |
| 876 } | 877 } |
| 877 | 878 |
| 878 void CompositedLayerMapping::updateReflectionLayerGeometry(Vector<RenderLayer*>&
layersNeedingPaintInvalidation) | 879 void CompositedLayerMapping::updateReflectionLayerGeometry(Vector<RenderLayer*>&
layersNeedingPaintInvalidation) |
| 879 { | 880 { |
| 880 if (!m_owningLayer.reflectionInfo() || !m_owningLayer.reflectionInfo()->refl
ectionLayer()->hasCompositedLayerMapping()) | 881 if (!m_owningLayer.reflectionInfo()) |
| 881 return; | 882 return; |
| 882 | 883 |
| 883 CompositedLayerMapping* reflectionCompositedLayerMapping = m_owningLayer.ref
lectionInfo()->reflectionLayer()->compositedLayerMapping(); | 884 CompositedLayerMapping* reflectionCompositedLayerMapping = m_owningLayer.ref
lectionInfo()->reflectionLayer()->compositedLayerMapping(); |
| 885 if (!reflectionCompositedLayerMapping) |
| 886 return; |
| 887 |
| 884 reflectionCompositedLayerMapping->updateGraphicsLayerGeometry(&m_owningLayer
, &m_owningLayer, layersNeedingPaintInvalidation); | 888 reflectionCompositedLayerMapping->updateGraphicsLayerGeometry(&m_owningLayer
, &m_owningLayer, layersNeedingPaintInvalidation); |
| 885 } | 889 } |
| 886 | 890 |
| 887 void CompositedLayerMapping::updateScrollingLayerGeometry(const IntRect& localCo
mpositingBounds) | 891 void CompositedLayerMapping::updateScrollingLayerGeometry(const IntRect& localCo
mpositingBounds) |
| 888 { | 892 { |
| 889 if (!m_scrollingLayer) | 893 if (!m_scrollingLayer) |
| 890 return; | 894 return; |
| 891 | 895 |
| 892 ASSERT(m_scrollingContentsLayer); | 896 ASSERT(m_scrollingContentsLayer); |
| 893 RenderBox* renderBox = toRenderBox(renderer()); | 897 RenderBox* renderBox = toRenderBox(renderer()); |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1747 // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512. | 1751 // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512. |
| 1748 parent->stackingNode()->updateLayerListsIfNeeded(); | 1752 parent->stackingNode()->updateLayerListsIfNeeded(); |
| 1749 | 1753 |
| 1750 #if ENABLE(ASSERT) | 1754 #if ENABLE(ASSERT) |
| 1751 LayerListMutationDetector mutationChecker(parent->stackingNode()); | 1755 LayerListMutationDetector mutationChecker(parent->stackingNode()); |
| 1752 #endif | 1756 #endif |
| 1753 | 1757 |
| 1754 RenderLayerStackingNodeIterator normalFlowIterator(*parent->stackingNode(),
AllChildren); | 1758 RenderLayerStackingNodeIterator normalFlowIterator(*parent->stackingNode(),
AllChildren); |
| 1755 while (RenderLayerStackingNode* curNode = normalFlowIterator.next()) { | 1759 while (RenderLayerStackingNode* curNode = normalFlowIterator.next()) { |
| 1756 RenderLayer* curLayer = curNode->layer(); | 1760 RenderLayer* curLayer = curNode->layer(); |
| 1757 if (curLayer->hasCompositedLayerMapping()) | 1761 if (curLayer->compositedLayerMapping()) |
| 1758 continue; | 1762 continue; |
| 1759 if (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(
curLayer)) | 1763 if (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(
curLayer)) |
| 1760 return true; | 1764 return true; |
| 1761 } | 1765 } |
| 1762 | 1766 |
| 1763 return false; | 1767 return false; |
| 1764 } | 1768 } |
| 1765 | 1769 |
| 1766 bool CompositedLayerMapping::containsPaintedContent() const | 1770 bool CompositedLayerMapping::containsPaintedContent() const |
| 1767 { | 1771 { |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2324 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2328 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
| 2325 name = "Scrolling Block Selection Layer"; | 2329 name = "Scrolling Block Selection Layer"; |
| 2326 } else { | 2330 } else { |
| 2327 ASSERT_NOT_REACHED(); | 2331 ASSERT_NOT_REACHED(); |
| 2328 } | 2332 } |
| 2329 | 2333 |
| 2330 return name; | 2334 return name; |
| 2331 } | 2335 } |
| 2332 | 2336 |
| 2333 } // namespace blink | 2337 } // namespace blink |
| OLD | NEW |