[Webkit-unassigned] [Bug 96490] [Qt4] QOpenGLContext used in GraphicsContext3DQt.cpp (regression r126635)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 12 07:43:38 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=96490





--- Comment #3 from Simon Hausmann <hausmann at webkit.org>  2012-09-12 07:44:03 PST ---
(In reply to comment #2)
> (In reply to comment #0)
> > The patch for bug #78672 introduced the GraphicsContext3D::RenderToCurrentGLContext render-style, but added Qt5 specific code to handle it. It should be too difficult to express that in Qt4.8 terms, but I will leave it to someone who knows what they are doing.
> 
> Make that should not be too difficult. The code in question is this:
>     if (renderStyle == GraphicsContext3D::RenderToCurrentGLContext) {
>         m_platformContext = QOpenGLContext::currentContext();
>         m_surface = m_platformContext->surface();
>         return;
>     }
> 
> I was thinking it could be solved for Qt4 as
>         m_platformContext = const_cast<QGLContext*>(QGLContext::currentContext());
>         m_surface = dynamic_cast<QGLWidget*>(m_platformContext->device());
> 
> But without knowing the details, I would rather not do const casts and rely on assumptions of what type m_platformContext->device() is.

I'd go for that dynamic_cast. You can ASSERT() if you want to be on the safer side, but I think chances are extremely small.

Another option would be to leave it as a QPaintDevice* altogether. For deletion you're going to get a QObject* m_surfaceOwner from trunk soon (but even then QPaintDevice's virtual destructor should do the trick). And otherwise I think m_surface is only used for the *IfNeeded() part of makeCurrentIfNeeded().

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list