Changeset 57961 in webkit


Ignore:
Timestamp:
Apr 21, 2010 3:09:48 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-21 No'am Rosenthal <noam.rosenthal@nokia.com>

Reviewed by Simon Fraser.

[Qt] Fix or remove the runtime flag for accelerated compositing.

This adds a way for a chrome client to disallow layers from becoming composited,
even if the settings enable accelerated compositing. This is necessary for platforms
where different views can be applied with the same settings to the same page.

We enable an API through ChromeClient to ask the chrome-client whether or not
it can render composited layers, which is taken into account when the compositor
decides whether or not to start compositing.

https://bugs.webkit.org/show_bug.cgi?id=37313

Pages under LayoutTests/compositing now work under QWebView, even when
QWebSettings::AcceleratedCompositingEnabled is on.

  • page/ChromeClient.h: (WebCore::ChromeClient::allowsAcceleratedCompositing):
  • platform/qt/QWebPageClient.h: (QWebPageClient::allowsAcceleratedCompositing):
  • rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::canBeComposited):

2010-04-21 No'am Rosenthal <noam.rosenthal@nokia.com>

Reviewed by Simon Fraser.

[Qt] Fix or remove the runtime flag for accelerated compositing.
https://bugs.webkit.org/show_bug.cgi?id=37313

This lets the QWebPageClient "veto" the settings value for accelerated compositing.
In this case we allow accelerated compositing only on QGraphicsWebView.

  • Api/qgraphicswebview.cpp: (QGraphicsWebViewPrivate::allowsAcceleratedCompositing):
  • WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::allowsAcceleratedCompositing):
  • WebCoreSupport/ChromeClientQt.h:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r57959 r57961  
     12010-04-21  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        [Qt] Fix or remove the runtime flag for accelerated compositing.
     6
     7        This adds a way for a chrome client to disallow layers from becoming composited,
     8        even if the settings enable accelerated compositing. This is necessary for platforms
     9        where different views can be applied with the same settings to the same page.
     10
     11        We enable an API through ChromeClient to ask the chrome-client whether or not
     12        it can render composited layers, which is taken into account when the compositor
     13        decides whether or not to start compositing.
     14
     15        https://bugs.webkit.org/show_bug.cgi?id=37313
     16
     17        Pages under LayoutTests/compositing now work under QWebView, even when
     18        QWebSettings::AcceleratedCompositingEnabled is on.
     19
     20        * page/ChromeClient.h:
     21        (WebCore::ChromeClient::allowsAcceleratedCompositing):
     22        * platform/qt/QWebPageClient.h:
     23        (QWebPageClient::allowsAcceleratedCompositing):
     24        * rendering/RenderLayerCompositor.cpp:
     25        (WebCore::RenderLayerCompositor::canBeComposited):
     26
    1272010-04-21  Ryosuke Niwa  <rniwa@webkit.org>
    228
  • trunk/WebCore/page/ChromeClient.h

    r57903 r57961  
    215215        // to do an eager layout before the drawing.
    216216        virtual void scheduleCompositingLayerSync() = 0;
     217        // Returns whether or not the client can render the composited layer,
     218        // regardless of the settings.
     219        virtual bool allowsAcceleratedCompositing() const { return true; }
    217220#endif
    218221
  • trunk/WebCore/platform/qt/QWebPageClient.h

    r56552 r57961  
    5656    // we wait for the next update and sync the layers then.
    5757    virtual void markForSync(bool scheduleSync = false) {}
     58    virtual bool allowsAcceleratedCompositing() const { return false; }
    5859#endif
    5960
  • trunk/WebCore/rendering/RenderLayerCompositor.cpp

    r57919 r57961  
    135135    }
    136136
     137    // We allow the chrome to override the settings, in case the page is rendered
     138    // on a chrome that doesn't allow accelerated compositing.
     139    if (hasAcceleratedCompositing) {
     140        Frame* frame = m_renderView->frameView()->frame();
     141        Page* page = frame ? frame->page() : 0;
     142        if (page)
     143            hasAcceleratedCompositing = page->chrome()->client()->allowsAcceleratedCompositing();
     144    }
     145
    137146    if (hasAcceleratedCompositing != m_hasAcceleratedCompositing || showDebugBorders != m_showDebugBorders || showRepaintCounter != m_showRepaintCounter)
    138147        setCompositingLayersNeedRebuild();
  • trunk/WebKit/qt/Api/qgraphicswebview.cpp

    r57327 r57961  
    123123    virtual void markForSync(bool scheduleSync);
    124124    void updateCompositingScrollPosition();
     125
     126    // QGraphicsWebView can render composited layers
     127    virtual bool allowsAcceleratedCompositing() const { return true; }
    125128#endif
    126129
  • trunk/WebKit/qt/Api/qwebview.cpp

    r57327 r57961  
    416416        connect(d->page, SIGNAL(destroyed()),
    417417                this, SLOT(_q_pageDestroyed()));
    418 #if USE(ACCELERATED_COMPOSITING)
    419         d->page->d->page->settings()->setAcceleratedCompositingEnabled(false);
    420 #endif
    421418    }
    422419    setAttribute(Qt::WA_OpaquePaintEvent, d->page);
  • trunk/WebKit/qt/ChangeLog

    r57931 r57961  
     12010-04-21  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        [Qt] Fix or remove the runtime flag for accelerated compositing.
     6        https://bugs.webkit.org/show_bug.cgi?id=37313
     7
     8        This lets the QWebPageClient "veto" the settings value for accelerated compositing.
     9        In this case we allow accelerated compositing only on QGraphicsWebView.
     10
     11        * Api/qgraphicswebview.cpp:
     12        (QGraphicsWebViewPrivate::allowsAcceleratedCompositing):
     13        * WebCoreSupport/ChromeClientQt.cpp:
     14        (WebCore::ChromeClientQt::allowsAcceleratedCompositing):
     15        * WebCoreSupport/ChromeClientQt.h:
     16
    1172010-04-20  Adam Barth  <abarth@webkit.org>
    218
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r57903 r57961  
    555555        platformPageClient()->markForSync(true);
    556556}
     557
     558bool ChromeClientQt::allowsAcceleratedCompositing() const
     559{
     560    return (platformPageClient() && platformPageClient()->allowsAcceleratedCompositing());
     561}
     562
    557563#endif
    558564
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h

    r57903 r57961  
    142142        virtual void setNeedsOneShotDrawingSynchronization();
    143143        virtual void scheduleCompositingLayerSync();
     144        virtual bool allowsAcceleratedCompositing() const;
    144145#endif
    145146
Note: See TracChangeset for help on using the changeset viewer.