Changeset 106109 in webkit


Ignore:
Timestamp:
Jan 27, 2012 4:46:18 AM (12 years ago)
Author:
jocelyn.turcotte@nokia.com
Message:

[Qt] WKTR: Use a software rendering pipiline when running tests.
https://bugs.webkit.org/show_bug.cgi?id=76708

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

  • platform/graphics/qt/TextureMapperQt.cpp: Allow setting the context to null.

(WebCore::TextureMapperQt::setGraphicsContext):

  • platform/graphics/qt/TextureMapperQt.h:

(WebCore::TextureMapperQt::initialize):

Source/WebKit2:

Animation layout tests require the graphics layers tree to be updated
to pass. WebkitTestRunner doesn't show its wrapping QQuickView, which
prevents the rendering pipeline to run and then in turn blocks the web
process from processing further graphics layer updates.

This allows the tests to use a TextureMapperQt to empty the LayerTreeHost's
message queue and render the layers in software on an offscreen buffer.

  • UIProcess/API/qt/qquickwebpage.cpp:

(QQuickWebPagePrivate::paint):

  • UIProcess/API/qt/qquickwebview.cpp:

(QQuickWebViewPrivate::QQuickWebViewPrivate):
(QQuickWebViewPrivate::setNeedsDisplay):
(QQuickWebViewExperimental::setRenderToOffscreenBuffer):
(QQuickWebViewExperimental::renderToOffscreenBuffer):

  • UIProcess/API/qt/qquickwebview_p.h:
  • UIProcess/API/qt/qquickwebview_p_p.h:

(QQuickWebViewPrivate::setRenderToOffscreenBuffer):
(QQuickWebViewPrivate::renderToOffscreenBuffer):

  • UIProcess/qt/LayerTreeHostProxyQt.cpp:

(WebKit::LayerTreeHostProxy::paintToGraphicsContext):

Tools:

  • WebKitTestRunner/qt/PlatformWebViewQt.cpp:

(WTR::WrapperWindow::WrapperWindow):
(WTR::PlatformWebView::PlatformWebView): Use software rendering of layers since the wrapping QQuickView isn't shown.

