Chromium Code Reviews| 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 "platform/graphics/paint/GeometryMapper.h" | 10 #include "platform/graphics/paint/GeometryMapper.h" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 const LayoutRect& expected_visual_rect, | 37 const LayoutRect& expected_visual_rect, |
| 38 bool adjust_for_backing = false) { | 38 bool adjust_for_backing = false) { |
| 39 LayoutRect slow_map_rect = local_rect; | 39 LayoutRect slow_map_rect = local_rect; |
| 40 object.MapToVisualRectInAncestorSpace(&ancestor, slow_map_rect); | 40 object.MapToVisualRectInAncestorSpace(&ancestor, slow_map_rect); |
| 41 if (slow_map_rect.IsEmpty() && object.VisualRect().IsEmpty()) | 41 if (slow_map_rect.IsEmpty() && object.VisualRect().IsEmpty()) |
| 42 return; | 42 return; |
| 43 | 43 |
| 44 FloatClipRect geometry_mapper_rect((FloatRect(local_rect))); | 44 FloatClipRect geometry_mapper_rect((FloatRect(local_rect))); |
| 45 if (object.PaintProperties() || object.LocalBorderBoxProperties()) { | 45 if (object.PaintProperties() || object.LocalBorderBoxProperties()) { |
| 46 geometry_mapper_rect.MoveBy(FloatPoint(object.PaintOffset())); | 46 geometry_mapper_rect.MoveBy(FloatPoint(object.PaintOffset())); |
| 47 auto contents_properties = ancestor.ContentsProperties(); | |
|
chrishtr
2017/04/10 19:44:50
nit: Re-inline this?
pdr.
2017/04/10 20:05:34
Done
| |
| 47 GeometryMapper::SourceToDestinationVisualRect( | 48 GeometryMapper::SourceToDestinationVisualRect( |
| 48 *object.LocalBorderBoxProperties(), *ancestor.ContentsProperties(), | 49 *object.LocalBorderBoxProperties(), contents_properties, |
| 49 geometry_mapper_rect); | 50 geometry_mapper_rect); |
| 50 geometry_mapper_rect.MoveBy(-FloatPoint(ancestor.PaintOffset())); | 51 geometry_mapper_rect.MoveBy(-FloatPoint(ancestor.PaintOffset())); |
| 51 } | 52 } |
| 52 | 53 |
| 53 // The following condition can be false if paintInvalidationContainer is | 54 // The following condition can be false if paintInvalidationContainer is |
| 54 // a LayoutView and compositing is not enabled. | 55 // a LayoutView and compositing is not enabled. |
| 55 if (adjust_for_backing && ancestor.IsPaintInvalidationContainer()) { | 56 if (adjust_for_backing && ancestor.IsPaintInvalidationContainer()) { |
| 56 PaintLayer::MapRectInPaintInvalidationContainerToBacking(ancestor, | 57 PaintLayer::MapRectInPaintInvalidationContainerToBacking(ancestor, |
| 57 slow_map_rect); | 58 slow_map_rect); |
| 58 LayoutRect temp(geometry_mapper_rect.Rect()); | 59 LayoutRect temp(geometry_mapper_rect.Rect()); |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 829 // getTransformfromContainter includes transform and perspective matrix | 830 // getTransformfromContainter includes transform and perspective matrix |
| 830 // of the container. | 831 // of the container. |
| 831 target->GetTransformFromContainer(container, LayoutSize(), target_matrix); | 832 target->GetTransformFromContainer(container, LayoutSize(), target_matrix); |
| 832 matrix *= target_matrix; | 833 matrix *= target_matrix; |
| 833 LayoutRect output(matrix.MapRect(FloatRect(original_rect))); | 834 LayoutRect output(matrix.MapRect(FloatRect(original_rect))); |
| 834 | 835 |
| 835 CheckVisualRect(*target, *target->View(), original_rect, output); | 836 CheckVisualRect(*target, *target->View(), original_rect, output); |
| 836 } | 837 } |
| 837 | 838 |
| 838 } // namespace blink | 839 } // namespace blink |
| OLD | NEW |