Changeset 127476 in webkit


Ignore:
Timestamp:
Sep 4, 2012 11:37:26 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[chromium] Do not allow infinite pending frames in CCFrameRateController
https://bugs.webkit.org/show_bug.cgi?id=94254

Patch by Brian Anderson <brianderson@chromium.org> on 2012-09-04
Reviewed by James Robinson.

Removes support for infinite pending frames in CCFrameRateController
if swap acks are available.

Functionality covered by existing tests.

  • platform/graphics/chromium/cc/CCFrameRateController.cpp:

(WebCore::CCFrameRateController::CCFrameRateController):
(WebCore::CCFrameRateController::setMaxFramesPending):
(WebCore::CCFrameRateController::setSwapBuffersCompleteSupported):
(WebCore):
(WebCore::CCFrameRateController::onTimerTick):
(WebCore::CCFrameRateController::didBeginFrame):
(WebCore::CCFrameRateController::didFinishFrame):

  • platform/graphics/chromium/cc/CCFrameRateController.h:

(CCFrameRateController):

  • platform/graphics/chromium/cc/CCScheduler.cpp:

(WebCore::CCScheduler::setSwapBuffersCompleteSupported):
(WebCore):

  • platform/graphics/chromium/cc/CCScheduler.h:

(CCScheduler):

  • platform/graphics/chromium/cc/CCThreadProxy.cpp:

(WebCore::CCThreadProxy::initializeRendererOnImplThread):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r127474 r127476  
     12012-09-04  Brian Anderson  <brianderson@chromium.org>
     2
     3        [chromium] Do not allow infinite pending frames in CCFrameRateController
     4        https://bugs.webkit.org/show_bug.cgi?id=94254
     5
     6        Reviewed by James Robinson.
     7
     8        Removes support for infinite pending frames in CCFrameRateController
     9        if swap acks are available.       
     10
     11        Functionality covered by existing tests.
     12
     13        * platform/graphics/chromium/cc/CCFrameRateController.cpp:
     14        (WebCore::CCFrameRateController::CCFrameRateController):
     15        (WebCore::CCFrameRateController::setMaxFramesPending):
     16        (WebCore::CCFrameRateController::setSwapBuffersCompleteSupported):
     17        (WebCore):
     18        (WebCore::CCFrameRateController::onTimerTick):
     19        (WebCore::CCFrameRateController::didBeginFrame):
     20        (WebCore::CCFrameRateController::didFinishFrame):
     21        * platform/graphics/chromium/cc/CCFrameRateController.h:
     22        (CCFrameRateController):
     23        * platform/graphics/chromium/cc/CCScheduler.cpp:
     24        (WebCore::CCScheduler::setSwapBuffersCompleteSupported):
     25        (WebCore):
     26        * platform/graphics/chromium/cc/CCScheduler.h:
     27        (CCScheduler):
     28        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
     29        (WebCore::CCThreadProxy::initializeRendererOnImplThread):
     30
    1312012-09-04  Tim Horton  <timothy_horton@apple.com>
    232
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp

    • Property svn:executable set to *
    r126954 r127476  
    3232#include <wtf/CurrentTime.h>
    3333
     34namespace {
     35
     36// This will be the maximum number of pending frames unless
     37// CCFrameRateController::setMaxFramesPending is called.
     38const int defaultMaxFramesPending = 2;
     39
     40}
     41
    3442namespace WebCore {
    3543
     
    5361    : m_client(0)
    5462    , m_numFramesPending(0)
    55     , m_maxFramesPending(0)
     63    , m_maxFramesPending(defaultMaxFramesPending)
    5664    , m_timeSource(timer)
    5765    , m_active(false)
     66    , m_swapBuffersCompleteSupported(true)
    5867    , m_isTimeSourceThrottling(true)
    5968{
     
    6574    : m_client(0)
    6675    , m_numFramesPending(0)
    67     , m_maxFramesPending(0)
     76    , m_maxFramesPending(defaultMaxFramesPending)
    6877    , m_active(false)
     78    , m_swapBuffersCompleteSupported(true)
    6979    , m_isTimeSourceThrottling(false)
    7080{
     
    97107void CCFrameRateController::setMaxFramesPending(int maxFramesPending)
    98108{
     109    ASSERT(maxFramesPending > 0);
    99110    m_maxFramesPending = maxFramesPending;
    100111}
     
    106117}
    107118
     119void CCFrameRateController::setSwapBuffersCompleteSupported(bool supported)
     120{
     121    m_swapBuffersCompleteSupported = supported;
     122}
     123
    108124void CCFrameRateController::onTimerTick()
    109125{
     
    111127
    112128    // Don't forward the tick if we have too many frames in flight.
    113     if (m_maxFramesPending && m_numFramesPending >= m_maxFramesPending) {
     129    if (m_numFramesPending >= m_maxFramesPending) {
    114130        TRACE_EVENT0("cc", "CCFrameRateController::onTimerTickButMaxFramesPending");
    115131        return;
     
    119135        m_client->vsyncTick();
    120136
    121     if (!m_isTimeSourceThrottling
    122         && (!m_maxFramesPending || m_numFramesPending < m_maxFramesPending))
     137    if (m_swapBuffersCompleteSupported && !m_isTimeSourceThrottling && m_numFramesPending < m_maxFramesPending)
    123138        postManualTick();
    124139}
     
    137152void CCFrameRateController::didBeginFrame()
    138153{
    139     m_numFramesPending++;
     154    if (m_swapBuffersCompleteSupported)
     155        m_numFramesPending++;
     156    else if (!m_isTimeSourceThrottling)
     157        postManualTick();
    140158}
    141159
    142160void CCFrameRateController::didFinishFrame()
    143161{
     162    ASSERT(m_swapBuffersCompleteSupported);
     163
    144164    m_numFramesPending--;
    145165    if (!m_isTimeSourceThrottling)
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.h

    r126431 r127476  
    7171
    7272    void setTimebaseAndInterval(double timebase, double intervalSeconds);
     73    void setSwapBuffersCompleteSupported(bool);
    7374
    7475protected:
     
    8788    OwnPtr<CCFrameRateControllerTimeSourceAdapter> m_timeSourceClientAdapter;
    8889    bool m_active;
     90    bool m_swapBuffersCompleteSupported;
    8991
    9092    // Members for unthrottled frame-rate.
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp

    r127079 r127476  
    107107}
    108108
     109void CCScheduler::setSwapBuffersCompleteSupported(bool supported)
     110{
     111    m_frameRateController->setSwapBuffersCompleteSupported(supported);
     112}
     113
    109114void CCScheduler::didSwapBuffersComplete()
    110115{
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.h

    r127079 r127476  
    9898
    9999    void setMaxFramesPending(int);
     100    void setSwapBuffersCompleteSupported(bool);
    100101    void didSwapBuffersComplete();
    101102
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp

    r127317 r127476  
    889889    if (*initializeSucceeded) {
    890890        *capabilities = m_layerTreeHostImpl->rendererCapabilities();
    891         if (capabilities->usingSwapCompleteCallback)
    892             m_schedulerOnImplThread->setMaxFramesPending(2);
     891        m_schedulerOnImplThread->setSwapBuffersCompleteSupported(
     892                capabilities->usingSwapCompleteCallback);
    893893    }
    894894
Note: See TracChangeset for help on using the changeset viewer.