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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp

Issue 2751383003: Add 'WithoutGeometryChange' variants of paint invalidation flag setters (Closed)
Patch Set: - Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
index 0467cbb33419cd5da112d8e0a130753ed0503fe3..5fcadc5dc10003e774c206c595416f4854b8c3fa 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
@@ -182,8 +182,7 @@ TEST_F(LayoutObjectTest, MutableForPaintingClearPaintFlags) {
LayoutObject* object = document().body()->layoutObject();
object->setShouldDoFullPaintInvalidation();
EXPECT_TRUE(object->shouldDoFullPaintInvalidation());
- object->m_bitfields.setChildShouldCheckForPaintInvalidation(true);
- EXPECT_TRUE(object->m_bitfields.childShouldCheckForPaintInvalidation());
+ EXPECT_TRUE(object->needsPaintOffsetAndVisualRectUpdate());
object->setMayNeedPaintInvalidation();
EXPECT_TRUE(object->mayNeedPaintInvalidation());
object->setMayNeedPaintInvalidationSubtree();
@@ -204,7 +203,6 @@ TEST_F(LayoutObjectTest, MutableForPaintingClearPaintFlags) {
object->getMutableForPainting().clearPaintFlags();
EXPECT_FALSE(object->shouldDoFullPaintInvalidation());
- EXPECT_FALSE(object->m_bitfields.childShouldCheckForPaintInvalidation());
EXPECT_FALSE(object->mayNeedPaintInvalidation());
EXPECT_FALSE(object->mayNeedPaintInvalidationSubtree());
EXPECT_FALSE(object->mayNeedPaintInvalidationAnimatedBackgroundImage());
@@ -214,4 +212,63 @@ TEST_F(LayoutObjectTest, MutableForPaintingClearPaintFlags) {
EXPECT_FALSE(object->descendantNeedsPaintPropertyUpdate());
}
+TEST_F(LayoutObjectTest, NeedsPaintOffsetAndVisualRectUpdate) {
+ LayoutObject* object = document().body()->layoutObject();
+ LayoutObject* parent = object->parent();
+
+ object->setShouldDoFullPaintInvalidation();
+ EXPECT_TRUE(object->shouldDoFullPaintInvalidation());
+ EXPECT_TRUE(object->needsPaintOffsetAndVisualRectUpdate());
+ EXPECT_TRUE(parent->mayNeedPaintInvalidation());
+ EXPECT_TRUE(parent->needsPaintOffsetAndVisualRectUpdate());
+ object->clearPaintInvalidationFlags();
+ EXPECT_FALSE(object->shouldDoFullPaintInvalidation());
+ EXPECT_FALSE(object->needsPaintOffsetAndVisualRectUpdate());
+ parent->clearPaintInvalidationFlags();
+ EXPECT_FALSE(parent->mayNeedPaintInvalidation());
+ EXPECT_FALSE(parent->needsPaintOffsetAndVisualRectUpdate());
+
+ object->setMayNeedPaintInvalidation();
+ EXPECT_TRUE(object->mayNeedPaintInvalidation());
+ EXPECT_TRUE(object->needsPaintOffsetAndVisualRectUpdate());
+ EXPECT_TRUE(parent->mayNeedPaintInvalidation());
+ EXPECT_TRUE(parent->needsPaintOffsetAndVisualRectUpdate());
+ object->clearPaintInvalidationFlags();
+ EXPECT_FALSE(object->mayNeedPaintInvalidation());
+ EXPECT_FALSE(object->needsPaintOffsetAndVisualRectUpdate());
+ parent->clearPaintInvalidationFlags();
+ EXPECT_FALSE(parent->mayNeedPaintInvalidation());
+ EXPECT_FALSE(parent->needsPaintOffsetAndVisualRectUpdate());
+
+ object->setShouldDoFullPaintInvalidationWithoutGeometryChange();
+ EXPECT_TRUE(object->shouldDoFullPaintInvalidation());
+ EXPECT_FALSE(object->needsPaintOffsetAndVisualRectUpdate());
+ EXPECT_TRUE(parent->mayNeedPaintInvalidation());
+ EXPECT_FALSE(parent->needsPaintOffsetAndVisualRectUpdate());
+ object->setMayNeedPaintInvalidation();
+ EXPECT_TRUE(object->needsPaintOffsetAndVisualRectUpdate());
+ EXPECT_TRUE(parent->needsPaintOffsetAndVisualRectUpdate());
+ object->clearPaintInvalidationFlags();
+ EXPECT_FALSE(object->mayNeedPaintInvalidation());
+ EXPECT_FALSE(object->needsPaintOffsetAndVisualRectUpdate());
+ parent->clearPaintInvalidationFlags();
+ EXPECT_FALSE(parent->mayNeedPaintInvalidation());
+ EXPECT_FALSE(parent->needsPaintOffsetAndVisualRectUpdate());
+
+ object->setMayNeedPaintInvalidationWithoutGeometryChange();
+ EXPECT_TRUE(object->mayNeedPaintInvalidation());
+ EXPECT_FALSE(object->needsPaintOffsetAndVisualRectUpdate());
+ EXPECT_TRUE(parent->mayNeedPaintInvalidation());
+ EXPECT_FALSE(parent->needsPaintOffsetAndVisualRectUpdate());
+ object->setMayNeedPaintInvalidation();
+ EXPECT_TRUE(object->needsPaintOffsetAndVisualRectUpdate());
+ EXPECT_TRUE(parent->needsPaintOffsetAndVisualRectUpdate());
+ object->clearPaintInvalidationFlags();
+ EXPECT_FALSE(object->mayNeedPaintInvalidation());
+ EXPECT_FALSE(object->needsPaintOffsetAndVisualRectUpdate());
+ parent->clearPaintInvalidationFlags();
+ EXPECT_FALSE(parent->mayNeedPaintInvalidation());
+ EXPECT_FALSE(parent->needsPaintOffsetAndVisualRectUpdate());
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698