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

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

Issue 2793993003: Make GeometryMapper fully static (Closed)
Patch Set: Created 3 years, 8 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void localToAncestorRectInternal( 66 void localToAncestorRectInternal(
67 const TransformPaintPropertyNode* localTransformNode, 67 const TransformPaintPropertyNode* localTransformNode,
68 const TransformPaintPropertyNode* ancestorTransformNode, 68 const TransformPaintPropertyNode* ancestorTransformNode,
69 FloatRect& rect, 69 FloatRect& rect,
70 bool& success) { 70 bool& success) {
71 geometryMapper->localToAncestorRectInternal( 71 geometryMapper->localToAncestorRectInternal(
72 localTransformNode, ancestorTransformNode, rect, success); 72 localTransformNode, ancestorTransformNode, rect, success);
73 } 73 }
74 74
75 private: 75 private:
76 void SetUp() override { geometryMapper = GeometryMapper::create(); }
77
78 void TearDown() override { geometryMapper.reset(); }
tasak 2017/04/04 07:40:26 I think, we still need this? Because this test use
79 }; 76 };
80 77
81 const static float kTestEpsilon = 1e-6; 78 const static float kTestEpsilon = 1e-6;
82 79
83 #define EXPECT_RECT_EQ(expected, actual) \ 80 #define EXPECT_RECT_EQ(expected, actual) \
84 do { \ 81 do { \
85 const FloatRect& actualRect = actual; \ 82 const FloatRect& actualRect = actual; \
86 EXPECT_TRUE(GeometryTest::ApproximatelyEqual(expected.x(), actualRect.x(), \ 83 EXPECT_TRUE(GeometryTest::ApproximatelyEqual(expected.x(), actualRect.x(), \
87 kTestEpsilon)) \ 84 kTestEpsilon)) \
88 << "actual: " << actualRect.x() << ", expected: " << expected.x(); \ 85 << "actual: " << actualRect.x() << ", expected: " << expected.x(); \
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 FloatRect input(100, 100, 50, 50); 855 FloatRect input(100, 100, 50, 50);
859 // Reflection is at (50, 100, 50, 50). 856 // Reflection is at (50, 100, 50, 50).
860 FloatRect output(50, 100, 100, 50); 857 FloatRect output(50, 100, 100, 50);
861 858
862 bool hasRadius = false; 859 bool hasRadius = false;
863 CHECK_MAPPINGS(input, output, input, TransformationMatrix(), FloatClipRect(), 860 CHECK_MAPPINGS(input, output, input, TransformationMatrix(), FloatClipRect(),
864 localState, PropertyTreeState::root(), hasRadius); 861 localState, PropertyTreeState::root(), hasRadius);
865 } 862 }
866 863
867 } // namespace blink 864 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698