| Index: third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
|
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
|
| index c5a8ec363590b631f85f1104088fa28416094cbc..9b1fff2b6638efb371ffc52789a749090fb94665 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
|
| +++ b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
|
| @@ -19,10 +19,6 @@
|
| // NOTE: A GeometryMapper object is only valid for property trees that do not
|
| // change. If any mutation occurs, a new GeometryMapper object must be allocated
|
| // corresponding to the new state.
|
| -//
|
| -// ** WARNING** Callers to the methods below may not assume that any const
|
| -// references returned remain const across multiple calls into GeometryMapper.
|
| -// If needed, callers must store local copies of the return values.
|
| //
|
| // Design document: http://bit.ly/28P4FDA
|
| //
|
| @@ -48,20 +44,17 @@
|
| //
|
| // DCHECK fails if the clip of |destinationState| is not an ancestor of the
|
| // clip of |sourceState|, or the inverse transform is not invertible.
|
| - //
|
| - // |mappingRect| is both input and output.
|
| - void sourceToDestinationVisualRect(const PropertyTreeState& sourceState,
|
| - const PropertyTreeState& destinationState,
|
| - FloatRect& mappingRect);
|
| + FloatClipRect sourceToDestinationVisualRect(
|
| + const FloatRect&,
|
| + const PropertyTreeState& sourceState,
|
| + const PropertyTreeState& destinationState);
|
|
|
| // Same as sourceToDestinationVisualRect() except that only transforms are
|
| // applied.
|
| - //
|
| - // |mappingRect| is both input and output.
|
| - void sourceToDestinationRect(
|
| + FloatRect sourceToDestinationRect(
|
| + const FloatRect&,
|
| const TransformPaintPropertyNode* sourceTransformNode,
|
| - const TransformPaintPropertyNode* destinationTransformNode,
|
| - FloatRect& mappingRect);
|
| + const TransformPaintPropertyNode* destinationTransformNode);
|
|
|
| // Maps from a rect in |localTransformSpace| to its visual rect in
|
| // |ancestorState|. This is computed by multiplying the rect by its combined
|
| @@ -75,11 +68,10 @@
|
| // DCHECK fails if any of the paint property tree nodes in
|
| // |localTransformState| are not equal to or a descendant of that in
|
| // |ancestorState|.
|
| - //
|
| - // |mappingRect| is both input and output.
|
| - void localToAncestorVisualRect(const PropertyTreeState& localTransformState,
|
| - const PropertyTreeState& ancestorState,
|
| - FloatRect& mappingRect);
|
| + FloatClipRect localToAncestorVisualRect(
|
| + const FloatRect&,
|
| + const PropertyTreeState& localTransformState,
|
| + const PropertyTreeState& ancestorState);
|
|
|
| // Maps from a rect in |localTransformNode| space to its transformed rect in
|
| // |ancestorTransformNode| space. This is computed by multiplying the rect by
|
| @@ -88,12 +80,10 @@
|
| //
|
| // DCHECK fails if |localTransformNode| is not equal to or a descendant of
|
| // |ancestorTransformNode|.
|
| - //
|
| - //|mappingRect| is both input and output.
|
| - void localToAncestorRect(
|
| + FloatRect localToAncestorRect(
|
| + const FloatRect&,
|
| const TransformPaintPropertyNode* localTransformNode,
|
| - const TransformPaintPropertyNode* ancestorTransformNode,
|
| - FloatRect& mappingRect);
|
| + const TransformPaintPropertyNode* ancestorTransformNode);
|
|
|
| // Maps from a rect in |ancestorTransformNode| space to its transformed rect
|
| // in |localTransformNode| space. This is computed by multiplying the rect by
|
| @@ -103,12 +93,10 @@
|
| // DCHECK fails if the combined transform is not invertible, or
|
| // |localTransformNode| is not equal to or a descendant of
|
| // |ancestorTransformNode|.
|
| - //
|
| - // |mappingRect| is both input and output.
|
| - void ancestorToLocalRect(
|
| + FloatRect ancestorToLocalRect(
|
| + const FloatRect&,
|
| const TransformPaintPropertyNode* ancestorTransformNode,
|
| - const TransformPaintPropertyNode* localTransformNode,
|
| - FloatRect& mappingRect);
|
| + const TransformPaintPropertyNode* localTransformNode);
|
|
|
| // Returns the matrix used in |LocalToAncestorRect|. DCHECK fails iff
|
| // |localTransformNode| is not equal to or a descendant of
|
| @@ -125,7 +113,7 @@
|
|
|
| // Like localToAncestorClipRect, except it can handle destination transform
|
| // spaces which are not direct ancestors of the source transform space.
|
| - const FloatClipRect& sourceToDestinationClipRect(
|
| + FloatClipRect sourceToDestinationClipRect(
|
| const PropertyTreeState& sourceState,
|
| const PropertyTreeState& destinationState);
|
|
|
| @@ -145,22 +133,22 @@
|
| // successful on return. See comments of the public functions for failure
|
| // conditions.
|
|
|
| - void sourceToDestinationVisualRectInternal(
|
| + FloatClipRect sourceToDestinationVisualRectInternal(
|
| + const FloatRect&,
|
| const PropertyTreeState& sourceState,
|
| const PropertyTreeState& destinationState,
|
| - FloatRect& mappingRect,
|
| bool& success);
|
|
|
| - void localToAncestorVisualRectInternal(
|
| + FloatClipRect localToAncestorVisualRectInternal(
|
| + const FloatRect&,
|
| const PropertyTreeState& localTransformState,
|
| const PropertyTreeState& ancestorState,
|
| - FloatRect& mappingRect,
|
| bool& success);
|
|
|
| - void localToAncestorRectInternal(
|
| + FloatRect localToAncestorRectInternal(
|
| + const FloatRect&,
|
| const TransformPaintPropertyNode* localTransformNode,
|
| const TransformPaintPropertyNode* ancestorTransformNode,
|
| - FloatRect&,
|
| bool& success);
|
|
|
| const TransformationMatrix& localToAncestorMatrixInternal(
|
| @@ -174,25 +162,22 @@
|
| const TransformPaintPropertyNode* ancestorTransform,
|
| bool& success);
|
|
|
| - const FloatClipRect& sourceToDestinationClipRectInternal(
|
| + FloatClipRect sourceToDestinationClipRectInternal(
|
| const PropertyTreeState& sourceState,
|
| const PropertyTreeState& destinationState,
|
| bool& success);
|
|
|
| - void slowLocalToAncestorVisualRectWithEffects(
|
| + FloatClipRect slowLocalToAncestorVisualRectWithEffects(
|
| + const FloatRect&,
|
| const PropertyTreeState& localState,
|
| const PropertyTreeState& ancestorState,
|
| - FloatRect& mappingRect,
|
| bool& success);
|
|
|
| friend class GeometryMapperTest;
|
| friend class PaintLayerClipperTest;
|
|
|
| - // These are used to represent various return values of the above
|
| - // methods.
|
| const TransformationMatrix m_identity;
|
| const FloatClipRect m_infiniteClip;
|
| - FloatClipRect m_tempRect;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(GeometryMapper);
|
| };
|
|
|