Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
| index 267daa88bda871bcb603522b112a99671bca5d10..1a4dfd43ba1c562c90b2c469b5c27669d89f6aaa 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
| @@ -24,6 +24,11 @@ protected: |
| return CompositedLayerMapping::computeInterestRect(graphicsLayer, owningLayoutObject); |
| } |
| + bool interestRectChangedEnoughToRepaint(const IntSize& layerSize, const IntRect& previousInterestRect, const IntRect& newInterestRect) |
| + { |
| + return CompositedLayerMapping::interestRectChangedEnoughToRepaint(layerSize, previousInterestRect, newInterestRect); |
| + } |
| + |
| private: |
| void SetUp() override |
| { |
| @@ -203,4 +208,16 @@ TEST_F(CompositedLayerMappingTest, ClippedBigLayer) |
| EXPECT_TRUE(checkRectsEqual(IntRect(0, 0, 4001, 4001), computeInterestRect(paintLayer->graphicsLayerBacking(), paintLayer->layoutObject()))); |
| } |
| +TEST_F(CompositedLayerMappingTest, InterestRectChangedEnoughToRepaint) |
|
chrishtr
2015/10/29 16:34:42
Please copy the exact tests from here:
https://co
Xianzhu
2015/10/29 17:17:27
Done.
|
| +{ |
| + IntSize layerSize(2000, 2000); |
| + EXPECT_FALSE(interestRectChangedEnoughToRepaint(layerSize, IntRect(), IntRect())); |
| + EXPECT_TRUE(interestRectChangedEnoughToRepaint(layerSize, IntRect(), IntRect(0, 0, 100, 100))); |
| + EXPECT_FALSE(interestRectChangedEnoughToRepaint(layerSize, IntRect(100, 100, 100, 100), IntRect(100, 100, 50, 50))); |
| + EXPECT_FALSE(interestRectChangedEnoughToRepaint(layerSize, IntRect(100, 100, 100, 100), IntRect(50, 50, 500, 500))); |
| + EXPECT_TRUE(interestRectChangedEnoughToRepaint(layerSize, IntRect(100, 100, 100, 100), IntRect(50, 50, 800, 600))); |
| + EXPECT_TRUE(interestRectChangedEnoughToRepaint(layerSize, IntRect(100, 100, 100, 100), IntRect(0, 0, 200, 200))); |
| + EXPECT_TRUE(interestRectChangedEnoughToRepaint(layerSize, IntRect(1000, 1000, 900, 900), IntRect(1000, 1000, 1000, 1000))); |
| +} |
| + |
| } // namespace blink |