Bug 113784

Summary: [Qt] Fail gracefully if an OpenGL context could not be created.
Product: WebKit Reporter: Zeno Albisser <zeno>
Component: New BugsAssignee: Zeno Albisser <zeno>
Status: RESOLVED FIXED    
Severity: Normal CC: andy.shaw, bruno.abinader, dino, hausmann, jturcotte, noam, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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.