| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "core/paint/PaintLayerFragment.h" | 53 #include "core/paint/PaintLayerFragment.h" |
| 54 #include "core/paint/PaintLayerPainter.h" | 54 #include "core/paint/PaintLayerPainter.h" |
| 55 #include "core/paint/PaintLayerReflectionInfo.h" | 55 #include "core/paint/PaintLayerReflectionInfo.h" |
| 56 #include "core/paint/PaintLayerScrollableArea.h" | 56 #include "core/paint/PaintLayerScrollableArea.h" |
| 57 #include "core/paint/PaintLayerStackingNode.h" | 57 #include "core/paint/PaintLayerStackingNode.h" |
| 58 #include "core/paint/PaintLayerStackingNodeIterator.h" | 58 #include "core/paint/PaintLayerStackingNodeIterator.h" |
| 59 #include "platform/graphics/CompositingReasons.h" | 59 #include "platform/graphics/CompositingReasons.h" |
| 60 #include "platform/graphics/SquashingDisallowedReasons.h" | 60 #include "platform/graphics/SquashingDisallowedReasons.h" |
| 61 #include "public/platform/WebBlendMode.h" | 61 #include "public/platform/WebBlendMode.h" |
| 62 #include "wtf/Allocator.h" | 62 #include "wtf/Allocator.h" |
| 63 #include "wtf/OwnPtr.h" | 63 #include "wtf/PtrUtil.h" |
| 64 #include <memory> |
| 64 | 65 |
| 65 namespace blink { | 66 namespace blink { |
| 66 | 67 |
| 67 class CompositedLayerMapping; | 68 class CompositedLayerMapping; |
| 68 class ComputedStyle; | 69 class ComputedStyle; |
| 69 class FilterEffectBuilder; | 70 class FilterEffectBuilder; |
| 70 class FilterOperations; | 71 class FilterOperations; |
| 71 class HitTestRequest; | 72 class HitTestRequest; |
| 72 class HitTestResult; | 73 class HitTestResult; |
| 73 class HitTestingTransformState; | 74 class HitTestingTransformState; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 92 TemporaryChange<CompositingQueryMode> m_disabler; | 93 TemporaryChange<CompositingQueryMode> m_disabler; |
| 93 }; | 94 }; |
| 94 | 95 |
| 95 struct PaintLayerRareData { | 96 struct PaintLayerRareData { |
| 96 PaintLayerRareData(); | 97 PaintLayerRareData(); |
| 97 ~PaintLayerRareData(); | 98 ~PaintLayerRareData(); |
| 98 | 99 |
| 99 // Our current relative position offset. | 100 // Our current relative position offset. |
| 100 LayoutSize offsetForInFlowPosition; | 101 LayoutSize offsetForInFlowPosition; |
| 101 | 102 |
| 102 OwnPtr<TransformationMatrix> transform; | 103 std::unique_ptr<TransformationMatrix> transform; |
| 103 | 104 |
| 104 // Pointer to the enclosing Layer that caused us to be paginated. It is 0 if
we are not paginated. | 105 // Pointer to the enclosing Layer that caused us to be paginated. It is 0 if
we are not paginated. |
| 105 // | 106 // |
| 106 // See LayoutMultiColumnFlowThread and | 107 // See LayoutMultiColumnFlowThread and |
| 107 // https://sites.google.com/a/chromium.org/dev/developers/design-documents/m
ulti-column-layout | 108 // https://sites.google.com/a/chromium.org/dev/developers/design-documents/m
ulti-column-layout |
| 108 // for more information about the multicol implementation. It's important to
understand the | 109 // for more information about the multicol implementation. It's important to
understand the |
| 109 // difference between flow thread coordinates and visual coordinates when wo
rking with multicol | 110 // difference between flow thread coordinates and visual coordinates when wo
rking with multicol |
| 110 // in Layer, since Layer is one of the few places where we have to worry abo
ut the | 111 // in Layer, since Layer is one of the few places where we have to worry abo
ut the |
| 111 // visual ones. Internally we try to use flow-thread coordinates whenever po
ssible. | 112 // visual ones. Internally we try to use flow-thread coordinates whenever po
ssible. |
| 112 PaintLayer* enclosingPaginationLayer; | 113 PaintLayer* enclosingPaginationLayer; |
| 113 | 114 |
| 114 // These compositing reasons are updated whenever style changes, not while u
pdating compositing layers. | 115 // These compositing reasons are updated whenever style changes, not while u
pdating compositing layers. |
| 115 // They should not be used to infer the compositing state of this layer. | 116 // They should not be used to infer the compositing state of this layer. |
| 116 CompositingReasons potentialCompositingReasonsFromStyle; | 117 CompositingReasons potentialCompositingReasonsFromStyle; |
| 117 | 118 |
| 118 // Once computed, indicates all that a layer needs to become composited usin
g the CompositingReasons enum bitfield. | 119 // Once computed, indicates all that a layer needs to become composited usin
g the CompositingReasons enum bitfield. |
| 119 CompositingReasons compositingReasons; | 120 CompositingReasons compositingReasons; |
| 120 | 121 |
| 121 // This captures reasons why a paint layer might be forced to be separately | 122 // This captures reasons why a paint layer might be forced to be separately |
| 122 // composited rather than sharing a backing with another layer. | 123 // composited rather than sharing a backing with another layer. |
| 123 SquashingDisallowedReasons squashingDisallowedReasons; | 124 SquashingDisallowedReasons squashingDisallowedReasons; |
| 124 | 125 |
| 125 // If the layer paints into its own backings, this keeps track of the backin
gs. | 126 // If the layer paints into its own backings, this keeps track of the backin
gs. |
| 126 // It's nullptr if the layer is not composited or paints into grouped backin
g. | 127 // It's nullptr if the layer is not composited or paints into grouped backin
g. |
| 127 OwnPtr<CompositedLayerMapping> compositedLayerMapping; | 128 std::unique_ptr<CompositedLayerMapping> compositedLayerMapping; |
| 128 | 129 |
| 129 // If the layer paints into grouped backing (i.e. squashed), this points to
the | 130 // If the layer paints into grouped backing (i.e. squashed), this points to
the |
| 130 // grouped CompositedLayerMapping. It's null if the layer is not composited
or | 131 // grouped CompositedLayerMapping. It's null if the layer is not composited
or |
| 131 // paints into its own backing. | 132 // paints into its own backing. |
| 132 CompositedLayerMapping* groupedMapping; | 133 CompositedLayerMapping* groupedMapping; |
| 133 | 134 |
| 134 OwnPtr<PaintLayerReflectionInfo> reflectionInfo; | 135 std::unique_ptr<PaintLayerReflectionInfo> reflectionInfo; |
| 135 | 136 |
| 136 Persistent<PaintLayerFilterInfo> filterInfo; | 137 Persistent<PaintLayerFilterInfo> filterInfo; |
| 137 | 138 |
| 138 // The accumulated subpixel offset of a composited layer's composited bounds
compared to absolute coordinates. | 139 // The accumulated subpixel offset of a composited layer's composited bounds
compared to absolute coordinates. |
| 139 LayoutSize subpixelAccumulation; | 140 LayoutSize subpixelAccumulation; |
| 140 }; | 141 }; |
| 141 | 142 |
| 142 // PaintLayer is an old object that handles lots of unrelated operations. | 143 // PaintLayer is an old object that handles lots of unrelated operations. |
| 143 // | 144 // |
| 144 // We want it to die at some point and be replaced by more focused objects, | 145 // We want it to die at some point and be replaced by more focused objects, |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 | 689 |
| 689 bool needsPaintPhaseDescendantBlockBackgrounds() const { return m_needsPaint
PhaseDescendantBlockBackgrounds; } | 690 bool needsPaintPhaseDescendantBlockBackgrounds() const { return m_needsPaint
PhaseDescendantBlockBackgrounds; } |
| 690 void setNeedsPaintPhaseDescendantBlockBackgrounds() { ASSERT(isSelfPaintingL
ayer()); m_needsPaintPhaseDescendantBlockBackgrounds = true; } | 691 void setNeedsPaintPhaseDescendantBlockBackgrounds() { ASSERT(isSelfPaintingL
ayer()); m_needsPaintPhaseDescendantBlockBackgrounds = true; } |
| 691 | 692 |
| 692 PaintTiming* paintTiming(); | 693 PaintTiming* paintTiming(); |
| 693 | 694 |
| 694 ClipRectsCache* clipRectsCache() const { return m_clipRectsCache.get(); } | 695 ClipRectsCache* clipRectsCache() const { return m_clipRectsCache.get(); } |
| 695 ClipRectsCache& ensureClipRectsCache() const | 696 ClipRectsCache& ensureClipRectsCache() const |
| 696 { | 697 { |
| 697 if (!m_clipRectsCache) | 698 if (!m_clipRectsCache) |
| 698 m_clipRectsCache = adoptPtr(new ClipRectsCache); | 699 m_clipRectsCache = wrapUnique(new ClipRectsCache); |
| 699 return *m_clipRectsCache; | 700 return *m_clipRectsCache; |
| 700 } | 701 } |
| 701 void clearClipRectsCache() const { m_clipRectsCache.reset(); } | 702 void clearClipRectsCache() const { m_clipRectsCache.reset(); } |
| 702 | 703 |
| 703 void dirty3DTransformedDescendantStatus(); | 704 void dirty3DTransformedDescendantStatus(); |
| 704 // Both updates the status, and returns true if descendants of this have 3d. | 705 // Both updates the status, and returns true if descendants of this have 3d. |
| 705 bool update3DTransformedDescendantStatus(); | 706 bool update3DTransformedDescendantStatus(); |
| 706 bool has3DTransformedDescendant() const { DCHECK(!m_3DTransformedDescendantS
tatusDirty); return m_has3DTransformedDescendant; } | 707 bool has3DTransformedDescendant() const { DCHECK(!m_3DTransformedDescendantS
tatusDirty); return m_has3DTransformedDescendant; } |
| 707 | 708 |
| 708 private: | 709 private: |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 void updateOrRemoveFilterClients(); | 771 void updateOrRemoveFilterClients(); |
| 771 | 772 |
| 772 void updatePaginationRecursive(bool needsPaginationUpdate = false); | 773 void updatePaginationRecursive(bool needsPaginationUpdate = false); |
| 773 void clearPaginationRecursive(); | 774 void clearPaginationRecursive(); |
| 774 | 775 |
| 775 void markCompositingContainerChainForNeedsRepaint(); | 776 void markCompositingContainerChainForNeedsRepaint(); |
| 776 | 777 |
| 777 PaintLayerRareData& ensureRareData() | 778 PaintLayerRareData& ensureRareData() |
| 778 { | 779 { |
| 779 if (!m_rareData) | 780 if (!m_rareData) |
| 780 m_rareData = adoptPtr(new PaintLayerRareData); | 781 m_rareData = wrapUnique(new PaintLayerRareData); |
| 781 return *m_rareData; | 782 return *m_rareData; |
| 782 } | 783 } |
| 783 | 784 |
| 784 void mergeNeedsPaintPhaseFlagsFrom(const PaintLayer& layer) | 785 void mergeNeedsPaintPhaseFlagsFrom(const PaintLayer& layer) |
| 785 { | 786 { |
| 786 m_needsPaintPhaseDescendantOutlines |= layer.m_needsPaintPhaseDescendant
Outlines; | 787 m_needsPaintPhaseDescendantOutlines |= layer.m_needsPaintPhaseDescendant
Outlines; |
| 787 m_needsPaintPhaseFloat |= layer.m_needsPaintPhaseFloat; | 788 m_needsPaintPhaseFloat |= layer.m_needsPaintPhaseFloat; |
| 788 m_needsPaintPhaseDescendantBlockBackgrounds |= layer.m_needsPaintPhaseDe
scendantBlockBackgrounds; | 789 m_needsPaintPhaseDescendantBlockBackgrounds |= layer.m_needsPaintPhaseDe
scendantBlockBackgrounds; |
| 789 } | 790 } |
| 790 | 791 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 IntSize m_size; | 871 IntSize m_size; |
| 871 | 872 |
| 872 // Cached normal flow values for absolute positioned elements with static le
ft/top values. | 873 // Cached normal flow values for absolute positioned elements with static le
ft/top values. |
| 873 LayoutUnit m_staticInlinePosition; | 874 LayoutUnit m_staticInlinePosition; |
| 874 LayoutUnit m_staticBlockPosition; | 875 LayoutUnit m_staticBlockPosition; |
| 875 | 876 |
| 876 // The first ancestor having a non visible overflow. | 877 // The first ancestor having a non visible overflow. |
| 877 const PaintLayer* m_ancestorOverflowLayer; | 878 const PaintLayer* m_ancestorOverflowLayer; |
| 878 | 879 |
| 879 AncestorDependentCompositingInputs m_ancestorDependentCompositingInputs; | 880 AncestorDependentCompositingInputs m_ancestorDependentCompositingInputs; |
| 880 OwnPtr<RareAncestorDependentCompositingInputs> m_rareAncestorDependentCompos
itingInputs; | 881 std::unique_ptr<RareAncestorDependentCompositingInputs> m_rareAncestorDepend
entCompositingInputs; |
| 881 | 882 |
| 882 Persistent<PaintLayerScrollableArea> m_scrollableArea; | 883 Persistent<PaintLayerScrollableArea> m_scrollableArea; |
| 883 | 884 |
| 884 mutable OwnPtr<ClipRectsCache> m_clipRectsCache; | 885 mutable std::unique_ptr<ClipRectsCache> m_clipRectsCache; |
| 885 | 886 |
| 886 OwnPtr<PaintLayerStackingNode> m_stackingNode; | 887 std::unique_ptr<PaintLayerStackingNode> m_stackingNode; |
| 887 | 888 |
| 888 IntSize m_previousScrollOffsetAccumulationForPainting; | 889 IntSize m_previousScrollOffsetAccumulationForPainting; |
| 889 RefPtr<ClipRects> m_previousPaintingClipRects; | 890 RefPtr<ClipRects> m_previousPaintingClipRects; |
| 890 LayoutRect m_previousPaintDirtyRect; | 891 LayoutRect m_previousPaintDirtyRect; |
| 891 | 892 |
| 892 OwnPtr<PaintLayerRareData> m_rareData; | 893 std::unique_ptr<PaintLayerRareData> m_rareData; |
| 893 | 894 |
| 894 DISPLAY_ITEM_CACHE_STATUS_IMPLEMENTATION | 895 DISPLAY_ITEM_CACHE_STATUS_IMPLEMENTATION |
| 895 }; | 896 }; |
| 896 | 897 |
| 897 } // namespace blink | 898 } // namespace blink |
| 898 | 899 |
| 899 #ifndef NDEBUG | 900 #ifndef NDEBUG |
| 900 // Outside the WebCore namespace for ease of invocation from gdb. | 901 // Outside the WebCore namespace for ease of invocation from gdb. |
| 901 void showLayerTree(const blink::PaintLayer*); | 902 void showLayerTree(const blink::PaintLayer*); |
| 902 void showLayerTree(const blink::LayoutObject*); | 903 void showLayerTree(const blink::LayoutObject*); |
| 903 #endif | 904 #endif |
| 904 | 905 |
| 905 #endif // Layer_h | 906 #endif // Layer_h |
| OLD | NEW |