Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp

Issue 1428643004: Repaint on interest rect change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@EnableSyncPaint
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698