summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebCore/platform/graphics/android/AndroidAnimation.cpp9
-rw-r--r--WebCore/platform/graphics/android/AndroidAnimation.h17
-rw-r--r--WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp26
-rw-r--r--WebCore/platform/graphics/android/GraphicsLayerAndroid.h3
-rw-r--r--WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp4
5 files changed, 28 insertions, 31 deletions
diff --git a/WebCore/platform/graphics/android/AndroidAnimation.cpp b/WebCore/platform/graphics/android/AndroidAnimation.cpp
index 9cdb0c7..052e0a2 100644
--- a/WebCore/platform/graphics/android/AndroidAnimation.cpp
+++ b/WebCore/platform/graphics/android/AndroidAnimation.cpp
@@ -42,15 +42,6 @@ void AndroidTransformAnimationValue::apply()
m_layer->setRotation(m_rotation);
}
-void AndroidAnimationTimer::fired()
-{
- if (!m_notificationSent) {
- m_notificationSent = true;
- if (m_layer && m_layer->client())
- m_layer->client()->notifyAnimationStarted(m_layer, WTF::currentTime());
- }
-}
-
static long gDebugAndroidAnimationInstances;
long AndroidAnimation::instancesCount()
diff --git a/WebCore/platform/graphics/android/AndroidAnimation.h b/WebCore/platform/graphics/android/AndroidAnimation.h
index 05d6a76..1ecc22f 100644
--- a/WebCore/platform/graphics/android/AndroidAnimation.h
+++ b/WebCore/platform/graphics/android/AndroidAnimation.h
@@ -180,23 +180,6 @@ class AndroidTransformAnimation : public AndroidAnimation {
float m_toScaleX, m_toScaleY, m_toScaleZ;
};
-class AndroidAnimationTimer : public TimerBase {
- public:
-
- AndroidAnimationTimer(GraphicsLayerAndroid* layer, double beginTime)
- {
- m_layer = layer;
- m_notificationSent = false;
- m_beginTime = beginTime;
- }
-
- private:
- void fired();
- GraphicsLayerAndroid* m_layer;
- double m_beginTime;
- bool m_notificationSent;
-};
-
} // namespace WebCore
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index 9d9d067..068a55b 100644
--- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -96,6 +96,7 @@ GraphicsLayerAndroid::GraphicsLayerAndroid(GraphicsLayerClient* client) :
m_needsSyncMask(false),
m_needsRepaint(false),
m_needsDisplay(false),
+ m_needsNotifyClient(false),
m_haveContents(false),
m_haveImage(false),
m_translateX(0),
@@ -536,14 +537,19 @@ bool GraphicsLayerAndroid::createAnimationFromKeyframes(const KeyframeValueList&
anim->setName(keyframesName);
m_contentLayer->addAnimation(anim.release());
- AndroidAnimationTimer* timer = new AndroidAnimationTimer(this, WTF::currentTime());
- timer->startOneShot(0);
+ needsNotifyClient();
return true;
} break;
}
return false;
}
+void GraphicsLayerAndroid::needsNotifyClient()
+{
+ m_needsNotifyClient = true;
+ askForSync();
+}
+
bool GraphicsLayerAndroid::createTransformAnimationsFromKeyframes(const KeyframeValueList& valueList,
const Animation* animation,
const String& keyframesName,
@@ -725,8 +731,7 @@ bool GraphicsLayerAndroid::createTransformAnimationsFromKeyframes(const Keyframe
toScaleX, toScaleY, toScaleZ);
m_contentLayer->addAnimation(anim.release());
- AndroidAnimationTimer* timer = new AndroidAnimationTimer(this, WTF::currentTime());
- timer->startOneShot(0);
+ needsNotifyClient();
return true;
}
@@ -860,6 +865,19 @@ void GraphicsLayerAndroid::syncCompositingState()
repaintAll();
}
+void GraphicsLayerAndroid::notifyClientAnimationStarted()
+{
+ for (unsigned int i = 0; i < m_children.size(); i++) {
+ GraphicsLayerAndroid* layer = static_cast<GraphicsLayerAndroid*>(m_children[i]);
+ layer->notifyClientAnimationStarted();
+ }
+
+ if (m_needsNotifyClient) {
+ if (client())
+ client()->notifyAnimationStarted(this, WTF::currentTime());
+ m_needsNotifyClient = false;
+ }
+}
} // namespace WebCore
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.h b/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
index fc88fbf..591a261 100644
--- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
+++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
@@ -116,6 +116,7 @@ public:
void syncMask();
virtual void syncCompositingState();
void setFrame(Frame*);
+ void notifyClientAnimationStarted();
void sendImmediateRepaint();
LayerAndroid* contentLayer() { return m_contentLayer.get(); }
@@ -125,11 +126,13 @@ public:
private:
bool repaint(const FloatRect& rect);
+ void needsNotifyClient();
bool m_needsSyncChildren;
bool m_needsSyncMask;
bool m_needsRepaint;
bool m_needsDisplay;
+ bool m_needsNotifyClient;
bool m_haveContents;
bool m_haveImage;
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
index ffa96f8..9b0e7b4 100644
--- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
@@ -71,8 +71,10 @@ void ChromeClientAndroid::compositingLayerSync()
frameView->syncCompositingStateRecursive();
GraphicsLayerAndroid* androidGraphicsLayer =
static_cast<GraphicsLayerAndroid*>(m_rootGraphicsLayer);
- if (androidGraphicsLayer)
+ if (androidGraphicsLayer) {
androidGraphicsLayer->sendImmediateRepaint();
+ androidGraphicsLayer->notifyClientAnimationStarted();
+ }
return;
}
}