Title: [124825] trunk/Source
Revision
124825
Author
[email protected]
Date
2012-08-06 17:50:43 -0700 (Mon, 06 Aug 2012)

Log Message

Unreviewed, rolling out r124816.
http://trac.webkit.org/changeset/124816
https://bugs.webkit.org/show_bug.cgi?id=93311

made some tests crash (Requested by noamr on #webkit).

Patch by Sheriff Bot <[email protected]> on 2012-08-06

Source/WebCore:

* platform/graphics/GraphicsLayerAnimation.cpp:
(WebCore::GraphicsLayerAnimation::GraphicsLayerAnimation):
(WebCore::GraphicsLayerAnimations::hasActiveAnimationsOfType):
(WebCore::GraphicsLayerAnimations::hasRunningAnimations):
(WebCore::GraphicsLayerAnimations::add):
(WebCore::GraphicsLayerAnimations::pause):
(WebCore::GraphicsLayerAnimations::apply):
* platform/graphics/GraphicsLayerAnimation.h:
(GraphicsLayerAnimation):
(GraphicsLayerAnimations):
(WebCore::GraphicsLayerAnimations::remove):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::addAnimation):

Source/WebKit2:

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::addAnimation):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124824 => 124825)


--- trunk/Source/WebCore/ChangeLog	2012-08-07 00:47:52 UTC (rev 124824)
+++ trunk/Source/WebCore/ChangeLog	2012-08-07 00:50:43 UTC (rev 124825)
@@ -1,3 +1,25 @@
+2012-08-06  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r124816.
+        http://trac.webkit.org/changeset/124816
+        https://bugs.webkit.org/show_bug.cgi?id=93311
+
+        made some tests crash (Requested by noamr on #webkit).
+
+        * platform/graphics/GraphicsLayerAnimation.cpp:
+        (WebCore::GraphicsLayerAnimation::GraphicsLayerAnimation):
+        (WebCore::GraphicsLayerAnimations::hasActiveAnimationsOfType):
+        (WebCore::GraphicsLayerAnimations::hasRunningAnimations):
+        (WebCore::GraphicsLayerAnimations::add):
+        (WebCore::GraphicsLayerAnimations::pause):
+        (WebCore::GraphicsLayerAnimations::apply):
+        * platform/graphics/GraphicsLayerAnimation.h:
+        (GraphicsLayerAnimation):
+        (GraphicsLayerAnimations):
+        (WebCore::GraphicsLayerAnimations::remove):
+        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
+        (WebCore::GraphicsLayerTextureMapper::addAnimation):
+
 2012-08-06  Max Vujovic  <[email protected]>
 
         [CSS Shaders] Parse mix function

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerAnimation.cpp (124824 => 124825)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayerAnimation.cpp	2012-08-07 00:47:52 UTC (rev 124824)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerAnimation.cpp	2012-08-07 00:50:43 UTC (rev 124825)
@@ -155,11 +155,10 @@
 }
 
 
-GraphicsLayerAnimation::GraphicsLayerAnimation(const String& name, const KeyframeValueList& keyframes, const IntSize& boxSize, const Animation* animation, double timeOffset, bool listsMatch)
+GraphicsLayerAnimation::GraphicsLayerAnimation(const KeyframeValueList& keyframes, const IntSize& boxSize, const Animation* animation, double timeOffset, bool listsMatch)
     : m_keyframes(keyframes)
     , m_boxSize(boxSize)
     , m_animation(Animation::create(animation))
-    , m_name(name)
     , m_listsMatch(listsMatch)
     , m_startTime(WTF::currentTime() - timeOffset)
     , m_pauseTime(0)
