| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 #include "platform/TraceEvent.h" | 76 #include "platform/TraceEvent.h" |
| 77 #include "platform/geometry/FloatPoint3D.h" | 77 #include "platform/geometry/FloatPoint3D.h" |
| 78 #include "platform/geometry/FloatRect.h" | 78 #include "platform/geometry/FloatRect.h" |
| 79 #include "platform/geometry/TransformState.h" | 79 #include "platform/geometry/TransformState.h" |
| 80 #include "platform/graphics/filters/Filter.h" | 80 #include "platform/graphics/filters/Filter.h" |
| 81 #include "platform/graphics/filters/SourceGraphic.h" | 81 #include "platform/graphics/filters/SourceGraphic.h" |
| 82 #include "platform/transforms/ScaleTransformOperation.h" | 82 #include "platform/transforms/ScaleTransformOperation.h" |
| 83 #include "platform/transforms/TransformationMatrix.h" | 83 #include "platform/transforms/TransformationMatrix.h" |
| 84 #include "platform/transforms/TranslateTransformOperation.h" | 84 #include "platform/transforms/TranslateTransformOperation.h" |
| 85 #include "public/platform/Platform.h" | 85 #include "public/platform/Platform.h" |
| 86 #include "wtf/PtrUtil.h" | |
| 87 #include "wtf/StdLibExtras.h" | 86 #include "wtf/StdLibExtras.h" |
| 88 #include "wtf/allocator/Partitions.h" | 87 #include "wtf/allocator/Partitions.h" |
| 89 #include "wtf/text/CString.h" | 88 #include "wtf/text/CString.h" |
| 90 | 89 |
| 91 namespace blink { | 90 namespace blink { |
| 92 | 91 |
| 93 namespace { | 92 namespace { |
| 94 | 93 |
| 95 static CompositingQueryMode gCompositingQueryMode = | 94 static CompositingQueryMode gCompositingQueryMode = |
| 96 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases; | 95 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases; |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 | 975 |
| 977 compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInp
utChange); | 976 compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInp
utChange); |
| 978 } | 977 } |
| 979 | 978 |
| 980 void PaintLayer::updateAncestorDependentCompositingInputs(const AncestorDependen
tCompositingInputs& compositingInputs, const RareAncestorDependentCompositingInp
uts& rareCompositingInputs, bool hasAncestorWithClipPath) | 979 void PaintLayer::updateAncestorDependentCompositingInputs(const AncestorDependen
tCompositingInputs& compositingInputs, const RareAncestorDependentCompositingInp
uts& rareCompositingInputs, bool hasAncestorWithClipPath) |
| 981 { | 980 { |
| 982 m_ancestorDependentCompositingInputs = compositingInputs; | 981 m_ancestorDependentCompositingInputs = compositingInputs; |
| 983 if (rareCompositingInputs.isDefault()) | 982 if (rareCompositingInputs.isDefault()) |
| 984 m_rareAncestorDependentCompositingInputs.reset(); | 983 m_rareAncestorDependentCompositingInputs.reset(); |
| 985 else | 984 else |
| 986 m_rareAncestorDependentCompositingInputs = wrapUnique(new RareAncestorDe
pendentCompositingInputs(rareCompositingInputs)); | 985 m_rareAncestorDependentCompositingInputs = adoptPtr(new RareAncestorDepe
ndentCompositingInputs(rareCompositingInputs)); |
| 987 m_hasAncestorWithClipPath = hasAncestorWithClipPath; | 986 m_hasAncestorWithClipPath = hasAncestorWithClipPath; |
| 988 m_needsAncestorDependentCompositingInputsUpdate = false; | 987 m_needsAncestorDependentCompositingInputsUpdate = false; |
| 989 } | 988 } |
| 990 | 989 |
| 991 void PaintLayer::updateDescendantDependentCompositingInputs(bool hasDescendantWi
thClipPath, bool hasNonIsolatedDescendantWithBlendMode) | 990 void PaintLayer::updateDescendantDependentCompositingInputs(bool hasDescendantWi
thClipPath, bool hasNonIsolatedDescendantWithBlendMode) |
| 992 { | 991 { |
| 993 m_hasDescendantWithClipPath = hasDescendantWithClipPath; | 992 m_hasDescendantWithClipPath = hasDescendantWithClipPath; |
| 994 m_hasNonIsolatedDescendantWithBlendMode = hasNonIsolatedDescendantWithBlendM
ode; | 993 m_hasNonIsolatedDescendantWithBlendMode = hasNonIsolatedDescendantWithBlendM
ode; |
| 995 m_needsDescendantDependentCompositingInputsUpdate = false; | 994 m_needsDescendantDependentCompositingInputsUpdate = false; |
| 996 } | 995 } |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1445 // if it becomes self-painting, it should paint itself and no ancestor shoul
d paint it. | 1444 // if it becomes self-painting, it should paint itself and no ancestor shoul
d paint it. |
| 1446 if (wasSelfPaintingLayer != isSelfPaintingLayer() && m_layoutObject->isFloat
ing()) | 1445 if (wasSelfPaintingLayer != isSelfPaintingLayer() && m_layoutObject->isFloat
ing()) |
| 1447 LayoutBlockFlow::setAncestorShouldPaintFloatingObject(*layoutBox(), wasS
elfPaintingLayer); | 1446 LayoutBlockFlow::setAncestorShouldPaintFloatingObject(*layoutBox(), wasS
elfPaintingLayer); |
| 1448 } | 1447 } |
| 1449 | 1448 |
| 1450 void PaintLayer::updateReflectionInfo(const ComputedStyle* oldStyle) | 1449 void PaintLayer::updateReflectionInfo(const ComputedStyle* oldStyle) |
| 1451 { | 1450 { |
| 1452 ASSERT(!oldStyle || !layoutObject()->style()->reflectionDataEquivalent(oldSt
yle)); | 1451 ASSERT(!oldStyle || !layoutObject()->style()->reflectionDataEquivalent(oldSt
yle)); |
| 1453 if (layoutObject()->hasReflection()) { | 1452 if (layoutObject()->hasReflection()) { |
| 1454 if (!ensureRareData().reflectionInfo) | 1453 if (!ensureRareData().reflectionInfo) |
| 1455 m_rareData->reflectionInfo = wrapUnique(new PaintLayerReflectionInfo
(*layoutBox())); | 1454 m_rareData->reflectionInfo = adoptPtr(new PaintLayerReflectionInfo(*
layoutBox())); |
| 1456 m_rareData->reflectionInfo->updateAfterStyleChange(oldStyle); | 1455 m_rareData->reflectionInfo->updateAfterStyleChange(oldStyle); |
| 1457 } else if (m_rareData && m_rareData->reflectionInfo) { | 1456 } else if (m_rareData && m_rareData->reflectionInfo) { |
| 1458 m_rareData->reflectionInfo = nullptr; | 1457 m_rareData->reflectionInfo = nullptr; |
| 1459 } | 1458 } |
| 1460 } | 1459 } |
| 1461 | 1460 |
| 1462 void PaintLayer::updateStackingNode() | 1461 void PaintLayer::updateStackingNode() |
| 1463 { | 1462 { |
| 1464 ASSERT(!m_stackingNode); | 1463 ASSERT(!m_stackingNode); |
| 1465 if (requiresStackingNode()) | 1464 if (requiresStackingNode()) |
| 1466 m_stackingNode = wrapUnique(new PaintLayerStackingNode(this)); | 1465 m_stackingNode = adoptPtr(new PaintLayerStackingNode(this)); |
| 1467 else | 1466 else |
| 1468 m_stackingNode = nullptr; | 1467 m_stackingNode = nullptr; |
| 1469 } | 1468 } |
| 1470 | 1469 |
| 1471 void PaintLayer::updateScrollableArea() | 1470 void PaintLayer::updateScrollableArea() |
| 1472 { | 1471 { |
| 1473 ASSERT(!m_scrollableArea); | 1472 ASSERT(!m_scrollableArea); |
| 1474 if (requiresScrollableArea()) | 1473 if (requiresScrollableArea()) |
| 1475 m_scrollableArea = PaintLayerScrollableArea::create(*this); | 1474 m_scrollableArea = PaintLayerScrollableArea::create(*this); |
| 1476 } | 1475 } |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2327 default: | 2326 default: |
| 2328 return compositedLayerMapping()->scrollingContentsLayer() ? compositedLa
yerMapping()->scrollingContentsLayer() : compositedLayerMapping()->mainGraphicsL
ayer(); | 2327 return compositedLayerMapping()->scrollingContentsLayer() ? compositedLa
yerMapping()->scrollingContentsLayer() : compositedLayerMapping()->mainGraphicsL
ayer(); |
| 2329 } | 2328 } |
| 2330 } | 2329 } |
| 2331 | 2330 |
| 2332 void PaintLayer::ensureCompositedLayerMapping() | 2331 void PaintLayer::ensureCompositedLayerMapping() |
| 2333 { | 2332 { |
| 2334 if (m_rareData && m_rareData->compositedLayerMapping) | 2333 if (m_rareData && m_rareData->compositedLayerMapping) |
| 2335 return; | 2334 return; |
| 2336 | 2335 |
| 2337 ensureRareData().compositedLayerMapping = wrapUnique(new CompositedLayerMapp
ing(*this)); | 2336 ensureRareData().compositedLayerMapping = adoptPtr(new CompositedLayerMappin
g(*this)); |
| 2338 m_rareData->compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLaye
rUpdateSubtree); | 2337 m_rareData->compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLaye
rUpdateSubtree); |
| 2339 | 2338 |
| 2340 updateOrRemoveFilterEffectBuilder(); | 2339 updateOrRemoveFilterEffectBuilder(); |
| 2341 } | 2340 } |
| 2342 | 2341 |
| 2343 void PaintLayer::clearCompositedLayerMapping(bool layerBeingDestroyed) | 2342 void PaintLayer::clearCompositedLayerMapping(bool layerBeingDestroyed) |
| 2344 { | 2343 { |
| 2345 if (!layerBeingDestroyed) { | 2344 if (!layerBeingDestroyed) { |
| 2346 // We need to make sure our decendants get a geometry update. In princip
le, | 2345 // We need to make sure our decendants get a geometry update. In princip
le, |
| 2347 // we could call setNeedsGraphicsLayerUpdate on our children, but that w
ould | 2346 // we could call setNeedsGraphicsLayerUpdate on our children, but that w
ould |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2943 | 2942 |
| 2944 void showLayerTree(const blink::LayoutObject* layoutObject) | 2943 void showLayerTree(const blink::LayoutObject* layoutObject) |
| 2945 { | 2944 { |
| 2946 if (!layoutObject) { | 2945 if (!layoutObject) { |
| 2947 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2946 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
| 2948 return; | 2947 return; |
| 2949 } | 2948 } |
| 2950 showLayerTree(layoutObject->enclosingLayer()); | 2949 showLayerTree(layoutObject->enclosingLayer()); |
| 2951 } | 2950 } |
| 2952 #endif | 2951 #endif |
| OLD | NEW |