Changeset 148439 in webkit


Ignore:
Timestamp:
Apr 15, 2013, 8:28:19 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Schedule rendering at regular interval (60fps)
https://bugs.webkit.org/show_bug.cgi?id=114617

Patch by Seulgi Kim <seulgikim@company100.net> on 2013-04-15
Reviewed by Martin Robinson.

Schedule rendering reguarly regardless of the time taken to render a
frame. Otherwise, next flush delayed by the amount of the rendering
time.

  • WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:

(WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
(WebKit::LayerTreeHostGtk::layerFlushTimerFired):
(WebKit::LayerTreeHostGtk::flushAndRenderLayers):

  • WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r148434 r148439  
     12013-04-15  Seulgi Kim  <seulgikim@company100.net>
     2
     3        Schedule rendering at regular interval (60fps)
     4        https://bugs.webkit.org/show_bug.cgi?id=114617
     5
     6        Reviewed by Martin Robinson.
     7
     8        Schedule rendering reguarly regardless of the time taken to render a
     9        frame. Otherwise, next flush delayed by the amount of the rendering
     10        time.
     11
     12        * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
     13        (WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
     14        (WebKit::LayerTreeHostGtk::layerFlushTimerFired):
     15        (WebKit::LayerTreeHostGtk::flushAndRenderLayers):
     16        * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
     17
    1182013-04-15  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
    219
  • trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp

    r146637 r148439  
    7272    , m_isValid(true)
    7373    , m_notifyAfterScheduledLayerFlush(false)
     74    , m_lastFlushTime(0)
    7475    , m_layerFlushSchedulingEnabled(true)
    7576    , m_layerFlushTimerCallbackId(0)
     
    302303    flushAndRenderLayers();
    303304
    304     if (toTextureMapperLayer(m_rootLayer.get())->descendantsOrSelfHaveRunningAnimations() && !m_layerFlushTimerCallbackId)
    305         m_layerFlushTimerCallbackId = g_timeout_add_full(GDK_PRIORITY_EVENTS, 1000.0 / 60.0, reinterpret_cast<GSourceFunc>(layerFlushTimerFiredCallback), this, 0);
     305    if (toTextureMapperLayer(m_rootLayer.get())->descendantsOrSelfHaveRunningAnimations() && !m_layerFlushTimerCallbackId) {
     306        const double targetFPS = 60;
     307        double nextFlush = std::max((1 / targetFPS) - (currentTime() - m_lastFlushTime), 0.0);
     308        m_layerFlushTimerCallbackId = g_timeout_add_full(GDK_PRIORITY_EVENTS, nextFlush * 1000.0, reinterpret_cast<GSourceFunc>(layerFlushTimerFiredCallback), this, 0);
     309    }
    306310}
    307311
     
    359363        return;
    360364
     365    m_lastFlushTime = currentTime();
    361366    // Our model is very simple. We always composite and render the tree immediately after updating it.
    362367    compositeLayersToContext();
  • trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h

    r146207 r148439  
    105105    OwnPtr<WebCore::TextureMapper> m_textureMapper;
    106106    OwnPtr<WebCore::GLContext> m_context;
     107    double m_lastFlushTime;
    107108    bool m_layerFlushSchedulingEnabled;
    108109    unsigned m_layerFlushTimerCallbackId;
Note: See TracChangeset for help on using the changeset viewer.