https://bugs.webkit.org/show_bug.cgi?id=82350
Switch timer in WebPageCompositor to use AnimationFrameRateController.
Patch by Andrew Lo <anlo@rim.com> on 2012-03-27
Reviewed by Rob Buis.
* Api/WebPageCompositor.cpp:
(BlackBerry::WebKit::WebPageCompositorPrivate::WebPageCompositorPrivate):
(BlackBerry::WebKit::WebPageCompositorPrivate::~WebPageCompositorPrivate):
(BlackBerry::WebKit::WebPageCompositorPrivate::drawLayers):
(BlackBerry::WebKit::WebPageCompositorPrivate::animationFrameChanged):
* Api/WebPageCompositor_p.h:
(WebPageCompositorPrivate):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112287
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
WebPageCompositorPrivate::WebPageCompositorPrivate(WebPagePrivate* page, WebPageCompositorClient* client)
: m_client(client)
, m_webPage(page)
- , m_animationTimer(this, &WebPageCompositorPrivate::animationTimerFired)
- , m_timerClient(new Platform::GenericTimerClient(Platform::userInterfaceThreadTimerClient()))
, m_pendingAnimationFrame(0.0)
{
- m_animationTimer.setClient(m_timerClient);
+ setOneShot(true); // one-shot animation client
}
WebPageCompositorPrivate::~WebPageCompositorPrivate()
{
- m_animationTimer.stop();
- delete m_timerClient;
+ Platform::AnimationFrameRateController::instance()->removeClient(this);
}
void WebPageCompositorPrivate::setContext(Platform::Graphics::GLES2Context* context)
if (m_client)
m_pendingAnimationFrame = m_client->requestAnimationFrame();
else {
- m_animationTimer.start(1.0 / 60.0);
+ Platform::AnimationFrameRateController::instance()->addClient(this);
m_webPage->updateDelegatedOverlays();
}
}
m_layerRenderer->releaseLayerResources();
}
-void WebPageCompositorPrivate::animationTimerFired()
+void WebPageCompositorPrivate::animationFrameChanged()
{
BackingStore* backingStore = m_webPage->m_backingStore;
if (!backingStore) {
#include "LayerCompositingThread.h"
#include "LayerRenderer.h"
+#include <BlackBerryPlatformAnimation.h>
#include <BlackBerryPlatformGLES2Context.h>
-#include <BlackBerryPlatformTimer.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
class WebPagePrivate;
// This class may only be used on the compositing thread. So it does not need to be threadsaferefcounted.
-class WebPageCompositorPrivate : public RefCounted<WebPageCompositorPrivate> {
+class WebPageCompositorPrivate : public RefCounted<WebPageCompositorPrivate>, public Platform::AnimationFrameRateClient {
public:
static PassRefPtr<WebPageCompositorPrivate> create(WebPagePrivate* page, WebPageCompositorClient* client)
{
WebPageCompositorPrivate(WebPagePrivate*, WebPageCompositorClient*);
private:
- void animationTimerFired();
+ void animationFrameChanged();
WebPageCompositorClient* m_client;
WebPagePrivate* m_webPage;
WebCore::IntRect m_layoutRectForCompositing;
WebCore::IntSize m_contentsSizeForCompositing;
WebCore::LayerRenderingResults m_lastCompositingResults;
- BlackBerry::Platform::Timer<WebPageCompositorPrivate> m_animationTimer;
- BlackBerry::Platform::TimerClient* m_timerClient;
double m_pendingAnimationFrame;
};
+2012-03-27 Andrew Lo <anlo@rim.com>
+
+ [BlackBerry] Switch WebPageCompositor to use AnimationFrameRateController instead of timer
+ https://bugs.webkit.org/show_bug.cgi?id=82350
+
+ Switch timer in WebPageCompositor to use AnimationFrameRateController.
+
+ Reviewed by Rob Buis.
+
+ * Api/WebPageCompositor.cpp:
+ (BlackBerry::WebKit::WebPageCompositorPrivate::WebPageCompositorPrivate):
+ (BlackBerry::WebKit::WebPageCompositorPrivate::~WebPageCompositorPrivate):
+ (BlackBerry::WebKit::WebPageCompositorPrivate::drawLayers):
+ (BlackBerry::WebKit::WebPageCompositorPrivate::animationFrameChanged):
+ * Api/WebPageCompositor_p.h:
+ (WebPageCompositorPrivate):
+
2012-03-27 Chris Guan <chris.guan@torchmobile.com.cn>
A page containing multiparts with "multipart/x-mixed-replace" should not be cached.