| 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 29 matching lines...) Expand all Loading... |
| 40 return GeometryMapper::leastCommonAncestor(a, b); | 40 return GeometryMapper::leastCommonAncestor(a, b); |
| 41 } | 41 } |
| 42 | 42 |
| 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(nullptr, 1.0); | 50 rootEffectNode = EffectPaintPropertyNode::create( |
| 51 nullptr, rootTransformNode, rootClipNode, CompositorFilterOperations(), |
| 52 1.0); |
| 51 rootScrollNode = ScrollPaintPropertyNode::create( | 53 rootScrollNode = ScrollPaintPropertyNode::create( |
| 52 nullptr, rootTransformNode, IntSize(), IntSize(), false, false); | 54 nullptr, rootTransformNode, IntSize(), IntSize(), false, false); |
| 53 geometryMapper = wrapUnique(new GeometryMapper()); | 55 geometryMapper = wrapUnique(new GeometryMapper()); |
| 54 } | 56 } |
| 55 | 57 |
| 56 void TearDown() override { geometryMapper.reset(); } | 58 void TearDown() override { geometryMapper.reset(); } |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 const static float kTestEpsilon = 1e-6; | 61 const static float kTestEpsilon = 1e-6; |
| 60 | 62 |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 EXPECT_EQ(rootPropertyTreeState().transform(), | 579 EXPECT_EQ(rootPropertyTreeState().transform(), |
| 578 leastCommonAncestor(childOfChild2.get(), | 580 leastCommonAncestor(childOfChild2.get(), |
| 579 rootPropertyTreeState().transform())); | 581 rootPropertyTreeState().transform())); |
| 580 EXPECT_EQ(child2, leastCommonAncestor(childOfChild2.get(), child2.get())); | 582 EXPECT_EQ(child2, leastCommonAncestor(childOfChild2.get(), child2.get())); |
| 581 | 583 |
| 582 EXPECT_EQ(rootPropertyTreeState().transform(), | 584 EXPECT_EQ(rootPropertyTreeState().transform(), |
| 583 leastCommonAncestor(child1.get(), child2.get())); | 585 leastCommonAncestor(child1.get(), child2.get())); |
| 584 } | 586 } |
| 585 | 587 |
| 586 } // namespace blink | 588 } // namespace blink |
| OLD | NEW |