| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/paint/PaintInfo.h" | 5 #include "core/paint/PaintInfo.h" |
| 6 | 6 |
| 7 #include "platform/graphics/paint/PaintController.h" | 7 #include "platform/graphics/paint/PaintController.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 paintInfo.updateCullRect(transform); | 54 paintInfo.updateCullRect(transform); |
| 55 | 55 |
| 56 EXPECT_TRUE(paintInfo.cullRect().intersectsCullRect(IntRect(0, 0, 1, 1))); | 56 EXPECT_TRUE(paintInfo.cullRect().intersectsCullRect(IntRect(0, 0, 1, 1))); |
| 57 EXPECT_FALSE(paintInfo.cullRect().intersectsCullRect(IntRect(51, 51, 1, 1)))
; | 57 EXPECT_FALSE(paintInfo.cullRect().intersectsCullRect(IntRect(51, 51, 1, 1)))
; |
| 58 } | 58 } |
| 59 | 59 |
| 60 TEST_F(PaintInfoTest, intersectsVerticalRange) | 60 TEST_F(PaintInfoTest, intersectsVerticalRange) |
| 61 { | 61 { |
| 62 PaintInfo paintInfo(m_context, IntRect(0, 0, 50, 100), PaintPhaseSelfBlockBa
ckgroundOnly, GlobalPaintNormalPhase, PaintLayerNoFlag); | 62 PaintInfo paintInfo(m_context, IntRect(0, 0, 50, 100), PaintPhaseSelfBlockBa
ckgroundOnly, GlobalPaintNormalPhase, PaintLayerNoFlag); |
| 63 | 63 |
| 64 EXPECT_TRUE(paintInfo.cullRect().intersectsVerticalRange(LayoutUnit(0), Layo
utUnit(1))); | 64 EXPECT_TRUE(paintInfo.cullRect().intersectsVerticalRange(LayoutUnit(), Layou
tUnit(1))); |
| 65 EXPECT_FALSE(paintInfo.cullRect().intersectsVerticalRange(LayoutUnit(100), L
ayoutUnit(101))); | 65 EXPECT_FALSE(paintInfo.cullRect().intersectsVerticalRange(LayoutUnit(100), L
ayoutUnit(101))); |
| 66 } | 66 } |
| 67 | 67 |
| 68 TEST_F(PaintInfoTest, intersectsHorizontalRange) | 68 TEST_F(PaintInfoTest, intersectsHorizontalRange) |
| 69 { | 69 { |
| 70 PaintInfo paintInfo(m_context, IntRect(0, 0, 50, 100), PaintPhaseSelfBlockBa
ckgroundOnly, GlobalPaintNormalPhase, PaintLayerNoFlag); | 70 PaintInfo paintInfo(m_context, IntRect(0, 0, 50, 100), PaintPhaseSelfBlockBa
ckgroundOnly, GlobalPaintNormalPhase, PaintLayerNoFlag); |
| 71 | 71 |
| 72 EXPECT_TRUE(paintInfo.cullRect().intersectsHorizontalRange(LayoutUnit(0), La
youtUnit(1))); | 72 EXPECT_TRUE(paintInfo.cullRect().intersectsHorizontalRange(LayoutUnit(), Lay
outUnit(1))); |
| 73 EXPECT_FALSE(paintInfo.cullRect().intersectsHorizontalRange(LayoutUnit(50),
LayoutUnit(51))); | 73 EXPECT_FALSE(paintInfo.cullRect().intersectsHorizontalRange(LayoutUnit(50),
LayoutUnit(51))); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace blink | 76 } // namespace blink |
| OLD | NEW |