| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/layout/LayoutTestHelper.h" | 5 #include "core/layout/LayoutTestHelper.h" |
| 6 #include "core/layout/LayoutView.h" | 6 #include "core/layout/LayoutView.h" |
| 7 #include "core/layout/PaintInvalidationState.h" | 7 #include "core/layout/PaintInvalidationState.h" |
| 8 #include "core/paint/PaintLayer.h" | 8 #include "core/paint/PaintLayer.h" |
| 9 #include "core/paint/PaintPropertyTreePrinter.h" | 9 #include "core/paint/PaintPropertyTreePrinter.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 const LayoutBoxModelObject& ancestor, | 34 const LayoutBoxModelObject& ancestor, |
| 35 const LayoutRect& localRect, | 35 const LayoutRect& localRect, |
| 36 const LayoutRect& expectedVisualRect, | 36 const LayoutRect& expectedVisualRect, |
| 37 bool adjustForBacking = false) { | 37 bool adjustForBacking = false) { |
| 38 LayoutRect slowMapRect = localRect; | 38 LayoutRect slowMapRect = localRect; |
| 39 object.mapToVisualRectInAncestorSpace(&ancestor, slowMapRect); | 39 object.mapToVisualRectInAncestorSpace(&ancestor, slowMapRect); |
| 40 if (slowMapRect.isEmpty() && object.visualRect().isEmpty()) | 40 if (slowMapRect.isEmpty() && object.visualRect().isEmpty()) |
| 41 return; | 41 return; |
| 42 | 42 |
| 43 FloatRect geometryMapperRect(localRect); | 43 FloatRect geometryMapperRect(localRect); |
| 44 if (object.paintProperties()) { | 44 if (object.paintProperties() || object.localBorderBoxProperties()) { |
| 45 geometryMapperRect.moveBy(FloatPoint(object.paintOffset())); | 45 geometryMapperRect.moveBy(FloatPoint(object.paintOffset())); |
| 46 document().view()->geometryMapper().sourceToDestinationVisualRect( | 46 document().view()->geometryMapper().sourceToDestinationVisualRect( |
| 47 *object.paintProperties()->localBorderBoxProperties(), | 47 *object.localBorderBoxProperties(), *ancestor.contentsProperties(), |
| 48 *ancestor.paintProperties()->contentsProperties(), | |
| 49 geometryMapperRect); | 48 geometryMapperRect); |
| 50 geometryMapperRect.moveBy(-FloatPoint(ancestor.paintOffset())); | 49 geometryMapperRect.moveBy(-FloatPoint(ancestor.paintOffset())); |
| 51 } | 50 } |
| 52 | 51 |
| 53 // The following condition can be false if paintInvalidationContainer is | 52 // The following condition can be false if paintInvalidationContainer is |
| 54 // a LayoutView and compositing is not enabled. | 53 // a LayoutView and compositing is not enabled. |
| 55 if (adjustForBacking && ancestor.isPaintInvalidationContainer()) { | 54 if (adjustForBacking && ancestor.isPaintInvalidationContainer()) { |
| 56 PaintLayer::mapRectInPaintInvalidationContainerToBacking(ancestor, | 55 PaintLayer::mapRectInPaintInvalidationContainerToBacking(ancestor, |
| 57 slowMapRect); | 56 slowMapRect); |
| 58 LayoutRect temp(geometryMapperRect); | 57 LayoutRect temp(geometryMapperRect); |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 // getTransformfromContainter includes transform and perspective matrix | 823 // getTransformfromContainter includes transform and perspective matrix |
| 825 // of the container. | 824 // of the container. |
| 826 target->getTransformFromContainer(container, LayoutSize(), targetMatrix); | 825 target->getTransformFromContainer(container, LayoutSize(), targetMatrix); |
| 827 matrix *= targetMatrix; | 826 matrix *= targetMatrix; |
| 828 LayoutRect output(matrix.mapRect(FloatRect(originalRect))); | 827 LayoutRect output(matrix.mapRect(FloatRect(originalRect))); |
| 829 | 828 |
| 830 checkVisualRect(*target, *target->view(), originalRect, output); | 829 checkVisualRect(*target, *target->view(), originalRect, output); |
| 831 } | 830 } |
| 832 | 831 |
| 833 } // namespace blink | 832 } // namespace blink |
| OLD | NEW |