Changeset 88799 in webkit


Ignore:
Timestamp:
Jun 14, 2011 7:07:55 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-14 No'am Rosenthal <noam.rosenthal@nokia.com> and Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Implement accelerated compositing on WK2 Qt port
https://bugs.webkit.org/show_bug.cgi?id=56935

Implementing LayerTreeHost and LayerTreeContext and LayerTreeHost for Qt.
Add the necessary plumbing to make the LayerTreeHost work with Qt, based on the original Mac
implementation (the code is nearly identical). This includes creating the right layers for the
overlay and for the non-composited content, and passing the root layer to the UI process.

Also, since LayerTreeHostQt is compiled, we have to add some of the rest of the existing patches,
namely the new messages: syncCompositingLayers and updateCompositingLayerContent, and create a
stub implementation for them in DrawingAreaProxy.

Note that this is not activated yet, until we enable accelerated compositing in the settings and
create the right GraphicsLayer.

  • Scripts/webkit2/messages.py:
  • Shared/LayerTreeContext.h:
  • Shared/qt/LayerTreeContextQt.cpp: (WebKit::LayerTreeContext::LayerTreeContext): (WebKit::LayerTreeContext::~LayerTreeContext): (WebKit::LayerTreeContext::encode): (WebKit::LayerTreeContext::decode): (WebKit::LayerTreeContext::isEmpty): (WebKit::operator==):
  • UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::syncCompositingLayers): (WebKit::DrawingAreaProxy::updateCompositingLayerContent):
  • UIProcess/DrawingAreaProxy.messages.in:
  • WebKit2.pro:
  • WebProcess/WebCoreSupport/WebGraphicsLayer.cpp: (WebCore::collectCompositingInfoForThisLayer):
  • WebProcess/WebPage/LayerTreeHost.cpp: (WebKit::LayerTreeHost::create):
  • WebProcess/WebPage/qt/LayerTreeHostQt.cpp: (WebKit::LayerTreeHostQt::create): (WebKit::LayerTreeHostQt::~LayerTreeHostQt): (WebKit::LayerTreeHostQt::LayerTreeHostQt): (WebKit::LayerTreeHostQt::setLayerFlushSchedulingEnabled): (WebKit::LayerTreeHostQt::scheduleLayerFlush): (WebKit::LayerTreeHostQt::cancelPendingLayerFlush): (WebKit::LayerTreeHostQt::setShouldNotifyAfterNextScheduledLayerFlush): (WebKit::LayerTreeHostQt::setRootCompositingLayer): (WebKit::LayerTreeHostQt::invalidate): (WebKit::LayerTreeHostQt::setNonCompositedContentsNeedDisplay): (WebKit::LayerTreeHostQt::scrollNonCompositedContents): (WebKit::LayerTreeHostQt::forceRepaint): (WebKit::LayerTreeHostQt::sizeDidChange): (WebKit::LayerTreeHostQt::didInstallPageOverlay): (WebKit::LayerTreeHostQt::didUninstallPageOverlay): (WebKit::LayerTreeHostQt::setPageOverlayNeedsDisplay): (WebKit::LayerTreeHostQt::flushPendingLayerChanges): (WebKit::LayerTreeHostQt::performScheduledLayerFlush): (WebKit::LayerTreeHostQt::layerFlushTimerFired): (WebKit::LayerTreeHostQt::createPageOverlayLayer): (WebKit::LayerTreeHostQt::destroyPageOverlayLayer): (WebKit::LayerTreeHostQt::notifyAnimationStarted): (WebKit::LayerTreeHostQt::notifySyncRequired): (WebKit::LayerTreeHostQt::paintContents): (WebKit::LayerTreeHostQt::showDebugBorders): (WebKit::LayerTreeHostQt::showRepaintCounter): (WebKit::LayerTreeHost::supportsAcceleratedCompositing):
  • WebProcess/WebPage/qt/LayerTreeHostQt.h: Added. (WebKit::LayerTreeHostQt::layerTreeContext): (WebKit::LayerTreeHostQt::pauseRendering): (WebKit::LayerTreeHostQt::resumeRendering):
