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

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

Issue 2596623002: Create compositor animations for effect animations in SPv2. (Closed)
Patch Set: Sync to head and add node removal test. Created 4 years 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/CompositingReasonFinderTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp
index 0945dd32694c5bbc99e6f8e6707b0ef4d611e6f9..49f8ffe7a5ffdcefa859c2eb07a6179c8460a5f2 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp
@@ -211,4 +211,64 @@ TEST_F(CompositingReasonFinderTest, RequiresCompositingForTransformAnimation) {
*style));
}
+TEST_F(CompositingReasonFinderTest, RequiresCompositingForEffectAnimation) {
+ RefPtr<ComputedStyle> style = ComputedStyle::create();
+
+ style->setSubtreeWillChangeContents(false);
+
+ // In the interest of brevity, for each side of subtreeWillChangeContents()
+ // code path we only check that any one of the effect related animation flags
+ // being set produces true, rather than every permutation.
+
+ style->setHasCurrentOpacityAnimation(false);
+ style->setHasCurrentFilterAnimation(false);
+ style->setHasCurrentBackdropFilterAnimation(false);
+ EXPECT_FALSE(
+ CompositingReasonFinder::requiresCompositingForEffectAnimation(*style));
+
+ style->setHasCurrentOpacityAnimation(true);
+ style->setHasCurrentFilterAnimation(false);
+ style->setHasCurrentBackdropFilterAnimation(false);
+ EXPECT_TRUE(
+ CompositingReasonFinder::requiresCompositingForEffectAnimation(*style));
+
+ style->setHasCurrentOpacityAnimation(false);
+ style->setHasCurrentFilterAnimation(true);
+ style->setHasCurrentBackdropFilterAnimation(false);
+ EXPECT_TRUE(
+ CompositingReasonFinder::requiresCompositingForEffectAnimation(*style));
+
+ style->setHasCurrentOpacityAnimation(false);
+ style->setHasCurrentFilterAnimation(false);
+ style->setHasCurrentBackdropFilterAnimation(true);
+ EXPECT_TRUE(
+ CompositingReasonFinder::requiresCompositingForEffectAnimation(*style));
+
+ // Check the other side of subtreeWillChangeContents.
+ style->setSubtreeWillChangeContents(true);
+ style->setHasCurrentOpacityAnimation(false);
+ style->setHasCurrentFilterAnimation(false);
+ style->setHasCurrentBackdropFilterAnimation(false);
+ EXPECT_FALSE(
+ CompositingReasonFinder::requiresCompositingForEffectAnimation(*style));
+
+ style->setIsRunningOpacityAnimationOnCompositor(true);
+ style->setIsRunningFilterAnimationOnCompositor(false);
+ style->setIsRunningBackdropFilterAnimationOnCompositor(false);
+ EXPECT_TRUE(
+ CompositingReasonFinder::requiresCompositingForEffectAnimation(*style));
+
+ style->setIsRunningOpacityAnimationOnCompositor(false);
+ style->setIsRunningFilterAnimationOnCompositor(true);
+ style->setIsRunningBackdropFilterAnimationOnCompositor(false);
+ EXPECT_TRUE(
+ CompositingReasonFinder::requiresCompositingForEffectAnimation(*style));
+
+ style->setIsRunningOpacityAnimationOnCompositor(false);
+ style->setIsRunningFilterAnimationOnCompositor(false);
+ style->setIsRunningBackdropFilterAnimationOnCompositor(true);
+ EXPECT_TRUE(
+ CompositingReasonFinder::requiresCompositingForEffectAnimation(*style));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698