Title: [146609] trunk/Source/WebCore
Revision
146609
Author
[email protected]
Date
2013-03-22 07:42:16 -0700 (Fri, 22 Mar 2013)

Log Message

[GTK][AC] Opacity animation doesn't work with clutter backend
https://bugs.webkit.org/show_bug.cgi?id=110347

Patch by ChangSeok Oh <[email protected]> on 2013-03-22
Reviewed by Gustavo Noronha Silva.

The static casting in ternary operator doesn't change actual inputted argument type.
So I replaced it with if-else statement.

Covered by existing animation tests.

* platform/graphics/clutter/PlatformClutterAnimation.cpp:
(WebCore::PlatformClutterAnimation::addClutterTransitionForProperty):
(WebCore::PlatformClutterAnimation::addClutterKeyframeTransitionForProperty):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (146608 => 146609)


--- trunk/Source/WebCore/ChangeLog	2013-03-22 14:38:31 UTC (rev 146608)
+++ trunk/Source/WebCore/ChangeLog	2013-03-22 14:42:16 UTC (rev 146609)
@@ -1,5 +1,21 @@
 2013-03-22  ChangSeok Oh  <[email protected]>
 
+        [GTK][AC] Opacity animation doesn't work with clutter backend
+        https://bugs.webkit.org/show_bug.cgi?id=110347
+
+        Reviewed by Gustavo Noronha Silva.
+
+        The static casting in ternary operator doesn't change actual inputted argument type.
+        So I replaced it with if-else statement.
+
+        Covered by existing animation tests.
+
+        * platform/graphics/clutter/PlatformClutterAnimation.cpp:
+        (WebCore::PlatformClutterAnimation::addClutterTransitionForProperty):
+        (WebCore::PlatformClutterAnimation::addClutterKeyframeTransitionForProperty):
+
+2013-03-22  ChangSeok Oh  <[email protected]>
+
         [GTK][AC] Add removing animations procedure with clutter ac backend
         https://bugs.webkit.org/show_bug.cgi?id=110607
 

Modified: trunk/Source/WebCore/platform/graphics/clutter/PlatformClutterAnimation.cpp (146608 => 146609)


--- trunk/Source/WebCore/platform/graphics/clutter/PlatformClutterAnimation.cpp	2013-03-22 14:38:31 UTC (rev 146608)
+++ trunk/Source/WebCore/platform/graphics/clutter/PlatformClutterAnimation.cpp	2013-03-22 14:42:16 UTC (rev 146609)
@@ -433,11 +433,14 @@
 {
     ASSERT(property != "NoProperty");
 
-    GType gType = (property == "opacity" ? G_TYPE_UINT : G_TYPE_FLOAT);
-
     GRefPtr<ClutterTransition> transition = adoptGRef(clutter_property_transition_new(property.utf8().data()));
-    clutter_transition_set_from(transition.get(), gType, (gType == G_TYPE_UINT ? static_cast<unsigned>(fromValue) : fromValue));
-    clutter_transition_set_to(transition.get(), gType, (gType == G_TYPE_UINT ? static_cast<unsigned>(toValue) : toValue));
+    if (property == "opacity") {
+        clutter_transition_set_from(transition.get(), G_TYPE_UINT, static_cast<unsigned>(fromValue));
+        clutter_transition_set_to(transition.get(), G_TYPE_UINT, static_cast<unsigned>(toValue));
+    } else {
+        clutter_transition_set_from(transition.get(), G_TYPE_FLOAT, fromValue);
+        clutter_transition_set_to(transition.get(), G_TYPE_FLOAT, toValue);
+    }
 
     clutter_timeline_set_progress_mode(timeline(), toClutterAnimationMode(m_timingFunction));
 
@@ -490,8 +493,13 @@
     GType gType = (property == "opacity" ? G_TYPE_UINT : G_TYPE_FLOAT);
 
     GRefPtr<ClutterTransition> transition = adoptGRef(clutter_keyframe_transition_new(property.utf8().data()));
-    clutter_transition_set_from(transition.get(), gType, values.first());
-    clutter_transition_set_to(transition.get(), gType, values.last());
+    if (gType == G_TYPE_UINT) {
+        clutter_transition_set_from(transition.get(), gType, static_cast<unsigned>(values.first()));
+        clutter_transition_set_to(transition.get(), gType, static_cast<unsigned>(values.last()));
+    } else {
+        clutter_transition_set_from(transition.get(), gType, values.first());
+        clutter_transition_set_to(transition.get(), gType, values.last());
+    }
 
     // Ignore the first keyframe, since it's a '0' frame, meaningless.
     const unsigned nKeyframes = values.size() - 1;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to