OLD | NEW |
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/paint/ClipPaintPropertyNode.h" | 9 #include "platform/graphics/paint/ClipPaintPropertyNode.h" |
10 #include "platform/graphics/paint/EffectPaintPropertyNode.h" | 10 #include "platform/graphics/paint/EffectPaintPropertyNode.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void SetUp() override { | 44 void SetUp() override { |
45 rootTransformNode = TransformPaintPropertyNode::create( | 45 rootTransformNode = TransformPaintPropertyNode::create( |
46 nullptr, TransformationMatrix(), FloatPoint3D()); | 46 nullptr, TransformationMatrix(), FloatPoint3D()); |
47 rootClipNode = ClipPaintPropertyNode::create( | 47 rootClipNode = ClipPaintPropertyNode::create( |
48 nullptr, rootTransformNode, | 48 nullptr, rootTransformNode, |
49 FloatRoundedRect(LayoutRect::infiniteIntRect())); | 49 FloatRoundedRect(LayoutRect::infiniteIntRect())); |
50 rootEffectNode = EffectPaintPropertyNode::create( | 50 rootEffectNode = EffectPaintPropertyNode::create( |
51 nullptr, rootTransformNode, rootClipNode, CompositorFilterOperations(), | 51 nullptr, rootTransformNode, rootClipNode, CompositorFilterOperations(), |
52 1.0); | 52 1.0); |
53 rootScrollNode = ScrollPaintPropertyNode::create( | 53 rootScrollNode = ScrollPaintPropertyNode::create( |
54 nullptr, rootTransformNode, IntSize(), IntSize(), false, false); | 54 nullptr, rootTransformNode, IntSize(), IntSize(), false, false, 0); |
55 geometryMapper = makeUnique<GeometryMapper>(); | 55 geometryMapper = makeUnique<GeometryMapper>(); |
56 } | 56 } |
57 | 57 |
58 void TearDown() override { geometryMapper.reset(); } | 58 void TearDown() override { geometryMapper.reset(); } |
59 }; | 59 }; |
60 | 60 |
61 const static float kTestEpsilon = 1e-6; | 61 const static float kTestEpsilon = 1e-6; |
62 | 62 |
63 #define EXPECT_RECT_EQ(expected, actual) \ | 63 #define EXPECT_RECT_EQ(expected, actual) \ |
64 do { \ | 64 do { \ |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 EXPECT_EQ(rootPropertyTreeState().transform(), | 579 EXPECT_EQ(rootPropertyTreeState().transform(), |
580 leastCommonAncestor(childOfChild2.get(), | 580 leastCommonAncestor(childOfChild2.get(), |
581 rootPropertyTreeState().transform())); | 581 rootPropertyTreeState().transform())); |
582 EXPECT_EQ(child2, leastCommonAncestor(childOfChild2.get(), child2.get())); | 582 EXPECT_EQ(child2, leastCommonAncestor(childOfChild2.get(), child2.get())); |
583 | 583 |
584 EXPECT_EQ(rootPropertyTreeState().transform(), | 584 EXPECT_EQ(rootPropertyTreeState().transform(), |
585 leastCommonAncestor(child1.get(), child2.get())); | 585 leastCommonAncestor(child1.get(), child2.get())); |
586 } | 586 } |
587 | 587 |
588 } // namespace blink | 588 } // namespace blink |
OLD | NEW |