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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h

Issue 2604083002: Remove infinite clip in PaintArtifactCompositor. (Closed)
Patch Set: none Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GeometryMapper_h 5 #ifndef GeometryMapper_h
6 #define GeometryMapper_h 6 #define GeometryMapper_h
7 7
8 #include "platform/geometry/FloatRect.h" 8 #include "platform/geometry/FloatRect.h"
9 #include "platform/graphics/paint/PropertyTreeState.h" 9 #include "platform/graphics/paint/PropertyTreeState.h"
10 #include "platform/transforms/TransformationMatrix.h" 10 #include "platform/transforms/TransformationMatrix.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 bool& success); 118 bool& success);
119 119
120 // Returns the matrix used in |LocalToAncestorRect|. Sets |success| to false 120 // Returns the matrix used in |LocalToAncestorRect|. Sets |success| to false
121 // iff |localTransformNode| is not equal to or a descendant of 121 // iff |localTransformNode| is not equal to or a descendant of
122 // |ancestorState.transform|. 122 // |ancestorState.transform|.
123 const TransformationMatrix& localToAncestorMatrix( 123 const TransformationMatrix& localToAncestorMatrix(
124 const TransformPaintPropertyNode* localTransformNode, 124 const TransformPaintPropertyNode* localTransformNode,
125 const PropertyTreeState& ancestorState, 125 const PropertyTreeState& ancestorState,
126 bool& success); 126 bool& success);
127 127
128 // Returns the "clip visual rect" between |localTransformState| and
129 // |ancestorState|. See above for the definition of "clip visual rect".
130 FloatRect localToAncestorClipRect(
wkorman 2016/12/29 19:20:40 nit: this is only unit tested indirectly, may be w
chrishtr 2016/12/29 19:34:21 Good idea. Done.
131 const PropertyTreeState& localTransformState,
132 const PropertyTreeState& ancestorState,
133 bool& success);
134
128 private: 135 private:
129 // Used by mapToVisualRectInDestinationSpace() after fast mapping (assuming 136 // Used by mapToVisualRectInDestinationSpace() after fast mapping (assuming
130 // destination is an ancestor of source) failed. 137 // destination is an ancestor of source) failed.
131 FloatRect slowMapToVisualRectInDestinationSpace( 138 FloatRect slowMapToVisualRectInDestinationSpace(
132 const FloatRect&, 139 const FloatRect&,
133 const PropertyTreeState& sourceState, 140 const PropertyTreeState& sourceState,
134 const PropertyTreeState& destinationState, 141 const PropertyTreeState& destinationState,
135 bool& success); 142 bool& success);
136 143
137 // Used by mapRectToDestinationSpace() after fast mapping (assuming 144 // Used by mapRectToDestinationSpace() after fast mapping (assuming
138 // destination is an ancestor of source) failed. 145 // destination is an ancestor of source) failed.
139 FloatRect slowMapRectToDestinationSpace( 146 FloatRect slowMapRectToDestinationSpace(
140 const FloatRect&, 147 const FloatRect&,
141 const PropertyTreeState& sourceState, 148 const PropertyTreeState& sourceState,
142 const PropertyTreeState& destinationState, 149 const PropertyTreeState& destinationState,
143 bool& success); 150 bool& success);
144 151
145 // Returns the "clip visual rect" between |localTransformState| and
146 // |ancestorState|. See above for the definition of "clip visual rect".
147 FloatRect localToAncestorClipRect(
148 const PropertyTreeState& localTransformState,
149 const PropertyTreeState& ancestorState,
150 bool& success);
151
152 // Returns the precomputed data if already set, or adds and memoizes a new 152 // Returns the precomputed data if already set, or adds and memoizes a new
153 // PrecomputedDataForAncestor otherwise. 153 // PrecomputedDataForAncestor otherwise.
154 PrecomputedDataForAncestor& getPrecomputedDataForAncestor( 154 PrecomputedDataForAncestor& getPrecomputedDataForAncestor(
155 const PropertyTreeState&); 155 const PropertyTreeState&);
156 156
157 // Returns the least common ancestor in the transform tree. 157 // Returns the least common ancestor in the transform tree.
158 static const TransformPaintPropertyNode* leastCommonAncestor( 158 static const TransformPaintPropertyNode* leastCommonAncestor(
159 const TransformPaintPropertyNode*, 159 const TransformPaintPropertyNode*,
160 const TransformPaintPropertyNode*); 160 const TransformPaintPropertyNode*);
161 161
162 friend class GeometryMapperTest; 162 friend class GeometryMapperTest;
163 163
164 HashMap<const TransformPaintPropertyNode*, 164 HashMap<const TransformPaintPropertyNode*,
165 std::unique_ptr<PrecomputedDataForAncestor>> 165 std::unique_ptr<PrecomputedDataForAncestor>>
166 m_data; 166 m_data;
167 167
168 const TransformationMatrix m_identity; 168 const TransformationMatrix m_identity;
169 169
170 DISALLOW_COPY_AND_ASSIGN(GeometryMapper); 170 DISALLOW_COPY_AND_ASSIGN(GeometryMapper);
171 }; 171 };
172 172
173 } // namespace blink 173 } // namespace blink
174 174
175 #endif // GeometryMapper_h 175 #endif // GeometryMapper_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698