| 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 "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 if (layoutView != object) | 37 if (layoutView != object) |
| 38 paintInvalidationStates[0]->updateForChildren(PaintInvalidationFull); | 38 paintInvalidationStates[0]->updateForChildren(PaintInvalidationFull); |
| 39 for (size_t i = 1; i < paintInvalidationStates.size(); ++i) { | 39 for (size_t i = 1; i < paintInvalidationStates.size(); ++i) { |
| 40 paintInvalidationStates[i].emplace(*paintInvalidationStates[i - 1], | 40 paintInvalidationStates[i].emplace(*paintInvalidationStates[i - 1], |
| 41 *ancestors[ancestors.size() - i]); | 41 *ancestors[ancestors.size() - i]); |
| 42 if (paintInvalidationStates[i]->m_currentObject != object) | 42 if (paintInvalidationStates[i]->m_currentObject != object) |
| 43 paintInvalidationStates[i]->updateForChildren(PaintInvalidationFull); | 43 paintInvalidationStates[i]->updateForChildren(PaintInvalidationFull); |
| 44 } | 44 } |
| 45 | 45 |
| 46 const PaintInvalidationState& paintInvalidationState = | 46 const PaintInvalidationState& paintInvalidationState = |
| 47 *paintInvalidationStates.last(); | 47 *paintInvalidationStates.back(); |
| 48 ASSERT_EQ(paintInvalidationState.m_currentObject, object); | 48 ASSERT_EQ(paintInvalidationState.m_currentObject, object); |
| 49 ASSERT_EQ(&paintInvalidationState.paintInvalidationContainer(), | 49 ASSERT_EQ(&paintInvalidationState.paintInvalidationContainer(), |
| 50 &paintInvalidationContainer); | 50 &paintInvalidationContainer); |
| 51 | 51 |
| 52 LayoutRect r = rect; | 52 LayoutRect r = rect; |
| 53 paintInvalidationState.mapLocalRectToPaintInvalidationContainer(r); | 53 paintInvalidationState.mapLocalRectToPaintInvalidationContainer(r); |
| 54 EXPECT_EQ(expectedRect, r); | 54 EXPECT_EQ(expectedRect, r); |
| 55 } | 55 } |
| 56 }; | 56 }; |
| 57 | 57 |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 LayoutRect targetVisualRect = target->localVisualRect(); | 691 LayoutRect targetVisualRect = target->localVisualRect(); |
| 692 EXPECT_EQ(LayoutRect(0, 0, 400, 400), targetVisualRect); | 692 EXPECT_EQ(LayoutRect(0, 0, 400, 400), targetVisualRect); |
| 693 LayoutRect rect = targetVisualRect; | 693 LayoutRect rect = targetVisualRect; |
| 694 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); | 694 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); |
| 695 EXPECT_EQ(LayoutRect(0, 0, 200, 200), rect); | 695 EXPECT_EQ(LayoutRect(0, 0, 200, 200), rect); |
| 696 checkPaintInvalidationStateRectMapping(rect, targetVisualRect, *target, | 696 checkPaintInvalidationStateRectMapping(rect, targetVisualRect, *target, |
| 697 layoutView(), layoutView()); | 697 layoutView(), layoutView()); |
| 698 } | 698 } |
| 699 | 699 |
| 700 } // namespace blink | 700 } // namespace blink |
| OLD | NEW |