Title: [114915] trunk/Source
Revision
114915
Author
commit-qu...@webkit.org
Date
2012-04-23 10:28:42 -0700 (Mon, 23 Apr 2012)

Log Message

[chromium] Properly ignore unsupported animation directions.
https://bugs.webkit.org/show_bug.cgi?id=84599

Patch by Ian Vollick <voll...@chromium.org> on 2012-04-23
Reviewed by Adrienne Walker.

Source/WebCore:

Tested in CCLayerAnimationControllerTest.ignoreUnsupportedAnimationDirections.

* platform/graphics/chromium/cc/CCLayerAnimationController.cpp:

Source/WebKit/chromium:

* tests/CCLayerAnimationControllerTest.cpp:
(WebKitTests::TEST):
(WebKitTests):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114914 => 114915)


--- trunk/Source/WebCore/ChangeLog	2012-04-23 17:26:18 UTC (rev 114914)
+++ trunk/Source/WebCore/ChangeLog	2012-04-23 17:28:42 UTC (rev 114915)
@@ -1,3 +1,14 @@
+2012-04-23  Ian Vollick  <voll...@chromium.org>
+
+        [chromium] Properly ignore unsupported animation directions.
+        https://bugs.webkit.org/show_bug.cgi?id=84599
+
+        Reviewed by Adrienne Walker.
+
+        Tested in CCLayerAnimationControllerTest.ignoreUnsupportedAnimationDirections.
+
+        * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
+
 2012-04-17  Kentaro Hara  <hara...@chromium.org>
 
         [Performance][V8] Skip Isolate look-up to find StringCache

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp (114914 => 114915)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp	2012-04-23 17:26:18 UTC (rev 114914)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp	2012-04-23 17:28:42 UTC (rev 114915)
@@ -53,7 +53,7 @@
 PassOwnPtr<CCActiveAnimation> createActiveAnimation(const KeyframeValueList& valueList, const Animation* animation, size_t animationId, size_t groupId, double timeOffset, CCActiveAnimation::TargetProperty targetProperty)
 {
     // FIXME: add support for different directions.
-    if (animation && animation->isDirectionSet() && animation->direction() == Animation::AnimationDirectionAlternate)
+    if (animation && animation->isDirectionSet() && animation->direction() != Animation::AnimationDirectionNormal)
         return nullptr;
 
     // FIXME: add support for fills forwards and fills backwards

Modified: trunk/Source/WebKit/chromium/ChangeLog (114914 => 114915)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-04-23 17:26:18 UTC (rev 114914)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-04-23 17:28:42 UTC (rev 114915)
@@ -1,5 +1,16 @@
 2012-04-23  Ian Vollick  <voll...@chromium.org>
 
+        [chromium] Properly ignore unsupported animation directions.
+        https://bugs.webkit.org/show_bug.cgi?id=84599
+
+        Reviewed by Adrienne Walker.
+
+        * tests/CCLayerAnimationControllerTest.cpp:
+        (WebKitTests::TEST):
+        (WebKitTests):
+
+2012-04-23  Ian Vollick  <voll...@chromium.org>
+
         [chromium] When prepareToDraw fails due to animation checkerboard, we need to call setNeedsCommit
         https://bugs.webkit.org/show_bug.cgi?id=84520
 

Modified: trunk/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp (114914 => 114915)


--- trunk/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp	2012-04-23 17:26:18 UTC (rev 114914)
+++ trunk/Source/WebKit/chromium/tests/CCLayerAnimationControllerTest.cpp	2012-04-23 17:28:42 UTC (rev 114915)
@@ -86,6 +86,33 @@
     EXPECT_EQ(1, curve->getValue(duration));
 }
 
+TEST(CCLayerAnimationControllerTest, ignoreUnsupportedAnimationDirections)
+{
+    FakeLayerAnimationControllerClient dummy;
+    OwnPtr<CCLayerAnimationController> controller(CCLayerAnimationController::create(&dummy));
+    const double duration = 1;
+    WebCore::KeyframeValueList values(AnimatedPropertyOpacity);
+    values.insert(new FloatAnimationValue(0, 0));
+    values.insert(new FloatAnimationValue(duration, 1));
+
+    RefPtr<Animation> animation = Animation::create();
+    animation->setDuration(duration);
+
+    IntSize boxSize;
+
+    animation->setDirection(Animation::AnimationDirectionAlternate);
+    EXPECT_FALSE(controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0));
+
+    animation->setDirection(Animation::AnimationDirectionAlternateReverse);
+    EXPECT_FALSE(controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0));
+
+    animation->setDirection(Animation::AnimationDirectionReverse);
+    EXPECT_FALSE(controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0));
+
+    animation->setDirection(Animation::AnimationDirectionNormal);
+    EXPECT_TRUE(controller->addAnimation(values, boxSize, animation.get(), 0, 0, 0));
+}
+
 TEST(CCLayerAnimationControllerTest, createTransformAnimation)
 {
     FakeLayerAnimationControllerClient dummy;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to