| 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/BoxReflection.h" | 9 #include "platform/graphics/BoxReflection.h" |
| 10 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" | 10 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 geometryMapper->sourceToDestinationRect(transform1.get(), transform2.get(), | 733 geometryMapper->sourceToDestinationRect(transform1.get(), transform2.get(), |
| 734 result); | 734 result); |
| 735 EXPECT_RECT_EQ(expected, result); | 735 EXPECT_RECT_EQ(expected, result); |
| 736 | 736 |
| 737 // Test map from transform2AndClipState to transform1State. | 737 // Test map from transform2AndClipState to transform1State. |
| 738 FloatRect expectedUnclipped = | 738 FloatRect expectedUnclipped = |
| 739 rotateTransform1.inverse().mapRect(rotateTransform2.mapRect(input)); | 739 rotateTransform1.inverse().mapRect(rotateTransform2.mapRect(input)); |
| 740 FloatRect expectedClipped = rotateTransform1.inverse().mapRect( | 740 FloatRect expectedClipped = rotateTransform1.inverse().mapRect( |
| 741 rotateTransform2.mapRect(FloatRect(10, 10, 70, 70))); | 741 rotateTransform2.mapRect(FloatRect(10, 10, 70, 70))); |
| 742 | 742 |
| 743 // sourceToDestinationVisualRect ignores clip from the common ancestor to | 743 // sourceToDestinationVisualRect ignores clipt from the common ancestor to |
| 744 // destination. | 744 // destination. |
| 745 result = input; | 745 result = input; |
| 746 geometryMapper->sourceToDestinationVisualRect(transform2AndClipState, | 746 geometryMapper->sourceToDestinationVisualRect(transform2AndClipState, |
| 747 transform1State, result); | 747 transform1State, result); |
| 748 EXPECT_RECT_EQ(expectedClipped, result); | 748 EXPECT_RECT_EQ(expectedClipped, result); |
| 749 | 749 |
| 750 // sourceToDestinationRect applies transforms only. | 750 // sourceToDestinationRect applies transforms only. |
| 751 result = input; | 751 result = input; |
| 752 geometryMapper->sourceToDestinationRect(transform2.get(), transform1.get(), | 752 geometryMapper->sourceToDestinationRect(transform2.get(), transform1.get(), |
| 753 result); | 753 result); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 FloatRect input(100, 100, 50, 50); | 858 FloatRect input(100, 100, 50, 50); |
| 859 // Reflection is at (50, 100, 50, 50). | 859 // Reflection is at (50, 100, 50, 50). |
| 860 FloatRect output(50, 100, 100, 50); | 860 FloatRect output(50, 100, 100, 50); |
| 861 | 861 |
| 862 bool hasRadius = false; | 862 bool hasRadius = false; |
| 863 CHECK_MAPPINGS(input, output, input, TransformationMatrix(), FloatClipRect(), | 863 CHECK_MAPPINGS(input, output, input, TransformationMatrix(), FloatClipRect(), |
| 864 localState, PropertyTreeState::root(), hasRadius); | 864 localState, PropertyTreeState::root(), hasRadius); |
| 865 } | 865 } |
| 866 | 866 |
| 867 } // namespace blink | 867 } // namespace blink |
| OLD | NEW |