| 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" |
| 86 #include "wtf/StdLibExtras.h" | 87 #include "wtf/StdLibExtras.h" |
| 87 #include "wtf/allocator/Partitions.h" | 88 #include "wtf/allocator/Partitions.h" |
| 88 #include "wtf/text/CString.h" | 89 #include "wtf/text/CString.h" |
| 89 | 90 |
| 90 namespace blink { | 91 namespace blink { |
| 91 | 92 |
| 92 namespace { | 93 namespace { |
| 93 | 94 |
| 94 static CompositingQueryMode gCompositingQueryMode = | 95 static CompositingQueryMode gCompositingQueryMode = |
| 95 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases; | 96 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases; |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 | 976 |
| 976 compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInp
utChange); | 977 compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInp
utChange); |
| 977 } | 978 } |
| 978 | 979 |
| 979 void PaintLayer::updateAncestorDependentCompositingInputs(const AncestorDependen
tCompositingInputs& compositingInputs, const RareAncestorDependentCompositingInp
uts& rareCompositingInputs, bool hasAncestorWithClipPath) | 980 void PaintLayer::updateAncestorDependentCompositingInputs(const AncestorDependen
tCompositingInputs& compositingInputs, const RareAncestorDependentCompositingInp
uts& rareCompositingInputs, bool hasAncestorWithClipPath) |
| 980 { | 981 { |
| 981 m_ancestorDependentCompositingInputs = compositingInputs; | 982 m_ancestorDependentCompositingInputs = compositingInputs; |
| 982 if (rareCompositingInputs.isDefault()) | 983 if (rareCompositingInputs.isDefault()) |
| 983 m_rareAncestorDependentCompositingInputs.reset(); | 984 m_rareAncestorDependentCompositingInputs.reset(); |
| 984 else | 985 else |
| 985 m_rareAncestorDependentCompositingInputs = adoptPtr(new RareAncestorDepe
ndentCompositingInputs(rareCompositingInputs)); | 986 m_rareAncestorDependentCompositingInputs = wrapUnique(new RareAncestorDe
pendentCompositingInputs(rareCompositingInputs)); |
| 986 m_hasAncestorWithClipPath = hasAncestorWithClipPath; | 987 m_hasAncestorWithClipPath = hasAncestorWithClipPath; |
| 987 m_needsAncestorDependentCompositingInputsUpdate = false; | 988 m_needsAncestorDependentCompositingInputsUpdate = false; |
| 988 } | 989 } |
| 989 | 990 |
| 990 void PaintLayer::updateDescendantDependentCompositingInputs(bool hasDescendantWi
thClipPath, bool hasNonIsolatedDescendantWithBlendMode) | 991 void PaintLayer::updateDescendantDependentCompositingInputs(bool hasDescendantWi
thClipPath, bool hasNonIsolatedDescendantWithBlendMode) |
| 991 { | 992 { |
| 992 m_hasDescendantWithClipPath = hasDescendantWithClipPath; | 993 m_hasDescendantWithClipPath = hasDescendantWithClipPath; |
| 993 m_hasNonIsolatedDescendantWithBlendMode = hasNonIsolatedDescendantWithBlendM
ode; | 994 m_hasNonIsolatedDescendantWithBlendMode = hasNonIsolatedDescendantWithBlendM
ode; |
| 994 m_needsDescendantDependentCompositingInputsUpdate = false; | 995 m_needsDescendantDependentCompositingInputsUpdate = false; |
| 995 } | 996 } |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1444 // if it becomes self-painting, it should paint itself and no ancestor shoul
d paint it. | 1445 // if it becomes self-painting, it should paint itself and no ancestor shoul
d paint it. |
| 1445 if (wasSelfPaintingLayer != isSelfPaintingLayer() && m_layoutObject->isFloat
ing()) | 1446 if (wasSelfPaintingLayer != isSelfPaintingLayer() && m_layoutObject->isFloat
ing()) |
| 1446 LayoutBlockFlow::setAncestorShouldPaintFloatingObject(*layoutBox(), wasS
elfPaintingLayer); | 1447 LayoutBlockFlow::setAncestorShouldPaintFloatingObject(*layoutBox(), wasS
elfPaintingLayer); |
| 1447 } | 1448 } |
| 1448 | 1449 |
| 1449 void PaintLayer::updateReflectionInfo(const ComputedStyle* oldStyle) | 1450 void PaintLayer::updateReflectionInfo(const ComputedStyle* oldStyle) |
| 1450 { | 1451 { |
| 1451 ASSERT(!oldStyle || !layoutObject()->style()->reflectionDataEquivalent(oldSt
yle)); | 1452 ASSERT(!oldStyle || !layoutObject()->style()->reflectionDataEquivalent(oldSt
yle)); |
| 1452 if (layoutObject()->hasReflection()) { | 1453 if (layoutObject()->hasReflection()) { |
| 1453 if (!ensureRareData().reflectionInfo) | 1454 if (!ensureRareData().reflectionInfo) |
| 1454 m_rareData->reflectionInfo = adoptPtr(new PaintLayerReflectionInfo(*
layoutBox())); | 1455 m_rareData->reflectionInfo = wrapUnique(new PaintLayerReflectionInfo
(*layoutBox())); |
| 1455 m_rareData->reflectionInfo->updateAfterStyleChange(oldStyle); | 1456 m_rareData->reflectionInfo->updateAfterStyleChange(oldStyle); |
| 1456 } else if (m_rareData && m_rareData->reflectionInfo) { | 1457 } else if (m_rareData && m_rareData->reflectionInfo) { |
| 1457 m_rareData->reflectionInfo = nullptr; | 1458 m_rareData->reflectionInfo = nullptr; |
| 1458 } | 1459 } |
| 1459 } | 1460 } |
| 1460 | 1461 |
| 1461 void PaintLayer::updateStackingNode() | 1462 void PaintLayer::updateStackingNode() |
| 1462 { | 1463 { |
| 1463 ASSERT(!m_stackingNode); | 1464 ASSERT(!m_stackingNode); |
| 1464 if (requiresStackingNode()) | 1465 if (requiresStackingNode()) |
| 1465 m_stackingNode = adoptPtr(new PaintLayerStackingNode(this)); | 1466 m_stackingNode = wrapUnique(new PaintLayerStackingNode(this)); |
| 1466 else | 1467 else |
| 1467 m_stackingNode = nullptr; | 1468 m_stackingNode = nullptr; |
| 1468 } | 1469 } |
| 1469 | 1470 |
| 1470 void PaintLayer::updateScrollableArea() | 1471 void PaintLayer::updateScrollableArea() |
| 1471 { | 1472 { |
| 1472 ASSERT(!m_scrollableArea); | 1473 ASSERT(!m_scrollableArea); |
| 1473 if (requiresScrollableArea()) | 1474 if (requiresScrollableArea()) |
| 1474 m_scrollableArea = PaintLayerScrollableArea::create(*this); | 1475 m_scrollableArea = PaintLayerScrollableArea::create(*this); |
| 1475 } | 1476 } |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2326 default: | 2327 default: |
| 2327 return compositedLayerMapping()->scrollingContentsLayer() ? compositedLa
yerMapping()->scrollingContentsLayer() : compositedLayerMapping()->mainGraphicsL
ayer(); | 2328 return compositedLayerMapping()->scrollingContentsLayer() ? compositedLa
yerMapping()->scrollingContentsLayer() : compositedLayerMapping()->mainGraphicsL
ayer(); |
| 2328 } | 2329 } |
| 2329 } | 2330 } |
| 2330 | 2331 |
| 2331 void PaintLayer::ensureCompositedLayerMapping() | 2332 void PaintLayer::ensureCompositedLayerMapping() |
| 2332 { | 2333 { |
| 2333 if (m_rareData && m_rareData->compositedLayerMapping) | 2334 if (m_rareData && m_rareData->compositedLayerMapping) |
| 2334 return; | 2335 return; |
| 2335 | 2336 |
| 2336 ensureRareData().compositedLayerMapping = adoptPtr(new CompositedLayerMappin
g(*this)); | 2337 ensureRareData().compositedLayerMapping = wrapUnique(new CompositedLayerMapp
ing(*this)); |
| 2337 m_rareData->compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLaye
rUpdateSubtree); | 2338 m_rareData->compositedLayerMapping->setNeedsGraphicsLayerUpdate(GraphicsLaye
rUpdateSubtree); |
| 2338 | 2339 |
| 2339 updateOrRemoveFilterEffectBuilder(); | 2340 updateOrRemoveFilterEffectBuilder(); |
| 2340 } | 2341 } |
| 2341 | 2342 |
| 2342 void PaintLayer::clearCompositedLayerMapping(bool layerBeingDestroyed) | 2343 void PaintLayer::clearCompositedLayerMapping(bool layerBeingDestroyed) |
| 2343 { | 2344 { |
| 2344 if (!layerBeingDestroyed) { | 2345 if (!layerBeingDestroyed) { |
| 2345 // We need to make sure our decendants get a geometry update. In princip
le, | 2346 // We need to make sure our decendants get a geometry update. In princip
le, |
| 2346 // we could call setNeedsGraphicsLayerUpdate on our children, but that w
ould | 2347 // we could call setNeedsGraphicsLayerUpdate on our children, but that w
ould |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2925 | 2926 |
| 2926 void showLayerTree(const blink::LayoutObject* layoutObject) | 2927 void showLayerTree(const blink::LayoutObject* layoutObject) |
| 2927 { | 2928 { |
| 2928 if (!layoutObject) { | 2929 if (!layoutObject) { |
| 2929 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2930 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
| 2930 return; | 2931 return; |
| 2931 } | 2932 } |
| 2932 showLayerTree(layoutObject->enclosingLayer()); | 2933 showLayerTree(layoutObject->enclosingLayer()); |
| 2933 } | 2934 } |
| 2934 #endif | 2935 #endif |
| OLD | NEW |