Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.h

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

Powered by Google App Engine
This is Rietveld 408576698