Changeset 128315 in webkit


Ignore:
Timestamp:
Sep 12, 2012 8:36:45 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt] Segmentation fault when closing QtTestBrowser
https://bugs.webkit.org/show_bug.cgi?id=95003

Patch by Roland Takacs <rtakacs@inf.u-szeged.hu> on 2012-09-12
Reviewed by Simon Hausmann.

Source/WebCore:

Defined a new QObject* variable.
If WebKit1 is used, it points to the QGLWidget that was
created in 'createPlatformGraphicsContext3DFromWidget'.
If WebKit2 is used, it points to the QWindow that was
created in GraphicsContext3DPrivate's constructor.
It is neccessary for deallocating them.

  • platform/graphics/qt/GraphicsContext3DQt.cpp:

(GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):

  • platform/qt/QWebPageClient.h:

(QWebPageClient):

Source/WebKit/qt:

Defined a new QObject* variable that points to the QGLWidget that was created
in 'createPlatformGraphicsContext3DFromWidget'.
It is neccessary for deallocating it.

  • WebCoreSupport/PageClientQt.cpp:

(createPlatformGraphicsContext3DFromWidget):
(WebCore::PageClientQWidget::createPlatformGraphicsContext3D):
(WebCore::PageClientQGraphicsWidget::createPlatformGraphicsContext3D):

  • WebCoreSupport/PageClientQt.h:

