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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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/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
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
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 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 709 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 776
776 void updatePaginationRecursive(bool needsPaginationUpdate = false); 777 void updatePaginationRecursive(bool needsPaginationUpdate = false);
777 void clearPaginationRecursive(); 778 void clearPaginationRecursive();
778 779
779 void setNeedsRepaintInternal(); 780 void setNeedsRepaintInternal();
780 void markCompositingContainerChainForNeedsRepaint(); 781 void markCompositingContainerChainForNeedsRepaint();
781 782
782 PaintLayerRareData& ensureRareData() 783 PaintLayerRareData& ensureRareData()
783 { 784 {
784 if (!m_rareData) 785 if (!m_rareData)
785 m_rareData = adoptPtr(new PaintLayerRareData); 786 m_rareData = wrapUnique(new PaintLayerRareData);
786 return *m_rareData; 787 return *m_rareData;
787 } 788 }
788 789
789 void mergeNeedsPaintPhaseFlagsFrom(const PaintLayer& layer) 790 void mergeNeedsPaintPhaseFlagsFrom(const PaintLayer& layer)
790 { 791 {
791 m_needsPaintPhaseDescendantOutlines |= layer.m_needsPaintPhaseDescendant Outlines; 792 m_needsPaintPhaseDescendantOutlines |= layer.m_needsPaintPhaseDescendant Outlines;
792 m_needsPaintPhaseFloat |= layer.m_needsPaintPhaseFloat; 793 m_needsPaintPhaseFloat |= layer.m_needsPaintPhaseFloat;
793 m_needsPaintPhaseDescendantBlockBackgrounds |= layer.m_needsPaintPhaseDe scendantBlockBackgrounds; 794 m_needsPaintPhaseDescendantBlockBackgrounds |= layer.m_needsPaintPhaseDe scendantBlockBackgrounds;
794 } 795 }
795 796
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 IntSize m_size; 876 IntSize m_size;
876 877
877 // Cached normal flow values for absolute positioned elements with static le ft/top values. 878 // Cached normal flow values for absolute positioned elements with static le ft/top values.
878 LayoutUnit m_staticInlinePosition; 879 LayoutUnit m_staticInlinePosition;
879 LayoutUnit m_staticBlockPosition; 880 LayoutUnit m_staticBlockPosition;
880 881
881 // The first ancestor having a non visible overflow. 882 // The first ancestor having a non visible overflow.
882 const PaintLayer* m_ancestorOverflowLayer; 883 const PaintLayer* m_ancestorOverflowLayer;
883 884
884 AncestorDependentCompositingInputs m_ancestorDependentCompositingInputs; 885 AncestorDependentCompositingInputs m_ancestorDependentCompositingInputs;
885 OwnPtr<RareAncestorDependentCompositingInputs> m_rareAncestorDependentCompos itingInputs; 886 std::unique_ptr<RareAncestorDependentCompositingInputs> m_rareAncestorDepend entCompositingInputs;
886 887
887 Persistent<PaintLayerScrollableArea> m_scrollableArea; 888 Persistent<PaintLayerScrollableArea> m_scrollableArea;
888 889
889 mutable OwnPtr<ClipRectsCache> m_clipRectsCache; 890 mutable std::unique_ptr<ClipRectsCache> m_clipRectsCache;
890 891
891 OwnPtr<PaintLayerStackingNode> m_stackingNode; 892 std::unique_ptr<PaintLayerStackingNode> m_stackingNode;
892 893
893 IntSize m_previousScrollOffsetAccumulationForPainting; 894 IntSize m_previousScrollOffsetAccumulationForPainting;
894 RefPtr<ClipRects> m_previousPaintingClipRects; 895 RefPtr<ClipRects> m_previousPaintingClipRects;
895 LayoutRect m_previousPaintDirtyRect; 896 LayoutRect m_previousPaintDirtyRect;
896 897
897 OwnPtr<PaintLayerRareData> m_rareData; 898 std::unique_ptr<PaintLayerRareData> m_rareData;
898 899
899 DISPLAY_ITEM_CACHE_STATUS_IMPLEMENTATION 900 DISPLAY_ITEM_CACHE_STATUS_IMPLEMENTATION
900 }; 901 };
901 902
902 } // namespace blink 903 } // namespace blink
903 904
904 #ifndef NDEBUG 905 #ifndef NDEBUG
905 // Outside the WebCore namespace for ease of invocation from gdb. 906 // Outside the WebCore namespace for ease of invocation from gdb.
906 void showLayerTree(const blink::PaintLayer*); 907 void showLayerTree(const blink::PaintLayer*);
907 void showLayerTree(const blink::LayoutObject*); 908 void showLayerTree(const blink::LayoutObject*);
908 #endif 909 #endif
909 910
910 #endif // Layer_h 911 #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