summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/AndroidAnimation.h
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-10-18 13:07:37 -0700
committerNicolas Roard <nicolasroard@google.com>2011-10-18 13:11:38 -0700
commit8cc0fa17a42ae1dec75fe8ab00d5baa75e46499e (patch)
tree47706253c7de7e041b9c31b1f7c93f5e706a0ad6 /Source/WebCore/platform/graphics/android/AndroidAnimation.h
parenta6d06cef38891b6e39dcbc455f7692f000309ba5 (diff)
downloadexternal_webkit-8cc0fa17a42ae1dec75fe8ab00d5baa75e46499e.zip
external_webkit-8cc0fa17a42ae1dec75fe8ab00d5baa75e46499e.tar.gz
external_webkit-8cc0fa17a42ae1dec75fe8ab00d5baa75e46499e.tar.bz2
Re-enable animations on the UI thread
Using webkit to compute animations is still slow in some cases. When animating large elements, we seems to sometimes bogs the GPU, which then makes the UI takes longer to render a frame. This in turn slow the rate at which we can call into webkit (to update the position of the animated layers), which results in perceived stuttering. We previously had an implementation of CSS animations that could run fully on the UI thread, without having to call back into webkit. We turned it off because there was still some glitches, and calling into webkit seemed to work well enough -- but as we can see, even if that's the case in general, edge cases still benefit from running the animations outside of webkit. The CL fixes the remaining glitches we had (mostly, it was the non support of fillMode) and re-enable our CSS animations implementation. bug:5297559 Change-Id: I1f00bc060a76c9dfd55bd6d8ae85d5d6da68ddb5
Diffstat (limited to 'Source/WebCore/platform/graphics/android/AndroidAnimation.h')
-rw-r--r--Source/WebCore/platform/graphics/android/AndroidAnimation.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/WebCore/platform/graphics/android/AndroidAnimation.h b/Source/WebCore/platform/graphics/android/AndroidAnimation.h
index 68caeb9..16a63e8 100644
--- a/Source/WebCore/platform/graphics/android/AndroidAnimation.h
+++ b/Source/WebCore/platform/graphics/android/AndroidAnimation.h
@@ -48,25 +48,28 @@ public:
bool checkIterationsAndProgress(double time, float* finalProgress);
double applyTimingFunction(float from, float to, double progress,
const TimingFunction* timingFunction);
- virtual bool evaluate(LayerAndroid* layer, double time) = 0;
+ bool evaluate(LayerAndroid* layer, double time);
+ virtual void applyForProgress(LayerAndroid* layer, float progress) = 0;
static long instancesCount();
void setName(const String& name) { m_name = name; }
String name() { return m_name; }
AnimatedPropertyID type() { return m_type; }
- bool finished() { return m_finished; }
+ bool fillsBackwards() { return m_fillsBackwards; }
+ bool fillsForwards() { return m_fillsForwards; }
+
protected:
double m_beginTime;
double m_elapsedTime;
double m_duration;
- bool m_finished;
+ bool m_fillsBackwards;
+ bool m_fillsForwards;
int m_iterationCount;
int m_direction;
RefPtr<TimingFunction> m_timingFunction;
String m_name;
AnimatedPropertyID m_type;
KeyframeValueList* m_operations;
- LayerAndroid* m_originalLayer;
};
class AndroidOpacityAnimation : public AndroidAnimation {
@@ -80,7 +83,7 @@ public:
AndroidOpacityAnimation(AndroidOpacityAnimation* anim);
virtual PassRefPtr<AndroidAnimation> copy();
- virtual bool evaluate(LayerAndroid* layer, double time);
+ virtual void applyForProgress(LayerAndroid* layer, float progress);
};
class AndroidTransformAnimation : public AndroidAnimation {
@@ -96,7 +99,7 @@ public:
AndroidTransformAnimation(AndroidTransformAnimation* anim);
virtual PassRefPtr<AndroidAnimation> copy();
- virtual bool evaluate(LayerAndroid* layer, double time);
+ virtual void applyForProgress(LayerAndroid* layer, float progress);
};
} // namespace WebCore