Changeset 105517 in webkit


Ignore:
Timestamp:
Jan 20, 2012 8:24:29 AM (12 years ago)
Author:
jocelyn.turcotte@nokia.com
Message:

[Qt] Trigger forcing accelerated compositing from the UI process side.
https://bugs.webkit.org/show_bug.cgi?id=76296

Reviewed by Noam Rosenthal.

Some messages can be sent from the web view to the LayerTreeHost before
accelerated compositing is entered on the web process and signaled back.
By letting the UI process decide if AC has to be forced, we can create
the LayerTreeHostProxy earlier to send messages to the web process while
AC is being entered there.

This patch also fixes the flow of DidRenderFrame and RenderNextFrame messages
by setting the m_waitingForUIProcess flag properly and only send the
RenderNextFrame once the painting thread on the UI process is ready to paint.

This fixes the first visible content rect message not being received when
loading pages from the disk.

  • Shared/WebPreferencesStore.h:
  • UIProcess/API/qt/qquickwebview.cpp:

(QQuickWebViewPrivate::initialize):

  • UIProcess/DrawingAreaProxyImpl.cpp:

(WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):

  • UIProcess/qt/LayerTreeHostProxyQt.cpp:

(WebKit::LayerTreeHostProxy::flushLayerChanges):
(WebKit::LayerTreeHostProxy::didRenderFrame):

  • WebProcess/WebPage/DrawingAreaImpl.cpp:

(WebKit::DrawingAreaImpl::DrawingAreaImpl):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences):

  • WebProcess/WebPage/qt/LayerTreeHostQt.cpp:

(WebKit::LayerTreeHostQt::performScheduledLayerFlush):

  • WebProcess/WebPage/qt/WebPageQt.cpp:

(WebKit::WebPage::platformInitialize):