(PageClientQWidget):
(PageClientQGraphicsWidget):

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128313 r128315  
     12012-09-12  Roland Takacs  <rtakacs@inf.u-szeged.hu>
     2
     3        [Qt] Segmentation fault when closing QtTestBrowser
     4        https://bugs.webkit.org/show_bug.cgi?id=95003
     5
     6        Reviewed by Simon Hausmann.
     7
     8        Defined a new QObject* variable.
     9        If WebKit1 is used, it points to the QGLWidget that was
     10        created in 'createPlatformGraphicsContext3DFromWidget'.
     11        If WebKit2 is used, it points to the QWindow that was
     12        created in GraphicsContext3DPrivate's constructor.
     13        It is neccessary for deallocating them.
     14
     15        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     16        (GraphicsContext3DPrivate):
     17        (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
     18        (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
     19        * platform/qt/QWebPageClient.h:
     20        (QWebPageClient):
     21
    1222012-09-12  Ryuan Choi  <ryuan.choi@samsung.com>
    223
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r126635 r128315  
    8585    PlatformGraphicsSurface3D m_surface;
    8686    PlatformGraphicsContext3D m_platformContext;
     87    QObject* m_surfaceOwner;
    8788#if USE(GRAPHICS_SURFACE)
    8889    GraphicsSurface::Flags m_surfaceFlags;
     
    112113    , m_surface(0)
    113114    , m_platformContext(0)
     115    , m_surfaceOwner(0)
    114116{
    115117    if (m_hostWindow && m_hostWindow->platformPageClient()) {
    116118        // This is the WebKit1 code path.
    117119        QWebPageClient* webPageClient = m_hostWindow->platformPageClient();
    118         webPageClient->createPlatformGraphicsContext3D(&m_platformContext, &m_surface);
     120        webPageClient->createPlatformGraphicsContext3D(&m_platformContext, &m_surface, &m_surfaceOwner);
    119121        if (!m_surface)
    120122            return;
     
    138140    window->create();
    139141    m_surface = window;
     142    m_surfaceOwner = window;
    140143
    141144    m_platformContext = new QOpenGLContext(window);
     
    209212GraphicsContext3DPrivate::~GraphicsContext3DPrivate()
    210213{
    211     if (m_hostWindow) {
    212         delete m_surface;
    213         m_surface = 0;
    214         // Platform context is assumed to be owned by surface.
    215         m_platformContext = 0;
    216     }
     214    delete m_surfaceOwner;
     215    m_surfaceOwner = 0;
    217216}
    218217
  • trunk/Source/WebCore/platform/qt/QWebPageClient.h

    r124879 r128315  
    109109#if USE(3D_GRAPHICS)
    110110    virtual void createPlatformGraphicsContext3D(PlatformGraphicsContext3D*,
    111                                                  PlatformGraphicsSurface3D*) = 0;
     111                                                 PlatformGraphicsSurface3D*,
     112                                                 QObject** = 0) = 0;
    112113#endif
    113114    virtual QWindow* ownerWindow() const;
  • trunk/Source/WebKit/qt/ChangeLog

    r128282 r128315  
     12012-09-12  Roland Takacs  <rtakacs@inf.u-szeged.hu>
     2
     3        [Qt] Segmentation fault when closing QtTestBrowser
     4        https://bugs.webkit.org/show_bug.cgi?id=95003
     5
     6        Reviewed by Simon Hausmann.
     7
     8        Defined a new QObject* variable that points to the QGLWidget that was created
     9        in 'createPlatformGraphicsContext3DFromWidget'.
     10        It is neccessary for deallocating it.
     11
     12        * WebCoreSupport/PageClientQt.cpp:
     13        (createPlatformGraphicsContext3DFromWidget):
     14        (WebCore::PageClientQWidget::createPlatformGraphicsContext3D):
     15        (WebCore::PageClientQGraphicsWidget::createPlatformGraphicsContext3D):
     16        * WebCoreSupport/PageClientQt.h:
     17        (PageClientQWidget):
     18        (PageClientQGraphicsWidget):
     19
    1202012-09-12  Andras Becsi  <andras.becsi@nokia.com>
    221
  • trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp

    r124879 r128315  
    3737
    3838static void createPlatformGraphicsContext3DFromWidget(QWidget* widget, PlatformGraphicsContext3D* context,
    39                                                       PlatformGraphicsSurface3D* surface)
     39                                                      PlatformGraphicsSurface3D* surface, QObject** surfaceOwner)
    4040{
    4141#ifdef QT_OPENGL_LIB
    4242    *context = 0;
    4343    *surface = 0;
     44    if (surfaceOwner)
     45        *surfaceOwner = 0;
    4446    QAbstractScrollArea* scrollArea = qobject_cast<QAbstractScrollArea*>(widget);
    4547    if (!scrollArea)
     
    5355        // Geometry can be set to zero because m_glWidget is used only for its QGLContext.
    5456        glWidget->setGeometry(0, 0, 0, 0);
     57        if (surfaceOwner)
     58            *surfaceOwner = glWidget;
    5559        *surface = glWidget->windowHandle();
    5660        *context = glWidget->context()->contextHandle();
     
    236240#if USE(3D_GRAPHICS)
    237241void PageClientQWidget::createPlatformGraphicsContext3D(PlatformGraphicsContext3D* context,
    238                                                         PlatformGraphicsSurface3D* surface)
    239 {
    240     createPlatformGraphicsContext3DFromWidget(view, context, surface);
     242                                                        PlatformGraphicsSurface3D* surface,
     243                                                        QObject** surfaceOwner)
     244{
     245    createPlatformGraphicsContext3DFromWidget(view, context, surface, surfaceOwner);
    241246}
    242247#endif
     
    425430#if USE(3D_GRAPHICS)
    426431void PageClientQGraphicsWidget::createPlatformGraphicsContext3D(PlatformGraphicsContext3D* context,
    427                                                                 PlatformGraphicsSurface3D* surface)
    428 {
    429     createPlatformGraphicsContext3DFromWidget(ownerWidget(), context, surface);
     432                                                                PlatformGraphicsSurface3D* surface,
     433                                                                QObject** surfaceOwner)
     434{
     435    createPlatformGraphicsContext3DFromWidget(ownerWidget(), context, surface, surfaceOwner);
    430436}
    431437#endif
  • trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.h

    r122175 r128315  
    102102#if USE(3D_GRAPHICS)
    103103    virtual void createPlatformGraphicsContext3D(PlatformGraphicsContext3D*,
    104                                                  PlatformGraphicsSurface3D*);
     104                                                 PlatformGraphicsSurface3D*,
     105                                                 QObject**);
    105106#endif
    106107
     
    210211#if USE(3D_GRAPHICS)
    211212    virtual void createPlatformGraphicsContext3D(PlatformGraphicsContext3D*,
    212                                                  PlatformGraphicsSurface3D*);
     213                                                 PlatformGraphicsSurface3D*,
     214                                                 QObject**);
    213215#endif
    214216
Note: See TracChangeset for help on using the changeset viewer.