Bug 113784 - [Qt] Fail gracefully if an OpenGL context could not be created.
Summary: [Qt] Fail gracefully if an OpenGL context could not be created.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zeno Albisser
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-02 08:12 PDT by Zeno Albisser
Modified: 2013-04-03 08:01 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.30 KB, patch)
2013-04-02 08:15 PDT, Zeno Albisser
no flags Details | Formatted Diff | Diff
Patch (2.17 KB, patch)
2013-04-02 12:00 PDT, Zeno Albisser
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zeno Albisser 2013-04-02 08:12:56 PDT
[Qt] Fail gracefully if an OpenGL context could not be created.
Comment 1 Zeno Albisser 2013-04-02 08:15:11 PDT
Created attachment 196143 [details]
Patch
Comment 2 Jocelyn Turcotte 2013-04-02 08:31:06 PDT
Comment on attachment 196143 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=196143&action=review

> Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:373
> -    return context->m_private ? context.release() : 0;
> +    return (context->m_private && context->platformGraphicsContext3D()) ? context.release() : 0;

To avoid spreading the failure logic I think it would be cleaner to add a check in GraphicsContext3D::GraphicsContext3D and set m_private = nullptr if (!m_private->m_platformContext).

Something like changing "if (!m_private->m_surface) {" to "if (!m_private->m_surface || !m_private->m_platformContext) {" at line 398.
Comment 3 Zeno Albisser 2013-04-02 12:00:38 PDT
Created attachment 196205 [details]
Patch
Comment 4 Zeno Albisser 2013-04-02 12:01:24 PDT
(In reply to comment #2)
> To avoid spreading the failure logic I think it would be cleaner to add a check in GraphicsContext3D::GraphicsContext3D and set m_private = nullptr if (!m_private->m_platformContext).

A very good point! Thx a lot! :)
Comment 5 Zeno Albisser 2013-04-03 08:01:03 PDT
Comment on attachment 196205 [details]
Patch

Clearing flags on attachment: 196205

Committed r147553: <http://trac.webkit.org/changeset/147553>
Comment 6 Zeno Albisser 2013-04-03 08:01:08 PDT
All reviewed patches have been landed.  Closing bug.