[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
cmarrin at apple.com
cmarrin at apple.com
Wed Dec 22 15:23:12 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 33cc87119fac9edde9807c5017d1de2498ad13e1
Author: cmarrin at apple.com <cmarrin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 2 17:19:58 2010 +0000
2010-11-02 Chris Marrin <cmarrin at apple.com>
Reviewed by Adam Roben.
Make RenderStyle::playState() return typed value and cleanup naming in Animation code
https://bugs.webkit.org/show_bug.cgi?id=48844
playState() function was returning unsigned value, but there is a EAnimPlayState
enum type which has the legal playState values. This type is now used everywhere.
I also changed the naming of the m_isSuspended to m_suspended to match the style
elsewhere in the code.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updatePlayState):
* page/animation/AnimationBase.h:
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::clear):
(WebCore::AnimationControllerPrivate::updateAnimationTimer):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateKeyframeAnimations):
(WebCore::CompositeAnimation::suspendAnimations):
(WebCore::CompositeAnimation::resumeAnimations):
* page/animation/CompositeAnimation.h:
(WebCore::CompositeAnimation::suspended):
(WebCore::CompositeAnimation::CompositeAnimation):
* platform/animation/Animation.h:
(WebCore::Animation::playState):
(WebCore::Animation::setPlayState):
(WebCore::Animation::initialAnimationPlayState):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4c1443b..c0ec4fe 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,33 @@
+2010-11-02 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Adam Roben.
+
+ Make RenderStyle::playState() return typed value and cleanup naming in Animation code
+ https://bugs.webkit.org/show_bug.cgi?id=48844
+
+ playState() function was returning unsigned value, but there is a EAnimPlayState
+ enum type which has the legal playState values. This type is now used everywhere.
+ I also changed the naming of the m_isSuspended to m_suspended to match the style
+ elsewhere in the code.
+
+ * page/animation/AnimationBase.cpp:
+ (WebCore::AnimationBase::updatePlayState):
+ * page/animation/AnimationBase.h:
+ * page/animation/AnimationController.cpp:
+ (WebCore::AnimationControllerPrivate::clear):
+ (WebCore::AnimationControllerPrivate::updateAnimationTimer):
+ * page/animation/CompositeAnimation.cpp:
+ (WebCore::CompositeAnimation::updateKeyframeAnimations):
+ (WebCore::CompositeAnimation::suspendAnimations):
+ (WebCore::CompositeAnimation::resumeAnimations):
+ * page/animation/CompositeAnimation.h:
+ (WebCore::CompositeAnimation::suspended):
+ (WebCore::CompositeAnimation::CompositeAnimation):
+ * platform/animation/Animation.h:
+ (WebCore::Animation::playState):
+ (WebCore::Animation::setPlayState):
+ (WebCore::Animation::initialAnimationPlayState):
+
2010-11-01 Zhenyao Mo <zmo at google.com>
Reviewed by Andreas Kling.
diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp
index ade68b5..bab396f 100644
--- a/WebCore/page/animation/AnimationBase.cpp
+++ b/WebCore/page/animation/AnimationBase.cpp
@@ -1206,8 +1206,9 @@ void AnimationBase::fireAnimationEventsIfNeeded()
}
}
-void AnimationBase::updatePlayState(bool run)
+void AnimationBase::updatePlayState(EAnimPlayState playState)
{
+ bool run = playState == AnimPlayStatePlaying;
if (paused() == run || isNew())
updateStateMachine(run ? AnimationStateInputPlayStateRunning : AnimationStateInputPlayStatePaused, -1);
}
diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h
index f5f3172..eb9bd12 100644
--- a/WebCore/page/animation/AnimationBase.h
+++ b/WebCore/page/animation/AnimationBase.h
@@ -29,6 +29,7 @@
#ifndef AnimationBase_h
#define AnimationBase_h
+#include "RenderStyleConstants.h"
#include <wtf/HashMap.h>
#include <wtf/text/AtomicString.h>
@@ -102,7 +103,7 @@ public:
}
// Called to change to or from paused state
- void updatePlayState(bool running);
+ void updatePlayState(EAnimPlayState);
bool playStatePlaying() const;
bool waitingToStart() const { return m_animState == AnimationStateNew || m_animState == AnimationStateStartWaitTimer; }
diff --git a/WebCore/page/animation/AnimationController.cpp b/WebCore/page/animation/AnimationController.cpp
index b5d87e6..a68f467 100644
--- a/WebCore/page/animation/AnimationController.cpp
+++ b/WebCore/page/animation/AnimationController.cpp
@@ -81,7 +81,7 @@ bool AnimationControllerPrivate::clear(RenderObject* renderer)
if (!animation)
return false;
animation->clearRenderer();
- return animation->isSuspended();
+ return animation->suspended();
}
void AnimationControllerPrivate::updateAnimationTimer(bool callSetChanged/* = false*/)
@@ -92,7 +92,7 @@ void AnimationControllerPrivate::updateAnimationTimer(bool callSetChanged/* = fa
RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end();
for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
CompositeAnimation* compAnim = it->second.get();
- if (!compAnim->isSuspended() && compAnim->hasAnimations()) {
+ if (!compAnim->suspended() && compAnim->hasAnimations()) {
double t = compAnim->timeToNextService();
if (t != -1 && (t < needsService || needsService == -1))
needsService = t;
diff --git a/WebCore/page/animation/CompositeAnimation.cpp b/WebCore/page/animation/CompositeAnimation.cpp
index 57c2aa4..9d021b4 100644
--- a/WebCore/page/animation/CompositeAnimation.cpp
+++ b/WebCore/page/animation/CompositeAnimation.cpp
@@ -229,7 +229,7 @@ void CompositeAnimation::updateKeyframeAnimations(RenderObject* renderer, Render
// This one is still active.
// Animations match, but play states may differ. Update if needed.
- keyframeAnim->updatePlayState(anim->playState() == AnimPlayStatePlaying);
+ keyframeAnim->updatePlayState(anim->playState());
// Set the saved animation to this new one, just in case the play state has changed.
keyframeAnim->setAnimation(anim);
@@ -386,17 +386,17 @@ PassRefPtr<KeyframeAnimation> CompositeAnimation::getAnimationForProperty(int pr
void CompositeAnimation::suspendAnimations()
{
- if (m_isSuspended)
+ if (m_suspended)
return;
- m_isSuspended = true;
+ m_suspended = true;
if (!m_keyframeAnimations.isEmpty()) {
m_keyframeAnimations.checkConsistency();
AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
if (KeyframeAnimation* anim = it->second.get())
- anim->updatePlayState(false);
+ anim->updatePlayState(AnimPlayStatePaused);
}
}
if (!m_transitions.isEmpty()) {
@@ -404,17 +404,17 @@ void CompositeAnimation::suspendAnimations()
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
ImplicitAnimation* anim = it->second.get();
if (anim && anim->hasStyle())
- anim->updatePlayState(false);
+ anim->updatePlayState(AnimPlayStatePaused);
}
}
}
void CompositeAnimation::resumeAnimations()
{
- if (!m_isSuspended)
+ if (!m_suspended)
return;
- m_isSuspended = false;
+ m_suspended = false;
if (!m_keyframeAnimations.isEmpty()) {
m_keyframeAnimations.checkConsistency();
@@ -422,7 +422,7 @@ void CompositeAnimation::resumeAnimations()
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
KeyframeAnimation* anim = it->second.get();
if (anim && anim->playStatePlaying())
- anim->updatePlayState(true);
+ anim->updatePlayState(AnimPlayStatePlaying);
}
}
@@ -431,7 +431,7 @@ void CompositeAnimation::resumeAnimations()
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
ImplicitAnimation* anim = it->second.get();
if (anim && anim->hasStyle())
- anim->updatePlayState(true);
+ anim->updatePlayState(AnimPlayStatePlaying);
}
}
}
diff --git a/WebCore/page/animation/CompositeAnimation.h b/WebCore/page/animation/CompositeAnimation.h
index a0ac455..249f4c3 100644
--- a/WebCore/page/animation/CompositeAnimation.h
+++ b/WebCore/page/animation/CompositeAnimation.h
@@ -64,7 +64,7 @@ public:
void suspendAnimations();
void resumeAnimations();
- bool isSuspended() const { return m_isSuspended; }
+ bool suspended() const { return m_suspended; }
bool hasAnimations() const { return !m_transitions.isEmpty() || !m_keyframeAnimations.isEmpty(); }
@@ -84,7 +84,7 @@ private:
CompositeAnimation(AnimationControllerPrivate* animationController)
: m_animationController(animationController)
, m_numStyleAvailableWaiters(0)
- , m_isSuspended(false)
+ , m_suspended(false)
{
}
@@ -99,7 +99,7 @@ private:
AnimationNameMap m_keyframeAnimations;
Vector<AtomicStringImpl*> m_keyframeAnimationOrderMap;
unsigned m_numStyleAvailableWaiters;
- bool m_isSuspended;
+ bool m_suspended;
};
} // namespace WebCore
diff --git a/WebCore/platform/animation/Animation.h b/WebCore/platform/animation/Animation.h
index 1541b4d..d16f74c 100644
--- a/WebCore/platform/animation/Animation.h
+++ b/WebCore/platform/animation/Animation.h
@@ -93,7 +93,7 @@ public:
enum { IterationCountInfinite = -1 };
int iterationCount() const { return m_iterationCount; }
const String& name() const { return m_name; }
- unsigned playState() const { return m_playState; }
+ EAnimPlayState playState() const { return static_cast<EAnimPlayState>(m_playState); }
int property() const { return m_property; }
const PassRefPtr<TimingFunction> timingFunction() const { return m_timingFunction; }
@@ -103,7 +103,7 @@ public:
void setFillMode(unsigned f) { m_fillMode = f; m_fillModeSet = true; }
void setIterationCount(int c) { m_iterationCount = c; m_iterationCountSet = true; }
void setName(const String& n) { m_name = n; m_nameSet = true; }
- void setPlayState(unsigned d) { m_playState = d; m_playStateSet = true; }
+ void setPlayState(EAnimPlayState d) { m_playState = d; m_playStateSet = true; }
void setProperty(int t) { m_property = t; m_propertySet = true; }
void setTimingFunction(PassRefPtr<TimingFunction> f) { m_timingFunction = f; m_timingFunctionSet = true; }
@@ -155,7 +155,7 @@ public:
static unsigned initialAnimationFillMode() { return AnimationFillModeNone; }
static int initialAnimationIterationCount() { return 1; }
static String initialAnimationName() { return String("none"); }
- static unsigned initialAnimationPlayState() { return AnimPlayStatePlaying; }
+ static EAnimPlayState initialAnimationPlayState() { return AnimPlayStatePlaying; }
static int initialAnimationProperty() { return cAnimateAll; }
static PassRefPtr<TimingFunction> initialAnimationTimingFunction() { return CubicBezierTimingFunction::create(); }
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list