LayoutTests:

  • platform/qt-wk2/Skipped:
Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106108 r106109  
     12012-01-26  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
     2
     3        [Qt] WKTR: Use a software rendering pipiline when running tests.
     4        https://bugs.webkit.org/show_bug.cgi?id=76708
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * platform/qt-wk2/Skipped:
     9
    1102012-01-27 Branimir Lambov <blambov@google.com>
    211
  • trunk/LayoutTests/platform/qt-wk2/Skipped

    r106040 r106109  
    440440tables/mozilla_expected_failures/marvin/backgr_position-table-column.html
    441441
    442 # [Qt][WK2] REGRESSION(r105517): It made 49 tests timeout
    443 # https://bugs.webkit.org/show_bug.cgi?id=76708
    444 animations/3d/change-transform-in-end-event.html
    445 animations/3d/replace-filling-transform.html
    446 animations/3d/state-at-end-event-transform.html
    447 animations/3d/transform-perspective.html
    448 animations/additive-transform-animations.html
    449 animations/animation-direction-normal.html
    450 animations/animation-end-event-destroy-renderer.html
    451 animations/animation-hit-test-transform.html
    452 animations/animation-iteration-event-destroy-renderer.html
    453 animations/animation-matrix-negative-scale-unmatrix.html
    454 animations/animation-start-event-destroy-renderer.html
    455 animations/big-rotation.html
    456 animations/combo-transform-rotate+scale.html
    457 animations/combo-transform-translate+scale.html
    458 animations/dynamic-stylesheet-loading.html
    459 animations/fill-mode-transform.html
    460 animations/keyframe-timing-functions-transform.html
    461 animations/matrix-anim.html
    462 animations/missing-from-to-transforms.html
    463 animations/missing-keyframe-properties-repeating.html
    464 animations/missing-keyframe-properties-timing-function.html
    465 animations/missing-keyframe-properties.html
    466 animations/missing-values-first-keyframe.html
    467 animations/missing-values-last-keyframe.html
    468 animations/negative-delay.html
    469 animations/opacity-transform-animation.html
    470 animations/pause-crash.html
    471 animations/play-state-paused.html
    472 animations/play-state-suspend.html
    473 animations/simultaneous-start-transform.html
    474 animations/stop-animation-on-suspend.html
    475 animations/suspend-resume-animation.html
    476 animations/suspend-transform-animation.html
    477 animations/transition-and-animation-1.html
    478 animations/transition-and-animation-2.html
    479 fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html
    480 tables/mozilla/marvin/backgr_simple-table-cell.html
    481 transitions/3d/interrupted-transition.html
    482 transitions/cancel-transition.html
    483 transitions/extra-transition.html
    484 transitions/interrupt-transform-transition.html
    485 transitions/interrupted-accelerated-transition.html
    486 transitions/move-after-transition.html
    487 transitions/start-transform-transition.html
    488 transitions/transition-end-event-destroy-iframe.html
    489 transitions/transition-end-event-destroy-renderer.html
    490 transitions/transition-end-event-multiple-04.html
    491 transitions/transition-end-event-rendering.html
    492 transitions/transition-end-event-transform.html
    493 
    494442# [Qt][WK2] http/tests/history/replacestate-post-to-get-2.html fails with timeout
    495443# https://bugs.webkit.org/show_bug.cgi?id=76784
  • trunk/Source/WebCore/ChangeLog

    r106108 r106109  
     12012-01-26  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
     2
     3        [Qt] WKTR: Use a software rendering pipiline when running tests.
     4        https://bugs.webkit.org/show_bug.cgi?id=76708
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * platform/graphics/qt/TextureMapperQt.cpp: Allow setting the context to null.
     9        (WebCore::TextureMapperQt::setGraphicsContext):
     10        * platform/graphics/qt/TextureMapperQt.h:
     11        (WebCore::TextureMapperQt::initialize):
     12
    1132012-01-27  Branimir Lambov  <blambov@google.com>
    214
  • trunk/Source/WebCore/platform/graphics/qt/TextureMapperQt.cpp

    r105737 r106109  
    142142{
    143143    m_context = context;
    144     m_painter = context->platformContext();
     144    m_painter = context ? context->platformContext() : 0;
    145145    initialize(m_painter);
    146146}
  • trunk/Source/WebCore/platform/graphics/qt/TextureMapperQt.h

    r96118 r106109  
    7171    static void initialize(QPainter* painter)
    7272    {
    73         painter->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, false);
     73        if (painter)
     74            painter->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, false);
    7475    }
    7576
  • trunk/Source/WebKit2/ChangeLog

    r106104 r106109  
     12012-01-26  No'am Rosenthal  <noam.rosenthal@nokia.com> and Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
     2
     3        [Qt] WKTR: Use a software rendering pipiline when running tests.
     4        https://bugs.webkit.org/show_bug.cgi?id=76708
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Animation layout tests require the graphics layers tree to be updated
     9        to pass. WebkitTestRunner doesn't show its wrapping QQuickView, which
     10        prevents the rendering pipeline to run and then in turn blocks the web
     11        process from processing further graphics layer updates.
     12
     13        This allows the tests to use a TextureMapperQt to empty the LayerTreeHost's
     14        message queue and render the layers in software on an offscreen buffer.
     15
     16        * UIProcess/API/qt/qquickwebpage.cpp:
     17        (QQuickWebPagePrivate::paint):
     18        * UIProcess/API/qt/qquickwebview.cpp:
     19        (QQuickWebViewPrivate::QQuickWebViewPrivate):
     20        (QQuickWebViewPrivate::setNeedsDisplay):
     21        (QQuickWebViewExperimental::setRenderToOffscreenBuffer):
     22        (QQuickWebViewExperimental::renderToOffscreenBuffer):
     23        * UIProcess/API/qt/qquickwebview_p.h:
     24        * UIProcess/API/qt/qquickwebview_p_p.h:
     25        (QQuickWebViewPrivate::setRenderToOffscreenBuffer):
     26        (QQuickWebViewPrivate::renderToOffscreenBuffer):
     27        * UIProcess/qt/LayerTreeHostProxyQt.cpp:
     28        (WebKit::LayerTreeHostProxy::paintToGraphicsContext):
     29
    1302012-01-27  Simon Hausmann  <simon.hausmann@nokia.com>
    231
  • trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp

    r104823 r106109  
    101101}
    102102
     103void QQuickWebPagePrivate::paint(QPainter* painter)
     104{
     105    if (webPageProxy->drawingArea())
     106        webPageProxy->drawingArea()->paintLayerTree(painter);
     107}
     108
    103109void QQuickWebPagePrivate::paintToCurrentGLContext()
    104110{
  • trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h

    r104823 r106109  
    4444
    4545    void paintToCurrentGLContext();
     46    void paint(QPainter*);
    4647    void resetPaintNode();
    4748
  • trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp

    r106022 r106109  
    6868    , pageIsSuspended(false)
    6969    , m_navigatorQtObjectEnabled(false)
     70    , m_renderToOffscreenBuffer(false)
    7071{
    7172    viewport->setFlags(QQuickItem::ItemClipsChildrenToShape);
     
    155156}
    156157
     158void QQuickWebViewPrivate::setNeedsDisplay()
     159{
     160    Q_Q(QQuickWebView);
     161    if (renderToOffscreenBuffer()) {
     162        // TODO: we can maintain a real image here and use it for pixel tests. Right now this is used only for running the rendering code-path while running tests.
     163        QImage dummyImage(1, 1, QImage::Format_ARGB32);
     164        QPainter painter(&dummyImage);
     165        q->page()->d->paint(&painter);
     166        return;
     167    }
     168
     169    q->page()->update();
     170}
     171
    157172void QQuickWebViewPrivate::loadDidCommit()
    158173{
     
    658673
    659674    d->setUseTraditionalDesktopBehaviour(enable);
     675}
     676
     677void QQuickWebViewExperimental::setRenderToOffscreenBuffer(bool enable)
     678{
     679    Q_D(QQuickWebView);
     680    d->setRenderToOffscreenBuffer(enable);
     681}
     682
     683bool QQuickWebViewExperimental::renderToOffscreenBuffer() const
     684{
     685    Q_D(const QQuickWebView);
     686    return d->renderToOffscreenBuffer();
    660687}
    661688
  • trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h

    r106022 r106109  
    238238    QDeclarativeComponent* itemSelector() const;
    239239    void setItemSelector(QDeclarativeComponent*);
    240    
     240    bool useTraditionalDesktopBehaviour() const;
     241    void setUseTraditionalDesktopBehaviour(bool enable);
     242
    241243    QWebViewportInfo* viewportInfo();
    242244
    243245    QWebPreferences* preferences() const;
    244     bool useTraditionalDesktopBehaviour() const;
    245246    QWebNavigationHistory* navigationHistory() const;
    246247    QQuickWebPage* page();
     
    254255    void sendApplicationSchemeReply(QQuickNetworkReply*);
    255256
     257    // C++ only
     258    bool renderToOffscreenBuffer() const;
     259    void setRenderToOffscreenBuffer(bool enable);
     260
    256261public Q_SLOTS:
    257     void setUseTraditionalDesktopBehaviour(bool enable);
    258262    void goBackTo(int index);
    259263    void goForwardTo(int index);
  • trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h

    r105670 r106109  
    7878    void didChangeBackForwardList();
    7979
     80    void setNeedsDisplay();
     81
    8082    void updateDesktopViewportSize();
    8183    void updateTouchViewportSize();
     
    102104
    103105    void setUseTraditionalDesktopBehaviour(bool enable);
     106    void setRenderToOffscreenBuffer(bool enable) { m_renderToOffscreenBuffer = enable; }
    104107    void setViewInAttachedProperties(QObject*);
    105108    void setIcon(const QUrl&);
    106109
    107110    bool navigatorQtObjectEnabled() const;
     111    bool renderToOffscreenBuffer() const { return m_renderToOffscreenBuffer; }
    108112    void setNavigatorQtObjectEnabled(bool);
    109113
     
    167171    bool pageIsSuspended;
    168172    bool m_navigatorQtObjectEnabled;
     173    bool m_renderToOffscreenBuffer;
    169174    QUrl m_iconURL;
    170175};
  • trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h

    r102435 r106109  
    2828#define DrawingAreaProxy_h
    2929
     30#include "BackingStore.h"
    3031#include "DrawingAreaInfo.h"
    3132#include <WebCore/IntRect.h>
     
    8990    virtual bool isBackingStoreReady() const { return true; }
    9091    virtual void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float opacity) { }
     92    virtual void paintLayerTree(BackingStore::PlatformGraphicsContext) { }
    9193    LayerTreeHostProxy* layerTreeHostProxy() const { return m_layerTreeHostProxy.get(); }
    9294
  • trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp

    r105517 r106109  
    361361}
    362362
     363void DrawingAreaProxyImpl::paintLayerTree(BackingStore::PlatformGraphicsContext context)
     364{
     365    if (m_layerTreeHostProxy)
     366        m_layerTreeHostProxy->paintToGraphicsContext(context);
     367}
     368
    363369void DrawingAreaProxyImpl::paintToCurrentGLContext(const TransformationMatrix& matrix, float opacity)
    364370{
  • trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h

    r105475 r106109  
    8282    virtual void setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint&);
    8383    virtual void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float opacity);
     84    virtual void paintLayerTree(BackingStore::PlatformGraphicsContext);
    8485    void didReceiveLayerTreeHostProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    8586#endif
  • trunk/Source/WebKit2/UIProcess/LayerTreeHostProxy.h

    r105757 r106109  
    5454    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    5555    void paintToCurrentGLContext(const WebCore::TransformationMatrix&, float);
     56    void paintToGraphicsContext(BackingStore::PlatformGraphicsContext);
    5657    void purgeGLResources();
    5758    void setVisibleContentsRectAndScale(const WebCore::IntRect&, float);
  • trunk/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp

    r105737 r106109  
    2828#include "ShareableBitmap.h"
    2929#include "TextureMapperGL.h"
     30#include "TextureMapperQt.h"
    3031#include "UpdateInfo.h"
    3132#include "WebCoreArgumentCoders.h"
     
    172173    if (!m_textureMapper)
    173174        m_textureMapper = TextureMapperGL::create();
     175    ASSERT(dynamic_cast<TextureMapperGL*>(m_textureMapper.get()));
    174176
    175177    syncRemoteContent();
     
    204206    }
    205207}
     208
     209void LayerTreeHostProxy::paintToGraphicsContext(QPainter* painter)
     210{
     211    if (!m_textureMapper)
     212        m_textureMapper = TextureMapperQt::create();
     213    ASSERT(dynamic_cast<TextureMapperQt*>(m_textureMapper.get()));
     214
     215    syncRemoteContent();
     216    TextureMapperNode* node = toTextureMapperNode(rootLayer());
     217
     218    if (!node)
     219        return;
     220
     221    GraphicsContext graphicsContext(painter);
     222    m_textureMapper->setGraphicsContext(&graphicsContext);
     223    m_textureMapper->beginPainting();
     224    m_textureMapper->bindSurface(0);
     225    node->paint();
     226    m_textureMapper->endPainting();
     227    m_textureMapper->setGraphicsContext(0);
     228}
     229
    206230
    207231void LayerTreeHostProxy::didFireViewportUpdateTimer(Timer<LayerTreeHostProxy>*)
  • trunk/Source/WebKit2/UIProcess/qt/QtPageClient.cpp

    r105711 r106109  
    6363void QtPageClient::setViewNeedsDisplay(const WebCore::IntRect& rect)
    6464{
    65     m_webView->page()->update();
     65    QQuickWebViewPrivate::get(m_webView)->setNeedsDisplay();
    6666}
    6767
  • trunk/Tools/ChangeLog

    r106093 r106109  
     12012-01-26  No'am Rosenthal  <noam.rosenthal@nokia.com> and Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
     2
     3        [Qt] WKTR: Use a software rendering pipiline when running tests.
     4        https://bugs.webkit.org/show_bug.cgi?id=76708
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
     9        (WTR::WrapperWindow::WrapperWindow):
     10        (WTR::PlatformWebView::PlatformWebView): Use software rendering of layers since the wrapping QQuickView isn't shown.
     11
    1122012-01-26  Kevin Ollivier  <kevino@theolliviers.com>
    213
  • trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp

    r104450 r106109  
    4646        , m_view(view)
    4747    {
    48         QQuickWebViewExperimental(view).setUseTraditionalDesktopBehaviour(true);
    4948        connect(this, SIGNAL(statusChanged(QQuickView::Status)), SLOT(handleStatusChanged(QQuickView::Status)));
    5049    }
     
    7675    , m_modalEventLoop(0)
    7776{
     77    QQuickWebViewExperimental experimental(m_view);
     78    experimental.setUseTraditionalDesktopBehaviour(true);
     79    experimental.setRenderToOffscreenBuffer(true);
    7880}
    7981
Note: See TracChangeset for help on using the changeset viewer.