@@ -191,18 +190,26 @@
 
 bool GraphicsLayerAnimations::hasActiveAnimationsOfType(AnimatedPropertyID type) const
 {
-    for (size_t i = 0; i < m_animations.size(); ++i) {
-        if (m_animations[i].isActive() && m_animations[i].property() == type)
-            return true;
+    HashMap<String, Vector<GraphicsLayerAnimation> >::const_iterator end = m_animations.end();
+    for (HashMap<String, Vector<GraphicsLayerAnimation> >::const_iterator it = m_animations.begin(); it != end; ++it) {
+        const Vector<GraphicsLayerAnimation>& animations = it->second;
+        for (size_t i = 0; i < animations.size(); ++i) {
+            if (animations[i].isActive() && animations[i].property() == type)
+                return true;
+        }
     }
     return false;
 }
 
 bool GraphicsLayerAnimations::hasRunningAnimations() const
 {
-    for (size_t i = 0; i < m_animations.size(); ++i) {
-        if (m_animations[i].state() == GraphicsLayerAnimation::PlayingState)
-            return true;
+    HashMap<String, Vector<GraphicsLayerAnimation> >::const_iterator end = m_animations.end();
+    for (HashMap<String, Vector<GraphicsLayerAnimation> >::const_iterator it = m_animations.begin(); it != end; ++it) {
+        const Vector<GraphicsLayerAnimation>& animations = it->second;
+        for (size_t i = 0; i < animations.size(); ++i) {
+            if (animations[i].state() == GraphicsLayerAnimation::PlayingState)
+                return true;
+        }
     }
 
     return false;
@@ -257,31 +264,36 @@
     m_pauseTime = WTF::currentTime() - offset;
 }
 
-void GraphicsLayerAnimations::add(const GraphicsLayerAnimation& animation)
+void GraphicsLayerAnimations::add(const String& name, const GraphicsLayerAnimation& animation)
 {
-    m_animations.append(animation);
+    HashMap<String, Vector<GraphicsLayerAnimation> >::iterator it = m_animations.find(name);
+    if (it != m_animations.end()) {
+        it->second.append(animation);
+        return;
+    }
+
+    Vector<GraphicsLayerAnimation> animations;
+    animations.append(animation);
+    m_animations.add(name, animations);
 }
 
 void GraphicsLayerAnimations::pause(const String& name, double offset)
 {
-    for (size_t i = 0; i < m_animations.size(); ++i) {
-        if (m_animations[i].name() == name)
-            m_animations[i].pause(offset);
-    }
-}
+    HashMap<String, Vector<GraphicsLayerAnimation> >::iterator it = m_animations.find(name);
+    if (it == m_animations.end())
+        return;
 
-void GraphicsLayerAnimations::remove(const String& name)
-{
-    for (int i = m_animations.size(); i >= 0; --i) {
-        if (m_animations[i].name() == name)
-            m_animations.remove(i);
-    }
+    for (size_t i = 0; i < it->second.size(); i++) 
+        it->second[i].pause(offset);
 }
 
 void GraphicsLayerAnimations::apply(GraphicsLayerAnimation::Client* client)
 {
-    for (size_t i = 0; i < m_animations.size(); ++i)
-        m_animations[i].apply(client);
+    HashMap<String, Vector<GraphicsLayerAnimation> >::iterator end = m_animations.end();
+    for (HashMap<String, Vector<GraphicsLayerAnimation> >::iterator it = m_animations.begin(); it != end; ++it) {
+        for (size_t i = 0; i < it->second.size(); ++i)
+            it->second[i].apply(client);
+    }
 }
 
 }

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerAnimation.h (124824 => 124825)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayerAnimation.h	2012-08-07 00:47:52 UTC (rev 124824)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerAnimation.h	2012-08-07 00:50:43 UTC (rev 124825)
@@ -41,14 +41,13 @@
     GraphicsLayerAnimation()
         : m_keyframes(AnimatedPropertyInvalid)
     { }
-    GraphicsLayerAnimation(const String&, const KeyframeValueList&, const IntSize&, const Animation*, double, bool);
+    GraphicsLayerAnimation(const KeyframeValueList&, const IntSize&, const Animation*, double, bool);
     void apply(Client*);
     void pause(double);
     AnimationState state() const { return m_state; }
     void setState(AnimationState s) { m_state = s; }
     AnimatedPropertyID property() const { return m_keyframes.property(); }
     bool isActive() const;
-    String name() const { return m_name; }
 
 private:
     void applyInternal(Client*, const AnimationValue* from, const AnimationValue* to, float progress);
@@ -67,8 +66,8 @@
 public:
     GraphicsLayerAnimations() { }
 
-    void add(const GraphicsLayerAnimation&);
-    void remove(const String& name);
+    void add(const String&, const GraphicsLayerAnimation&);
+    void remove(const String& name) { m_animations.remove(name); }
     void pause(const String&, double);
     void apply(GraphicsLayerAnimation::Client*);
     bool isEmpty() const { return m_animations.isEmpty(); }
@@ -77,7 +76,7 @@
     bool hasActiveAnimationsOfType(AnimatedPropertyID type) const;
 
 private:
-    Vector<GraphicsLayerAnimation> m_animations;
+    HashMap<String, Vector<GraphicsLayerAnimation> > m_animations;
 };
 
 }

Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp (124824 => 124825)


--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp	2012-08-07 00:47:52 UTC (rev 124824)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp	2012-08-07 00:50:43 UTC (rev 124825)
@@ -378,7 +378,7 @@
     if (valueList.property() == AnimatedPropertyWebkitTransform)
         listsMatch = validateTransformOperations(valueList, hasBigRotation) >= 0;
 
-    m_animations.add(GraphicsLayerAnimation(keyframesName, valueList, boxSize, anim, timeOffset, listsMatch));
+    m_animations.add(keyframesName, GraphicsLayerAnimation(valueList, boxSize, anim, timeOffset, listsMatch));
     notifyChange(TextureMapperLayer::AnimationChange);
     m_animationStartedTimer.startOneShot(0);
     return true;

Modified: trunk/Source/WebKit2/ChangeLog (124824 => 124825)


--- trunk/Source/WebKit2/ChangeLog	2012-08-07 00:47:52 UTC (rev 124824)
+++ trunk/Source/WebKit2/ChangeLog	2012-08-07 00:50:43 UTC (rev 124825)
@@ -1,3 +1,14 @@
+2012-08-06  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r124816.
+        http://trac.webkit.org/changeset/124816
+        https://bugs.webkit.org/show_bug.cgi?id=93311
+
+        made some tests crash (Requested by noamr on #webkit).
+
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::addAnimation):
+
 2012-08-06  No'am Rosenthal  <[email protected]>
 
         GraphicsLayerAnimation shouldn't use HashMap<String>

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp (124824 => 124825)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp	2012-08-07 00:47:52 UTC (rev 124824)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp	2012-08-07 00:50:43 UTC (rev 124825)
@@ -794,7 +794,7 @@
     if (valueList.property() == AnimatedPropertyWebkitTransform)
         listsMatch = validateTransformOperations(valueList, ignoredHasBigRotation) >= 0;
 
-    m_animations.add(GraphicsLayerAnimation(keyframesName, valueList, boxSize, anim, timeOffset, listsMatch));
+    m_animations.add(keyframesName, GraphicsLayerAnimation(valueList, boxSize, anim, timeOffset, listsMatch));
     m_animationStartedTimer.startOneShot(0);
     didChangeLayerState();
     return true;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to