Location:
trunk/Source/WebKit2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r105504 r105517  
     12012-01-20  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
     2
     3        [Qt] Trigger forcing accelerated compositing from the UI process side.
     4        https://bugs.webkit.org/show_bug.cgi?id=76296
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        Some messages can be sent from the web view to the LayerTreeHost before
     9        accelerated compositing is entered on the web process and signaled back.
     10        By letting the UI process decide if AC has to be forced, we can create
     11        the LayerTreeHostProxy earlier to send messages to the web process while
     12        AC is being entered there.
     13
     14        This patch also fixes the flow of DidRenderFrame and RenderNextFrame messages
     15        by setting the m_waitingForUIProcess flag properly and only send the
     16        RenderNextFrame once the painting thread on the UI process is ready to paint.
     17
     18        This fixes the first visible content rect message not being received when
     19        loading pages from the disk.
     20
     21        * Shared/WebPreferencesStore.h:
     22        * UIProcess/API/qt/qquickwebview.cpp:
     23        (QQuickWebViewPrivate::initialize):
     24        * UIProcess/DrawingAreaProxyImpl.cpp:
     25        (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
     26        * UIProcess/qt/LayerTreeHostProxyQt.cpp:
     27        (WebKit::LayerTreeHostProxy::flushLayerChanges):
     28        (WebKit::LayerTreeHostProxy::didRenderFrame):
     29        * WebProcess/WebPage/DrawingAreaImpl.cpp:
     30        (WebKit::DrawingAreaImpl::DrawingAreaImpl):
     31        * WebProcess/WebPage/WebPage.cpp:
     32        (WebKit::WebPage::updatePreferences):
     33        * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
     34        (WebKit::LayerTreeHostQt::performScheduledLayerFlush):
     35        * WebProcess/WebPage/qt/WebPageQt.cpp:
     36        (WebKit::WebPage::platformInitialize):
     37
    1382012-01-20  Sheriff Bot  <webkit.review.bot@gmail.com>
    239
  • trunk/Source/WebKit2/Shared/WebPreferencesStore.h

    r105504 r105517  
    6767    macro(NeedsSiteSpecificQuirks, needsSiteSpecificQuirks, Bool, bool, false) \
    6868    macro(AcceleratedCompositingEnabled, acceleratedCompositingEnabled, Bool, bool, true) \
     69    macro(ForceCompositingMode, forceCompositingMode, Bool, bool, false) \
    6970    macro(AcceleratedDrawingEnabled, acceleratedDrawingEnabled, Bool, bool, false) \
    7071    macro(CanvasUsesAcceleratedDrawing, canvasUsesAcceleratedDrawing, Bool, bool, true) \
  • trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp

    r105504 r105517  
    106106    setUseTraditionalDesktopBehaviour(false);
    107107    webPageProxy->pageGroup()->preferences()->setAcceleratedCompositingEnabled(true);
     108    webPageProxy->pageGroup()->preferences()->setForceCompositingMode(true);
    108109
    109110    pageClient.initialize(q_ptr, pageViewPrivate->eventHandler.data(), &undoController);
  • trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp

    r105504 r105517  
    3131#include "LayerTreeContext.h"
    3232#include "UpdateInfo.h"
     33#include "WebPageGroup.h"
    3334#include "WebPageProxy.h"
     35#include "WebPreferences.h"
    3436#include "WebProcessProxy.h"
    3537#include <WebCore/Region.h>
     
    5759    , m_discardBackingStoreTimer(RunLoop::current(), this, &DrawingAreaProxyImpl::discardBackingStore)
    5860{
     61#if USE(TEXTURE_MAPPER)
     62    // Construct the proxy early to allow messages to be sent to the web process while AC is entered there.
     63    if (webPageProxy->pageGroup()->preferences()->forceCompositingMode())
     64        m_layerTreeHostProxy = adoptPtr(new LayerTreeHostProxy(this));
     65#endif
    5966}
    6067
  • trunk/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp

    r105413 r105517  
    432432{
    433433    m_rootLayer->syncCompositingState(FloatRect());
     434    // The pending tiles state is on its way for the screen, tell the web process to render the next one.
     435    m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::RenderNextFrame(), m_drawingAreaProxy->page()->pageID());
    434436}
    435437
     
    572574void LayerTreeHostProxy::didRenderFrame()
    573575{
    574     m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::RenderNextFrame(), m_drawingAreaProxy->page()->pageID());
    575576    pushUpdateToQueue(FlushLayerChangesMessage::create());
    576577    updateViewport();
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp

    r105504 r105517  
    6969    , m_exitCompositingTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::exitAcceleratedCompositingMode)
    7070{
    71     if (webPage->corePage()->settings()->acceleratedDrawingEnabled())
     71    if (webPage->corePage()->settings()->acceleratedDrawingEnabled() || webPage->corePage()->settings()->forceCompositingMode())
    7272        m_alwaysUseCompositing = true;
    7373       
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r105504 r105517  
    18411841
    18421842    settings->setAcceleratedCompositingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedCompositingEnabledKey()) && LayerTreeHost::supportsAcceleratedCompositing());
     1843    settings->setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey()) && LayerTreeHost::supportsAcceleratedCompositing());
    18431844    settings->setAcceleratedDrawingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedDrawingEnabledKey()) && LayerTreeHost::supportsAcceleratedCompositing());
    18441845    settings->setCanvasUsesAcceleratedDrawing(store.getBoolValueForKey(WebPreferencesKey::canvasUsesAcceleratedDrawingKey()) && LayerTreeHost::supportsAcceleratedCompositing());
  • trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp

    r105413 r105517  
    241241void LayerTreeHostQt::performScheduledLayerFlush()
    242242{
    243     m_webPage->layoutIfNeeded();
    244 
    245     if (!m_isValid)
    246         return;
    247 
    248243#if USE(TILED_BACKING_STORE)
    249244    if (m_isSuspended || m_waitingForUIProcess)
    250245        return;
    251246#endif
     247
     248    m_webPage->layoutIfNeeded();
     249
     250    if (!m_isValid)
     251        return;
    252252
    253253    m_shouldSyncFrame = false;
     
    262262
    263263    m_webPage->send(Messages::LayerTreeHostProxy::DidRenderFrame());
     264    m_waitingForUIProcess = true;
    264265
    265266    if (!m_notifyAfterScheduledLayerFlush)
  • trunk/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp

    r105504 r105517  
    9191void WebPage::platformInitialize()
    9292{
    93     Settings* settings = m_page->settings();
    94 
    95     // If accelerated compositing is enabled, we want to be in force-compositing mode, so that we don't switch between composited/non-composited state.
    96     settings->setForceCompositingMode(true);
    9793}
    9894
Note: See TracChangeset for help on using the changeset viewer.