Title: [88039] trunk/Source/WebCore
Revision
88039
Author
[email protected]
Date
2011-06-03 12:35:34 -0700 (Fri, 03 Jun 2011)

Log Message

2011-06-03  Rob Buis  <[email protected]>

        Reviewed by Nikolas Zimmermann.

        Cleanup member variable usage in svg/animation classes
        https://bugs.webkit.org/show_bug.cgi?id=62029

        Cleanup member variables.

        * svg/animation/SMILTimeContainer.cpp:
        (WebCore::SMILTimeContainer::SMILTimeContainer):
        (WebCore::SMILTimeContainer::sampleAnimationAtTime):
        (WebCore::SMILTimeContainer::updateAnimations):
        * svg/animation/SMILTimeContainer.h:
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::SVGSMILElement):
        * svg/animation/SVGSMILElement.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88038 => 88039)


--- trunk/Source/WebCore/ChangeLog	2011-06-03 19:18:09 UTC (rev 88038)
+++ trunk/Source/WebCore/ChangeLog	2011-06-03 19:35:34 UTC (rev 88039)
@@ -1,3 +1,21 @@
+2011-06-03  Rob Buis  <[email protected]>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Cleanup member variable usage in svg/animation classes
+        https://bugs.webkit.org/show_bug.cgi?id=62029
+
+        Cleanup member variables.
+
+        * svg/animation/SMILTimeContainer.cpp:
+        (WebCore::SMILTimeContainer::SMILTimeContainer):
+        (WebCore::SMILTimeContainer::sampleAnimationAtTime):
+        (WebCore::SMILTimeContainer::updateAnimations):
+        * svg/animation/SMILTimeContainer.h:
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::SVGSMILElement):
+        * svg/animation/SVGSMILElement.h:
+
 2011-06-03  Chris Rogers  <[email protected]>
 
         Reviewed by Kenneth Russell.

Modified: trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp (88038 => 88039)


--- trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp	2011-06-03 19:18:09 UTC (rev 88038)
+++ trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp	2011-06-03 19:35:34 UTC (rev 88039)
@@ -46,7 +46,6 @@
     : m_beginTime(0)
     , m_pauseTime(0)
     , m_accumulatedPauseTime(0)
-    , m_nextManualSampleTime(0)
     , m_documentOrderIndexesDirty(false)
     , m_timer(this, &SMILTimeContainer::timerFired)
     , m_ownerSVGElement(owner)
@@ -216,20 +215,18 @@
 
     // Fast-forward to the time DRT wants to sample
     m_timer.stop();
-    m_nextSamplingTarget = elementId;
-    m_nextManualSampleTime = newTime;
 
-    updateAnimations(elapsed());
+    updateAnimations(elapsed(), newTime, elementId);
 }
 
-void SMILTimeContainer::updateAnimations(SMILTime elapsed)
+void SMILTimeContainer::updateAnimations(SMILTime elapsed, double nextManualSampleTime, String nextSamplingTarget)
 {
     SMILTime earliersFireTime = SMILTime::unresolved();
 
     Vector<SVGSMILElement*> toAnimate;
     copyToVector(m_scheduledAnimations, toAnimate);
 
-    if (m_nextManualSampleTime) {
+    if (nextManualSampleTime) {
         SMILTime samplingDiff;
         for (unsigned n = 0; n < toAnimate.size(); ++n) {
             SVGSMILElement* animation = toAnimate[n];
@@ -237,15 +234,14 @@
 
             SVGElement* targetElement = animation->targetElement();
             // FIXME: This should probably be using getIdAttribute instead of idForStyleResolution.
-            if (!targetElement || !targetElement->hasID() || targetElement->idForStyleResolution() != m_nextSamplingTarget)
+            if (!targetElement || !targetElement->hasID() || targetElement->idForStyleResolution() != nextSamplingTarget)
                 continue;
 
             samplingDiff = animation->intervalBegin();
             break;
         }
 
-        elapsed = SMILTime(m_nextManualSampleTime) + samplingDiff;
-        m_nextManualSampleTime = 0;
+        elapsed = SMILTime(nextManualSampleTime) + samplingDiff;
     }
 
     // Sort according to priority. Elements with later begin time have higher priority.

Modified: trunk/Source/WebCore/svg/animation/SMILTimeContainer.h (88038 => 88039)


--- trunk/Source/WebCore/svg/animation/SMILTimeContainer.h	2011-06-03 19:18:09 UTC (rev 88038)
+++ trunk/Source/WebCore/svg/animation/SMILTimeContainer.h	2011-06-03 19:35:34 UTC (rev 88039)
@@ -70,7 +70,7 @@
     
     void timerFired(Timer<SMILTimeContainer>*);
     void startTimer(SMILTime fireTime, SMILTime minimumDelay = 0);
-    void updateAnimations(SMILTime elapsed);
+    void updateAnimations(SMILTime elapsed, double nextManualSampleTime = 0, String nextSamplingTarget = String());
     
     void updateDocumentOrderIndexes();
     void sortByPriority(Vector<SVGSMILElement*>& smilElements, SMILTime elapsed);
@@ -81,8 +81,6 @@
     double m_beginTime;
     double m_pauseTime;
     double m_accumulatedPauseTime;
-    double m_nextManualSampleTime;
-    String m_nextSamplingTarget;
 
     bool m_documentOrderIndexesDirty;
     

Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (88038 => 88039)


--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2011-06-03 19:18:09 UTC (rev 88038)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2011-06-03 19:35:34 UTC (rev 88039)
@@ -119,10 +119,10 @@
     , m_targetElement(0)
     , m_conditionsConnected(false)
     , m_hasEndEventConditions(false)
+    , m_isWaitingForFirstInterval(true)
     , m_intervalBegin(SMILTime::unresolved())
     , m_intervalEnd(SMILTime::unresolved())
     , m_previousIntervalBegin(SMILTime::unresolved())
-    , m_isWaitingForFirstInterval(true)
     , m_activeState(Inactive)
     , m_lastPercent(0)
     , m_lastRepeat(0)

Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.h (88038 => 88039)


--- trunk/Source/WebCore/svg/animation/SVGSMILElement.h	2011-06-03 19:18:09 UTC (rev 88038)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.h	2011-06-03 19:35:34 UTC (rev 88039)
@@ -191,6 +191,8 @@
     bool m_conditionsConnected;
     bool m_hasEndEventConditions;     
 
+    bool m_isWaitingForFirstInterval;
+
     typedef HashSet<SVGSMILElement*> TimeDependentSet;
     TimeDependentSet m_timeDependents;
 
@@ -204,8 +206,6 @@
 
     SMILTime m_previousIntervalBegin;
 
-    bool m_isWaitingForFirstInterval;
-
     ActiveState m_activeState;
     float m_lastPercent;
     unsigned m_lastRepeat;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to