| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 private: | 43 private: |
| 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 = |
| 54 nullptr, rootTransformNode, IntSize(), IntSize(), false, false); | 54 ScrollPaintPropertyNode::create(nullptr, rootTransformNode, IntSize(), |
| 55 IntSize(), false, false, false, false); |
| 55 geometryMapper = makeUnique<GeometryMapper>(); | 56 geometryMapper = makeUnique<GeometryMapper>(); |
| 56 } | 57 } |
| 57 | 58 |
| 58 void TearDown() override { geometryMapper.reset(); } | 59 void TearDown() override { geometryMapper.reset(); } |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 const static float kTestEpsilon = 1e-6; | 62 const static float kTestEpsilon = 1e-6; |
| 62 | 63 |
| 63 #define EXPECT_RECT_EQ(expected, actual) \ | 64 #define EXPECT_RECT_EQ(expected, actual) \ |
| 64 do { \ | 65 do { \ |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 EXPECT_EQ(rootPropertyTreeState().transform(), | 580 EXPECT_EQ(rootPropertyTreeState().transform(), |
| 580 leastCommonAncestor(childOfChild2.get(), | 581 leastCommonAncestor(childOfChild2.get(), |
| 581 rootPropertyTreeState().transform())); | 582 rootPropertyTreeState().transform())); |
| 582 EXPECT_EQ(child2, leastCommonAncestor(childOfChild2.get(), child2.get())); | 583 EXPECT_EQ(child2, leastCommonAncestor(childOfChild2.get(), child2.get())); |
| 583 | 584 |
| 584 EXPECT_EQ(rootPropertyTreeState().transform(), | 585 EXPECT_EQ(rootPropertyTreeState().transform(), |
| 585 leastCommonAncestor(child1.get(), child2.get())); | 586 leastCommonAncestor(child1.get(), child2.get())); |
| 586 } | 587 } |
| 587 | 588 |
| 588 } // namespace blink | 589 } // namespace blink |
| OLD | NEW |