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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 void setHasCompositingDescendant(bool); | 809 void setHasCompositingDescendant(bool); |
810 | 810 |
811 bool shouldIsolateCompositedDescendants() const { | 811 bool shouldIsolateCompositedDescendants() const { |
812 DCHECK(isAllowedToQueryCompositingState()); | 812 DCHECK(isAllowedToQueryCompositingState()); |
813 return m_shouldIsolateCompositedDescendants; | 813 return m_shouldIsolateCompositedDescendants; |
814 } | 814 } |
815 void setShouldIsolateCompositedDescendants(bool); | 815 void setShouldIsolateCompositedDescendants(bool); |
816 | 816 |
817 void updateDescendantDependentFlags(); | 817 void updateDescendantDependentFlags(); |
818 | 818 |
819 void updateOrRemoveFilterEffect(); | |
820 | |
821 void updateSelfPaintingLayer(); | 819 void updateSelfPaintingLayer(); |
822 // This is O(depth) so avoid calling this in loops. Instead use optimizations | 820 // This is O(depth) so avoid calling this in loops. Instead use optimizations |
823 // like those in PaintInvalidationState. | 821 // like those in PaintInvalidationState. |
824 PaintLayer* enclosingSelfPaintingLayer(); | 822 PaintLayer* enclosingSelfPaintingLayer(); |
825 | 823 |
826 PaintLayer* enclosingTransformedAncestor() const; | 824 PaintLayer* enclosingTransformedAncestor() const; |
827 LayoutPoint computeOffsetFromTransformedAncestor() const; | 825 LayoutPoint computeOffsetFromTransformedAncestor() const; |
828 | 826 |
829 void didUpdateNeedsCompositedScrolling(); | 827 void didUpdateNeedsCompositedScrolling(); |
830 | 828 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 | 1061 |
1064 bool childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; | 1062 bool childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; |
1065 | 1063 |
1066 bool shouldBeSelfPaintingLayer() const; | 1064 bool shouldBeSelfPaintingLayer() const; |
1067 | 1065 |
1068 // FIXME: We should only create the stacking node if needed. | 1066 // FIXME: We should only create the stacking node if needed. |
1069 bool requiresStackingNode() const { return true; } | 1067 bool requiresStackingNode() const { return true; } |
1070 void updateStackingNode(); | 1068 void updateStackingNode(); |
1071 | 1069 |
1072 FilterOperations addReflectionToFilterOperations(const ComputedStyle&) const; | 1070 FilterOperations addReflectionToFilterOperations(const ComputedStyle&) const; |
1073 FilterEffect* updateFilterEffect() const; | |
1074 | 1071 |
1075 // FIXME: We could lazily allocate our ScrollableArea based on style | 1072 // FIXME: We could lazily allocate our ScrollableArea based on style |
1076 // properties ('overflow', ...) but for now, we are always allocating it for | 1073 // properties ('overflow', ...) but for now, we are always allocating it for |
1077 // LayoutBox as it's safer. crbug.com/467721. | 1074 // LayoutBox as it's safer. crbug.com/467721. |
1078 bool requiresScrollableArea() const { return layoutBox(); } | 1075 bool requiresScrollableArea() const { return layoutBox(); } |
1079 void updateScrollableArea(); | 1076 void updateScrollableArea(); |
1080 | 1077 |
1081 void dirtyAncestorChainVisibleDescendantStatus(); | 1078 void dirtyAncestorChainVisibleDescendantStatus(); |
1082 | 1079 |
1083 bool attemptDirectCompositingUpdate(StyleDifference, | 1080 bool attemptDirectCompositingUpdate(StyleDifference, |
1084 const ComputedStyle* oldStyle); | 1081 const ComputedStyle* oldStyle); |
1085 void updateTransform(const ComputedStyle* oldStyle, | 1082 void updateTransform(const ComputedStyle* oldStyle, |
1086 const ComputedStyle& newStyle); | 1083 const ComputedStyle& newStyle); |
1087 | 1084 |
1088 void removeAncestorOverflowLayer(const PaintLayer* removedLayer); | 1085 void removeAncestorOverflowLayer(const PaintLayer* removedLayer); |
1089 | 1086 |
1090 void updateOrRemoveFilterClients(); | |
1091 | |
1092 void updatePaginationRecursive(bool needsPaginationUpdate = false); | 1087 void updatePaginationRecursive(bool needsPaginationUpdate = false); |
1093 void clearPaginationRecursive(); | 1088 void clearPaginationRecursive(); |
1094 | 1089 |
1095 void setNeedsRepaintInternal(); | 1090 void setNeedsRepaintInternal(); |
1096 void markCompositingContainerChainForNeedsRepaint(); | 1091 void markCompositingContainerChainForNeedsRepaint(); |
1097 | 1092 |
1098 PaintLayerRareData& ensureRareData() { | 1093 PaintLayerRareData& ensureRareData() { |
1099 if (!m_rareData) | 1094 if (!m_rareData) |
1100 m_rareData = wrapUnique(new PaintLayerRareData); | 1095 m_rareData = wrapUnique(new PaintLayerRareData); |
1101 return *m_rareData; | 1096 return *m_rareData; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 | 1221 |
1227 } // namespace blink | 1222 } // namespace blink |
1228 | 1223 |
1229 #ifndef NDEBUG | 1224 #ifndef NDEBUG |
1230 // Outside the WebCore namespace for ease of invocation from gdb. | 1225 // Outside the WebCore namespace for ease of invocation from gdb. |
1231 CORE_EXPORT void showLayerTree(const blink::PaintLayer*); | 1226 CORE_EXPORT void showLayerTree(const blink::PaintLayer*); |
1232 CORE_EXPORT void showLayerTree(const blink::LayoutObject*); | 1227 CORE_EXPORT void showLayerTree(const blink::LayoutObject*); |
1233 #endif | 1228 #endif |
1234 | 1229 |
1235 #endif // Layer_h | 1230 #endif // Layer_h |
OLD | NEW |