Location:
trunk/Source/WebKit2
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r88797 r88799  
     12011-06-14  No'am Rosenthal  <noam.rosenthal@nokia.com> and Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Implement accelerated compositing on WK2 Qt port
     6        https://bugs.webkit.org/show_bug.cgi?id=56935
     7
     8        Implementing LayerTreeHost and LayerTreeContext and LayerTreeHost for Qt.
     9        Add the necessary plumbing to make the LayerTreeHost work with Qt, based on the original Mac
     10        implementation (the code is nearly identical). This includes creating the right layers for the
     11        overlay and for the non-composited content, and passing the root layer to the UI process.
     12
     13        Also, since LayerTreeHostQt is compiled, we have to add some of the rest of the existing patches,
     14        namely the new messages: syncCompositingLayers and updateCompositingLayerContent, and create a
     15        stub implementation for them in DrawingAreaProxy.
     16
     17        Note that this is not activated yet, until we enable accelerated compositing in the settings and
     18        create the right GraphicsLayer.
     19
     20        * Scripts/webkit2/messages.py:
     21        * Shared/LayerTreeContext.h:
     22        * Shared/qt/LayerTreeContextQt.cpp:
     23        (WebKit::LayerTreeContext::LayerTreeContext):
     24        (WebKit::LayerTreeContext::~LayerTreeContext):
     25        (WebKit::LayerTreeContext::encode):
     26        (WebKit::LayerTreeContext::decode):
     27        (WebKit::LayerTreeContext::isEmpty):
     28        (WebKit::operator==):
     29        * UIProcess/DrawingAreaProxy.h:
     30        (WebKit::DrawingAreaProxy::syncCompositingLayers):
     31        (WebKit::DrawingAreaProxy::updateCompositingLayerContent):
     32        * UIProcess/DrawingAreaProxy.messages.in:
     33        * WebKit2.pro:
     34        * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
     35        (WebCore::collectCompositingInfoForThisLayer):
     36        * WebProcess/WebPage/LayerTreeHost.cpp:
     37        (WebKit::LayerTreeHost::create):
     38        * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
     39        (WebKit::LayerTreeHostQt::create):
     40        (WebKit::LayerTreeHostQt::~LayerTreeHostQt):
     41        (WebKit::LayerTreeHostQt::LayerTreeHostQt):
     42        (WebKit::LayerTreeHostQt::setLayerFlushSchedulingEnabled):
     43        (WebKit::LayerTreeHostQt::scheduleLayerFlush):
     44        (WebKit::LayerTreeHostQt::cancelPendingLayerFlush):
     45        (WebKit::LayerTreeHostQt::setShouldNotifyAfterNextScheduledLayerFlush):
     46        (WebKit::LayerTreeHostQt::setRootCompositingLayer):
     47        (WebKit::LayerTreeHostQt::invalidate):
     48        (WebKit::LayerTreeHostQt::setNonCompositedContentsNeedDisplay):
     49        (WebKit::LayerTreeHostQt::scrollNonCompositedContents):
     50        (WebKit::LayerTreeHostQt::forceRepaint):
     51        (WebKit::LayerTreeHostQt::sizeDidChange):
     52        (WebKit::LayerTreeHostQt::didInstallPageOverlay):
     53        (WebKit::LayerTreeHostQt::didUninstallPageOverlay):
     54        (WebKit::LayerTreeHostQt::setPageOverlayNeedsDisplay):
     55        (WebKit::LayerTreeHostQt::flushPendingLayerChanges):
     56        (WebKit::LayerTreeHostQt::performScheduledLayerFlush):
     57        (WebKit::LayerTreeHostQt::layerFlushTimerFired):
     58        (WebKit::LayerTreeHostQt::createPageOverlayLayer):
     59        (WebKit::LayerTreeHostQt::destroyPageOverlayLayer):
     60        (WebKit::LayerTreeHostQt::notifyAnimationStarted):
     61        (WebKit::LayerTreeHostQt::notifySyncRequired):
     62        (WebKit::LayerTreeHostQt::paintContents):
     63        (WebKit::LayerTreeHostQt::showDebugBorders):
     64        (WebKit::LayerTreeHostQt::showRepaintCounter):
     65        (WebKit::LayerTreeHost::supportsAcceleratedCompositing):
     66        * WebProcess/WebPage/qt/LayerTreeHostQt.h: Added.
     67        (WebKit::LayerTreeHostQt::layerTreeContext):
     68        (WebKit::LayerTreeHostQt::pauseRendering):
     69        (WebKit::LayerTreeHostQt::resumeRendering):
     70
    1712011-06-14  Noam Rosenthal  <noam.rosenthal@nokia.com>
    272
  • trunk/Source/WebKit2/Scripts/webkit2/messages.py

    r88462 r88799  
    465465        'WebKit::WebGestureEvent': '"WebEvent.h"',
    466466        'WebKit::WebKeyboardEvent': '"WebEvent.h"',
     467        'WebKit::WebLayerUpdateInfo': '"WebLayerTreeInfo.h"',
    467468        'WebKit::WebMouseEvent': '"WebEvent.h"',
    468469        'WebKit::WebTouchEvent': '"WebEvent.h"',
  • trunk/Source/WebKit2/Shared/LayerTreeContext.h

    r87831 r88799  
    4848#elif PLATFORM(WIN)
    4949    HWND window;
     50#elif PLATFORM(QT)
     51    uint32_t webLayerID;
    5052#endif
    5153};
  • trunk/Source/WebKit2/Shared/qt/LayerTreeContextQt.cpp

    r84613 r88799  
    2727#include "LayerTreeContext.h"
    2828
    29 #include "NotImplemented.h"
     29#include "ArgumentDecoder.h"
     30#include "ArgumentEncoder.h"
    3031
    3132namespace WebKit {
    3233
    3334LayerTreeContext::LayerTreeContext()
     35    : webLayerID(0)
    3436{
    35     notImplemented();
    3637}
    3738
    3839LayerTreeContext::~LayerTreeContext()
    3940{
    40     notImplemented();
    4141}
    4242
    43 void LayerTreeContext::encode(CoreIPC::ArgumentEncoder*) const
     43void LayerTreeContext::encode(CoreIPC::ArgumentEncoder* encoder) const
    4444{
    45     notImplemented();
     45    encoder->encode(webLayerID);
    4646}
    4747
    48 bool LayerTreeContext::decode(CoreIPC::ArgumentDecoder*, LayerTreeContext&)
     48bool LayerTreeContext::decode(CoreIPC::ArgumentDecoder* decoder, LayerTreeContext& context)
    4949{
    50     notImplemented();
    51     return true;
     50    return decoder->decode(context.webLayerID);
    5251}
    5352
    5453bool LayerTreeContext::isEmpty() const
    5554{
    56     notImplemented();
    57     return true;
     55    return !webLayerID;
    5856}
    5957
    60 bool operator==(const LayerTreeContext&, const LayerTreeContext&)
     58bool operator==(const LayerTreeContext& a, const LayerTreeContext& b)
    6159{
    62     notImplemented();
    63     return true;
     60    return a.webLayerID == b.webLayerID;
    6461}
    6562
  • trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h

    r88463 r88799  
    5353class LayerTreeContext;
    5454class UpdateInfo;
     55class WebLayerTreeInfo;
     56class WebLayerUpdateInfo;
    5557class WebPageProxy;
    5658
     
    108110    virtual void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) { }
    109111    virtual void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo&) { }
     112#if USE(TEXTURE_MAPPER)
     113    virtual void syncCompositingLayers(const WebLayerTreeInfo&) { }
     114    virtual void updateCompositingLayerContent(const WebLayerUpdateInfo&) { }
     115#endif
    110116#endif
    111117#if ENABLE(TILED_BACKING_STORE)
  • trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in

    r88463 r88799  
    2828    ExitAcceleratedCompositingMode(uint64_t backingStoreStateID, WebKit::UpdateInfo updateInfo)
    2929#endif
     30#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
     31    SyncCompositingLayers(WebKit::WebLayerTreeInfo layerTreeInfo)
     32    UpdateCompositingLayerContent(WebKit::WebLayerUpdateInfo layerUpdateInfo)
     33#endif
    3034#if ENABLE(TILED_BACKING_STORE)
    3135    Invalidate(WebCore::IntRect dirtyRect)
  • trunk/Source/WebKit2/WebKit2.pro

    r88463 r88799  
    150150    Shared/WebGraphicsContext.h \
    151151    Shared/WebImage.h \
     152    Shared/WebLayerTreeInfo.h \
    152153    Shared/WebNavigationDataStore.h \
    153154    Shared/WebNumber.h \
     
    280281    WebProcess/WebCoreSupport/WebFrameLoaderClient.h \
    281282    WebProcess/WebCoreSupport/WebGeolocationClient.h \
     283    WebProcess/WebCoreSupport/WebGraphicsLayer.h \
    282284    WebProcess/WebCoreSupport/WebInspectorClient.h \
    283285    WebProcess/WebCoreSupport/WebInspectorFrontendClient.h \
     
    358360    Shared/WebKeyboardEvent.cpp \
    359361    Shared/WebImage.cpp \
     362    Shared/WebLayerTreeInfo.cpp \
    360363    Shared/WebMouseEvent.cpp \
    361364    Shared/WebOpenPanelParameters.cpp \
     
    505508    WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp \
    506509    WebProcess/WebCoreSupport/WebGeolocationClient.cpp \
     510    WebProcess/WebCoreSupport/WebGraphicsLayer.cpp \
    507511    WebProcess/WebCoreSupport/WebInspectorClient.cpp \
    508512    WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp \
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp

    r88689 r88799  
    406406}
    407407
    408 static void collectCompositingInfoForThisLayer(GraphicsLayer* layer, WebLayerTreeInfo& outInfo, Vector<WebGraphicsLayer*>& outLayers)
    409 {
    410     WebGraphicsLayer* layer = toWebGraphicsLayer(layer);
     408static void collectCompositingInfoForThisLayer(GraphicsLayer* graphicsLayer, WebLayerTreeInfo& outInfo, Vector<WebGraphicsLayer*>& outLayers)
     409{
     410    WebGraphicsLayer* layer = toWebGraphicsLayer(graphicsLayer);
    411411    if (!layer)
    412412        return;
  • trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp

    r84524 r88799  
    3535#endif
    3636
     37#if PLATFORM(QT) && USE(TEXTURE_MAPPER)
     38#include "qt/LayerTreeHostQt.h"
     39#endif
     40
    3741using namespace WebCore;
    3842
     
    4549#elif PLATFORM(WIN) && HAVE(WKQCA)
    4650    return LayerTreeHostCAWin::create(webPage);
     51#elif PLATFORM(QT) && USE(TEXTURE_MAPPER)
     52    return LayerTreeHostQt::create(webPage);
    4753#else
    4854    return 0;
  • trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp

    r86761 r88799  
    2626
    2727#include "config.h"
     28
     29#if USE(ACCELERATED_COMPOSITING)
     30
     31#include "LayerTreeHostQt.h"
     32
     33#include "DrawingAreaImpl.h"
     34#include "DrawingAreaMessages.h"
     35#include "DrawingAreaProxyMessages.h"
     36#include "GraphicsContext.h"
     37#include "MessageID.h"
     38#include "WebGraphicsLayer.h"
     39#include "WebPage.h"
     40#include <WebCore/Frame.h>
     41#include <WebCore/FrameView.h>
     42#include <WebCore/Page.h>
     43#include <WebCore/Settings.h>
     44
     45using namespace WebCore;
     46
     47namespace WebKit {
     48
     49PassRefPtr<LayerTreeHostQt> LayerTreeHostQt::create(WebPage* webPage)
     50{
     51    return adoptRef(new LayerTreeHostQt(webPage));
     52}
     53
     54LayerTreeHostQt::~LayerTreeHostQt()
     55{
     56}
     57
     58LayerTreeHostQt::LayerTreeHostQt(WebPage* webPage)
     59    : LayerTreeHost(webPage)
     60    , m_notifyAfterScheduledLayerFlush(false)
     61    , m_isValid(true)
     62    , m_layerFlushTimer(this, &LayerTreeHostQt::layerFlushTimerFired)
     63    , m_layerFlushSchedulingEnabled(true)
     64{
     65    // Create a root layer.
     66    m_rootLayer = GraphicsLayer::create(this);
     67#ifndef NDEBUG
     68    m_rootLayer->setName("LayerTreeHostQt root layer");
     69#endif
     70    m_rootLayer->setDrawsContent(false);
     71    m_rootLayer->setSize(m_webPage->size());
     72    m_layerTreeContext.webLayerID = toWebGraphicsLayer(m_rootLayer.get())->id();
     73
     74    m_nonCompositedContentLayer = GraphicsLayer::create(this);
     75#ifndef NDEBUG
     76    m_nonCompositedContentLayer->setName("LayerTreeHostQt non-composited content");
     77#endif
     78    m_nonCompositedContentLayer->setDrawsContent(true);
     79    m_nonCompositedContentLayer->setContentsOpaque(m_webPage->drawsBackground() && !m_webPage->drawsTransparentBackground());
     80    m_nonCompositedContentLayer->setSize(m_webPage->size());
     81
     82    m_rootLayer->addChild(m_nonCompositedContentLayer.get());
     83
     84    if (m_webPage->hasPageOverlay())
     85        createPageOverlayLayer();
     86
     87    scheduleLayerFlush();
     88}
     89
     90void LayerTreeHostQt::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
     91{
     92    if (m_layerFlushSchedulingEnabled == layerFlushingEnabled)
     93        return;
     94
     95    m_layerFlushSchedulingEnabled = layerFlushingEnabled;
     96
     97    if (m_layerFlushSchedulingEnabled)
     98        return;
     99
     100    cancelPendingLayerFlush();
     101}
     102
     103void LayerTreeHostQt::scheduleLayerFlush()
     104{
     105    if (!m_layerFlushSchedulingEnabled)
     106        return;
     107
     108    if (!m_layerFlushTimer.isActive())
     109        m_layerFlushTimer.startOneShot(0);
     110}
     111
     112void LayerTreeHostQt::cancelPendingLayerFlush()
     113{
     114    m_layerFlushTimer.stop();
     115}
     116
     117void LayerTreeHostQt::setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush)
     118{
     119    m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush;
     120}
     121
     122void LayerTreeHostQt::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer)
     123{
     124    m_nonCompositedContentLayer->removeAllChildren();
     125
     126    // Add the accelerated layer tree hierarchy.
     127    if (graphicsLayer)
     128        m_nonCompositedContentLayer->addChild(graphicsLayer);
     129}
     130
     131void LayerTreeHostQt::invalidate()
     132{
     133    cancelPendingLayerFlush();
     134
     135    ASSERT(m_isValid);
     136    m_rootLayer = nullptr;
     137    m_isValid = false;
     138}
     139
     140void LayerTreeHostQt::setNonCompositedContentsNeedDisplay(const WebCore::IntRect& rect)
     141{
     142    m_nonCompositedContentLayer->setNeedsDisplayInRect(rect);
     143    if (m_pageOverlayLayer)
     144        m_pageOverlayLayer->setNeedsDisplayInRect(rect);
     145
     146    scheduleLayerFlush();
     147}
     148
     149void LayerTreeHostQt::scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset)
     150{
     151    setNonCompositedContentsNeedDisplay(scrollRect);
     152}
     153
     154void LayerTreeHostQt::forceRepaint()
     155{
     156    scheduleLayerFlush();
     157}
     158
     159void LayerTreeHostQt::sizeDidChange(const WebCore::IntSize& newSize)
     160{
     161    m_rootLayer->setSize(newSize);
     162
     163    // If the newSize exposes new areas of the non-composited content a setNeedsDisplay is needed
     164    // for those newly exposed areas.
     165    FloatSize oldSize = m_nonCompositedContentLayer->size();
     166    m_nonCompositedContentLayer->setSize(newSize);
     167
     168    if (newSize.width() > oldSize.width()) {
     169        float height = std::min(static_cast<float>(newSize.height()), oldSize.height());
     170        m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(oldSize.width(), 0, newSize.width() - oldSize.width(), height));
     171    }
     172
     173    if (newSize.height() > oldSize.height())
     174        m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(0, oldSize.height(), newSize.width(), newSize.height() - oldSize.height()));
     175
     176    if (m_pageOverlayLayer)
     177        m_pageOverlayLayer->setSize(newSize);
     178
     179    scheduleLayerFlush();
     180}
     181
     182void LayerTreeHostQt::didInstallPageOverlay()
     183{
     184    createPageOverlayLayer();
     185    scheduleLayerFlush();
     186
     187}
     188
     189void LayerTreeHostQt::didUninstallPageOverlay()
     190{
     191    destroyPageOverlayLayer();
     192    scheduleLayerFlush();
     193}
     194
     195void LayerTreeHostQt::setPageOverlayNeedsDisplay(const WebCore::IntRect& rect)
     196{
     197    ASSERT(m_pageOverlayLayer);
     198    m_pageOverlayLayer->setNeedsDisplayInRect(rect);
     199    scheduleLayerFlush();
     200}
     201
     202bool LayerTreeHostQt::flushPendingLayerChanges()
     203{
     204    m_rootLayer->syncCompositingStateForThisLayerOnly();
     205    m_nonCompositedContentLayer->syncCompositingStateForThisLayerOnly();
     206    if (m_pageOverlayLayer)
     207        m_pageOverlayLayer->syncCompositingStateForThisLayerOnly();
     208
     209    return m_webPage->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
     210}
     211
     212
     213void LayerTreeHostQt::performScheduledLayerFlush()
     214{
     215    m_webPage->layoutIfNeeded();
     216
     217    if (!m_isValid)
     218        return;
     219
     220    if (flushPendingLayerChanges()) {
     221        if (m_notifyAfterScheduledLayerFlush) {
     222            // Let the drawing area know that we've done a flush of the layer changes.
     223            static_cast<DrawingAreaImpl*>(m_webPage->drawingArea())->layerHostDidFlushLayers();
     224            m_notifyAfterScheduledLayerFlush = false;
     225        }
     226        WebGraphicsLayer::sendLayersToUIProcess(m_rootLayer.get(), m_webPage);
     227    }
     228}
     229
     230void LayerTreeHostQt::layerFlushTimerFired(Timer<LayerTreeHostQt>*)
     231{
     232    performScheduledLayerFlush();
     233}
     234
     235void LayerTreeHostQt::createPageOverlayLayer()
     236{
     237    ASSERT(!m_pageOverlayLayer);
     238
     239    m_pageOverlayLayer = GraphicsLayer::create(this);
     240#ifndef NDEBUG
     241    m_pageOverlayLayer->setName("LayerTreeHostQt page overlay content");
     242#endif
     243
     244    m_pageOverlayLayer->setDrawsContent(true);
     245    m_pageOverlayLayer->setSize(m_webPage->size());
     246
     247    m_rootLayer->addChild(m_pageOverlayLayer.get());
     248}
     249
     250void LayerTreeHostQt::destroyPageOverlayLayer()
     251{
     252    ASSERT(m_pageOverlayLayer);
     253    m_pageOverlayLayer->removeFromParent();
     254    m_pageOverlayLayer = nullptr;
     255}
     256
     257void LayerTreeHostQt::notifyAnimationStarted(const WebCore::GraphicsLayer*, double time)
     258{
     259}
     260
     261void LayerTreeHostQt::notifySyncRequired(const WebCore::GraphicsLayer*)
     262{
     263}
     264
     265void LayerTreeHostQt::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext& graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect)
     266{
     267    if (graphicsLayer == m_nonCompositedContentLayer) {
     268        m_webPage->drawRect(graphicsContext, clipRect);
     269        return;
     270    }
     271
     272    if (graphicsLayer == m_pageOverlayLayer) {
     273        m_webPage->drawPageOverlay(graphicsContext, clipRect);
     274        return;
     275    }
     276}
     277
     278bool LayerTreeHostQt::showDebugBorders() const
     279{
     280    return m_webPage->corePage()->settings()->showDebugBorders();
     281}
     282
     283bool LayerTreeHostQt::showRepaintCounter() const
     284{
     285    return m_webPage->corePage()->settings()->showRepaintCounter();
     286}
     287
     288bool LayerTreeHost::supportsAcceleratedCompositing()
     289{
     290    return true;
     291}
     292
     293} // namespace WebKit
     294#else
    28295#include "LayerTreeHost.h"
    29296
     297using namespace WebCore;
     298
    30299namespace WebKit {
    31300
     
    36305
    37306} // namespace WebKit
     307#endif
Note: See TracChangeset for help on using the changeset viewer.