OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "wtf/Allocator.h" | 60 #include "wtf/Allocator.h" |
61 #include "wtf/AutoReset.h" | 61 #include "wtf/AutoReset.h" |
62 #include "wtf/PtrUtil.h" | 62 #include "wtf/PtrUtil.h" |
63 #include <memory> | 63 #include <memory> |
64 | 64 |
65 namespace blink { | 65 namespace blink { |
66 | 66 |
67 class CompositedLayerMapping; | 67 class CompositedLayerMapping; |
68 class CompositorFilterOperations; | 68 class CompositorFilterOperations; |
69 class ComputedStyle; | 69 class ComputedStyle; |
| 70 class FilterEffect; |
70 class FilterOperations; | 71 class FilterOperations; |
71 class HitTestResult; | 72 class HitTestResult; |
72 class HitTestingTransformState; | 73 class HitTestingTransformState; |
73 class PaintLayerCompositor; | 74 class PaintLayerCompositor; |
74 class PaintTiming; | 75 class PaintTiming; |
75 class TransformationMatrix; | 76 class TransformationMatrix; |
76 | 77 |
77 enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf }; | 78 enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf }; |
78 | 79 |
79 enum CompositingQueryMode { | 80 enum CompositingQueryMode { |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 !m_rareData->transform->isAffine(); | 475 !m_rareData->transform->isAffine(); |
475 } | 476 } |
476 | 477 |
477 // FIXME: reflections should force transform-style to be flat in the style: | 478 // FIXME: reflections should force transform-style to be flat in the style: |
478 // https://bugs.webkit.org/show_bug.cgi?id=106959 | 479 // https://bugs.webkit.org/show_bug.cgi?id=106959 |
479 bool shouldPreserve3D() const { | 480 bool shouldPreserve3D() const { |
480 return !layoutObject()->hasReflection() && | 481 return !layoutObject()->hasReflection() && |
481 layoutObject()->style()->preserves3D(); | 482 layoutObject()->style()->preserves3D(); |
482 } | 483 } |
483 | 484 |
484 void filterNeedsPaintInvalidation(); | |
485 | |
486 // Returns |true| if any property that renders using filter operations is | 485 // Returns |true| if any property that renders using filter operations is |
487 // used (including, but not limited to, 'filter' and 'box-reflect'). | 486 // used (including, but not limited to, 'filter' and 'box-reflect'). |
488 bool hasFilterInducingProperty() const { | 487 bool hasFilterInducingProperty() const { |
489 return layoutObject()->hasFilterInducingProperty(); | 488 return layoutObject()->hasFilterInducingProperty(); |
490 } | 489 } |
491 | 490 |
492 void* operator new(size_t); | 491 void* operator new(size_t); |
493 // Only safe to call from LayoutBoxModelObject::destroyLayer() | 492 // Only safe to call from LayoutBoxModelObject::destroyLayer() |
494 void operator delete(void*); | 493 void operator delete(void*); |
495 | 494 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 591 |
593 // Calls the above, rounding outwards. | 592 // Calls the above, rounding outwards. |
594 LayoutRect mapLayoutRectForFilter(const LayoutRect&) const; | 593 LayoutRect mapLayoutRectForFilter(const LayoutRect&) const; |
595 | 594 |
596 bool hasFilterThatMovesPixels() const; | 595 bool hasFilterThatMovesPixels() const; |
597 | 596 |
598 PaintLayerFilterInfo* filterInfo() const { | 597 PaintLayerFilterInfo* filterInfo() const { |
599 return m_rareData ? m_rareData->filterInfo.get() : nullptr; | 598 return m_rareData ? m_rareData->filterInfo.get() : nullptr; |
600 } | 599 } |
601 PaintLayerFilterInfo& ensureFilterInfo(); | 600 PaintLayerFilterInfo& ensureFilterInfo(); |
| 601 void removeFilterInfo(); |
602 | 602 |
603 void updateFilters(const ComputedStyle* oldStyle, | 603 void updateFilters(const ComputedStyle* oldStyle, |
604 const ComputedStyle& newStyle); | 604 const ComputedStyle& newStyle); |
605 | 605 |
606 Node* enclosingNode() const; | 606 Node* enclosingNode() const; |
607 | 607 |
608 bool isInTopLayer() const; | 608 bool isInTopLayer() const; |
609 | 609 |
610 bool scrollsWithViewport() const; | 610 bool scrollsWithViewport() const; |
611 bool scrollsWithRespectTo(const PaintLayer*) const; | 611 bool scrollsWithRespectTo(const PaintLayer*) const; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 void setHasCompositingDescendant(bool); | 824 void setHasCompositingDescendant(bool); |
825 | 825 |
826 bool shouldIsolateCompositedDescendants() const { | 826 bool shouldIsolateCompositedDescendants() const { |
827 DCHECK(isAllowedToQueryCompositingState()); | 827 DCHECK(isAllowedToQueryCompositingState()); |
828 return m_shouldIsolateCompositedDescendants; | 828 return m_shouldIsolateCompositedDescendants; |
829 } | 829 } |
830 void setShouldIsolateCompositedDescendants(bool); | 830 void setShouldIsolateCompositedDescendants(bool); |
831 | 831 |
832 void updateDescendantDependentFlags(); | 832 void updateDescendantDependentFlags(); |
833 | 833 |
834 void updateOrRemoveFilterEffect(); | |
835 | |
836 void updateSelfPaintingLayer(); | 834 void updateSelfPaintingLayer(); |
837 // This is O(depth) so avoid calling this in loops. Instead use optimizations | 835 // This is O(depth) so avoid calling this in loops. Instead use optimizations |
838 // like those in PaintInvalidationState. | 836 // like those in PaintInvalidationState. |
839 PaintLayer* enclosingSelfPaintingLayer(); | 837 PaintLayer* enclosingSelfPaintingLayer(); |
840 | 838 |
841 PaintLayer* enclosingTransformedAncestor() const; | 839 PaintLayer* enclosingTransformedAncestor() const; |
842 LayoutPoint computeOffsetFromTransformedAncestor() const; | 840 LayoutPoint computeOffsetFromTransformedAncestor() const; |
843 | 841 |
844 void didUpdateNeedsCompositedScrolling(); | 842 void didUpdateNeedsCompositedScrolling(); |
845 | 843 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 | 1076 |
1079 bool childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; | 1077 bool childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; |
1080 | 1078 |
1081 bool shouldBeSelfPaintingLayer() const; | 1079 bool shouldBeSelfPaintingLayer() const; |
1082 | 1080 |
1083 // FIXME: We should only create the stacking node if needed. | 1081 // FIXME: We should only create the stacking node if needed. |
1084 bool requiresStackingNode() const { return true; } | 1082 bool requiresStackingNode() const { return true; } |
1085 void updateStackingNode(); | 1083 void updateStackingNode(); |
1086 | 1084 |
1087 FilterOperations addReflectionToFilterOperations(const ComputedStyle&) const; | 1085 FilterOperations addReflectionToFilterOperations(const ComputedStyle&) const; |
1088 FilterEffect* updateFilterEffect() const; | |
1089 | 1086 |
1090 // FIXME: We could lazily allocate our ScrollableArea based on style | 1087 // FIXME: We could lazily allocate our ScrollableArea based on style |
1091 // properties ('overflow', ...) but for now, we are always allocating it for | 1088 // properties ('overflow', ...) but for now, we are always allocating it for |
1092 // LayoutBox as it's safer. crbug.com/467721. | 1089 // LayoutBox as it's safer. crbug.com/467721. |
1093 bool requiresScrollableArea() const { return layoutBox(); } | 1090 bool requiresScrollableArea() const { return layoutBox(); } |
1094 void updateScrollableArea(); | 1091 void updateScrollableArea(); |
1095 | 1092 |
1096 void dirtyAncestorChainVisibleDescendantStatus(); | 1093 void dirtyAncestorChainVisibleDescendantStatus(); |
1097 | 1094 |
1098 bool attemptDirectCompositingUpdate(StyleDifference, | 1095 bool attemptDirectCompositingUpdate(StyleDifference, |
1099 const ComputedStyle* oldStyle); | 1096 const ComputedStyle* oldStyle); |
1100 void updateTransform(const ComputedStyle* oldStyle, | 1097 void updateTransform(const ComputedStyle* oldStyle, |
1101 const ComputedStyle& newStyle); | 1098 const ComputedStyle& newStyle); |
1102 | 1099 |
1103 void removeAncestorOverflowLayer(const PaintLayer* removedLayer); | 1100 void removeAncestorOverflowLayer(const PaintLayer* removedLayer); |
1104 | 1101 |
1105 void updateOrRemoveFilterClients(); | |
1106 | |
1107 void updatePaginationRecursive(bool needsPaginationUpdate = false); | 1102 void updatePaginationRecursive(bool needsPaginationUpdate = false); |
1108 void clearPaginationRecursive(); | 1103 void clearPaginationRecursive(); |
1109 | 1104 |
1110 void setNeedsRepaintInternal(); | 1105 void setNeedsRepaintInternal(); |
1111 void markCompositingContainerChainForNeedsRepaint(); | 1106 void markCompositingContainerChainForNeedsRepaint(); |
1112 | 1107 |
1113 PaintLayerRareData& ensureRareData() { | 1108 PaintLayerRareData& ensureRareData() { |
1114 if (!m_rareData) | 1109 if (!m_rareData) |
1115 m_rareData = wrapUnique(new PaintLayerRareData); | 1110 m_rareData = wrapUnique(new PaintLayerRareData); |
1116 return *m_rareData; | 1111 return *m_rareData; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 | 1237 |
1243 } // namespace blink | 1238 } // namespace blink |
1244 | 1239 |
1245 #ifndef NDEBUG | 1240 #ifndef NDEBUG |
1246 // Outside the WebCore namespace for ease of invocation from gdb. | 1241 // Outside the WebCore namespace for ease of invocation from gdb. |
1247 CORE_EXPORT void showLayerTree(const blink::PaintLayer*); | 1242 CORE_EXPORT void showLayerTree(const blink::PaintLayer*); |
1248 CORE_EXPORT void showLayerTree(const blink::LayoutObject*); | 1243 CORE_EXPORT void showLayerTree(const blink::LayoutObject*); |
1249 #endif | 1244 #endif |
1250 | 1245 |
1251 #endif // Layer_h | 1246 #endif // Layer_h |
OLD | NEW |