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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp

Issue 2671853003: [SPInvalidation] Use GeometryMapper in PaintLayerClipper for paint. (Closed)
Patch Set: Merge branch 'master' into paintlayerclipper Created 3 years, 10 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 // 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 #include "platform/graphics/paint/GeometryMapper.h" 5 #include "platform/graphics/paint/GeometryMapper.h"
6 6
7 #include "platform/geometry/GeometryTestHelpers.h" 7 #include "platform/geometry/GeometryTestHelpers.h"
8 #include "platform/geometry/LayoutRect.h" 8 #include "platform/geometry/LayoutRect.h"
9 #include "platform/graphics/BoxReflection.h" 9 #include "platform/graphics/BoxReflection.h"
10 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" 10 #include "platform/graphics/filters/SkiaImageFilterBuilder.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 FloatRect localToAncestorRectInternal( 72 FloatRect localToAncestorRectInternal(
73 const FloatRect& rect, 73 const FloatRect& rect,
74 const TransformPaintPropertyNode* localTransformNode, 74 const TransformPaintPropertyNode* localTransformNode,
75 const TransformPaintPropertyNode* ancestorTransformNode, 75 const TransformPaintPropertyNode* ancestorTransformNode,
76 bool& success) { 76 bool& success) {
77 return geometryMapper->localToAncestorRectInternal( 77 return geometryMapper->localToAncestorRectInternal(
78 rect, localTransformNode, ancestorTransformNode, success); 78 rect, localTransformNode, ancestorTransformNode, success);
79 } 79 }
80 80
81 private: 81 private:
82 void SetUp() override { 82 void SetUp() override { geometryMapper = GeometryMapper::create(); }
83 geometryMapper = WTF::makeUnique<GeometryMapper>();
84 }
85 83
86 void TearDown() override { geometryMapper.reset(); } 84 void TearDown() override { geometryMapper.reset(); }
87 }; 85 };
88 86
89 const static float kTestEpsilon = 1e-6; 87 const static float kTestEpsilon = 1e-6;
90 88
91 #define EXPECT_RECT_EQ(expected, actual) \ 89 #define EXPECT_RECT_EQ(expected, actual) \
92 do { \ 90 do { \
93 const FloatRect& actualRect = actual; \ 91 const FloatRect& actualRect = actual; \
94 EXPECT_TRUE(GeometryTest::ApproximatelyEqual(expected.x(), actualRect.x(), \ 92 EXPECT_TRUE(GeometryTest::ApproximatelyEqual(expected.x(), actualRect.x(), \
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 // Reflection is at (50, 100, 50, 50). 767 // Reflection is at (50, 100, 50, 50).
770 FloatRect output(50, 100, 100, 50); 768 FloatRect output(50, 100, 100, 50);
771 769
772 bool hasRadius = false; 770 bool hasRadius = false;
773 CHECK_MAPPINGS(input, output, input, TransformationMatrix(), 771 CHECK_MAPPINGS(input, output, input, TransformationMatrix(),
774 ClipPaintPropertyNode::root()->clipRect().rect(), localState, 772 ClipPaintPropertyNode::root()->clipRect().rect(), localState,
775 rootPropertyTreeState(), hasRadius); 773 rootPropertyTreeState(), hasRadius);
776 } 774 }
777 775
778 } // namespace blink 776 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698