Changeset 112287 in webkit


Ignore:
Timestamp:
Mar 27, 2012 11:39:59 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[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.

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):

Location:
trunk/Source/WebKit/blackberry
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/Api/WebPageCompositor.cpp

    r112026 r112287  
    4444    : m_client(client)
    4545    , m_webPage(page)
    46     , m_animationTimer(this, &WebPageCompositorPrivate::animationTimerFired)
    47     , m_timerClient(new Platform::GenericTimerClient(Platform::userInterfaceThreadTimerClient()))
    4846    , m_pendingAnimationFrame(0.0)
    4947{
    50     m_animationTimer.setClient(m_timerClient);
     48    setOneShot(true); // one-shot animation client
    5149}
    5250
    5351WebPageCompositorPrivate::~WebPageCompositorPrivate()
    5452{
    55     m_animationTimer.stop();
    56     delete m_timerClient;
     53    Platform::AnimationFrameRateController::instance()->removeClient(this);
    5754}
    5855
     
    131128            m_pendingAnimationFrame = m_client->requestAnimationFrame();
    132129        else {
    133             m_animationTimer.start(1.0 / 60.0);
     130            Platform::AnimationFrameRateController::instance()->addClient(this);
    134131            m_webPage->updateDelegatedOverlays();
    135132        }
     
    144141}
    145142
    146 void WebPageCompositorPrivate::animationTimerFired()
     143void WebPageCompositorPrivate::animationFrameChanged()
    147144{
    148145    BackingStore* backingStore = m_webPage->m_backingStore;
  • trunk/Source/WebKit/blackberry/Api/WebPageCompositor_p.h

    r111959 r112287  
    2525#include "LayerRenderer.h"
    2626
     27#include <BlackBerryPlatformAnimation.h>
    2728#include <BlackBerryPlatformGLES2Context.h>
    28 #include <BlackBerryPlatformTimer.h>
    2929#include <wtf/OwnPtr.h>
    3030#include <wtf/RefCounted.h>
     
    4242
    4343// This class may only be used on the compositing thread. So it does not need to be threadsaferefcounted.
    44 class WebPageCompositorPrivate : public RefCounted<WebPageCompositorPrivate> {
     44class WebPageCompositorPrivate : public RefCounted<WebPageCompositorPrivate>, public Platform::AnimationFrameRateClient {
    4545public:
    4646    static PassRefPtr<WebPageCompositorPrivate> create(WebPagePrivate* page, WebPageCompositorClient* client)
     
    8787
    8888private:
    89     void animationTimerFired();
     89    void animationFrameChanged();
    9090
    9191    WebPageCompositorClient* m_client;
     
    9797    WebCore::IntSize m_contentsSizeForCompositing;
    9898    WebCore::LayerRenderingResults m_lastCompositingResults;
    99     BlackBerry::Platform::Timer<WebPageCompositorPrivate> m_animationTimer;
    100     BlackBerry::Platform::TimerClient* m_timerClient;
    10199    double m_pendingAnimationFrame;
    102100};
  • trunk/Source/WebKit/blackberry/ChangeLog

    r112252 r112287  
     12012-03-27  Andrew Lo  <anlo@rim.com>
     2
     3        [BlackBerry] Switch WebPageCompositor to use AnimationFrameRateController instead of timer
     4        https://bugs.webkit.org/show_bug.cgi?id=82350
     5
     6        Switch timer in WebPageCompositor to use AnimationFrameRateController.
     7
     8        Reviewed by Rob Buis.
     9
     10        * Api/WebPageCompositor.cpp:
     11        (BlackBerry::WebKit::WebPageCompositorPrivate::WebPageCompositorPrivate):
     12        (BlackBerry::WebKit::WebPageCompositorPrivate::~WebPageCompositorPrivate):
     13        (BlackBerry::WebKit::WebPageCompositorPrivate::drawLayers):
     14        (BlackBerry::WebKit::WebPageCompositorPrivate::animationFrameChanged):
     15        * Api/WebPageCompositor_p.h:
     16        (WebPageCompositorPrivate):
     17
    1182012-03-27  Chris Guan  <chris.guan@torchmobile.com.cn>
    219
Note: See TracChangeset for help on using the changeset viewer.