Changeset 147553 in webkit


Ignore:
Timestamp:
Apr 3, 2013, 8:02:37 AM (12 years ago)
Author:
zeno.albisser@digia.com
Message:

[Qt] Fail gracefully if an OpenGL context could not be created.
https://bugs.webkit.org/show_bug.cgi?id=113784

In case we fail to create or adopt a valid platform OpenGL context
we do not want to provide a GraphicsContext3D instance.
Otherwise we would crash as soon as the instance is being used.

Reviewed by Jocelyn Turcotte.

  • platform/graphics/qt/GraphicsContext3DQt.cpp:

(WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
(WebCore::GraphicsContext3D::GraphicsContext3D):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147549 r147553  
     12013-04-03  Zeno Albisser  <zeno@webkit.org>
     2
     3        [Qt] Fail gracefully if an OpenGL context could not be created.
     4        https://bugs.webkit.org/show_bug.cgi?id=113784
     5
     6        In case we fail to create or adopt a valid platform OpenGL context
     7        we do not want to provide a GraphicsContext3D instance.
     8        Otherwise we would crash as soon as the instance is being used.
     9
     10        Reviewed by Jocelyn Turcotte.
     11
     12        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     13        (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
     14        (WebCore::GraphicsContext3D::GraphicsContext3D):
     15
    1162013-04-03  ChangSeok Oh  <changseok.oh@collabora.com>
    217
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r144833 r147553  
    112112    if (renderStyle == GraphicsContext3D::RenderToCurrentGLContext) {
    113113        m_platformContext = QOpenGLContext::currentContext();
    114         m_surface = m_platformContext->surface();
     114        if (m_platformContext)
     115            m_surface = m_platformContext->surface();
    115116        return;
    116117    }
     
    396397    validateAttributes();
    397398
    398     if (!m_private->m_surface) {
    399         LOG_ERROR("GraphicsContext3D: QGLWidget initialization failed.");
     399    if (!m_private->m_surface || !m_private->m_platformContext) {
     400        LOG_ERROR("GraphicsContext3D: GL context creation failed.");
    400401        m_private = nullptr;
    401402        return;
Note: See TracChangeset for help on using the changeset viewer.