diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-08-14 10:58:36 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-08-14 13:29:23 +0000 |
commit | d3395bf51cc2c90e29908f96aba47ee15c291f9f (patch) | |
tree | d5b37a3cca520428a2cd921de2da76bf961c18ae /src/render/renderers/opengl | |
parent | aaa28f680235c10804081a2467239bb22dea0f03 (diff) |
Avoid initializing GraphicsContext on every frame
m_initialized is inherited from GraphicsContext, having another
m_initialized in SubmissionContext is wrong.
Change-Id: I431ba67c671b8854fafce769c8bfd90ba71e7441
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/renderers/opengl')
-rw-r--r-- | src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp | 4 | ||||
-rw-r--r-- | src/render/renderers/opengl/graphicshelpers/submissioncontext_p.h | 1 |
2 files changed, 1 insertions, 4 deletions
diff --git a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp index 6e1cd5d47..7bb0713ee 100644 --- a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp +++ b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp @@ -378,7 +378,6 @@ unsigned int nextFreeContextId() SubmissionContext::SubmissionContext() : GraphicsContext() - , m_initialized(false) , m_ownCurrent(true) , m_id(nextFreeContextId()) , m_surface(nullptr) @@ -473,9 +472,8 @@ bool SubmissionContext::beginDrawing(QSurface *surface) } #endif - if (!m_initialized) { + if (!isInitialized()) initialize(); - } // need to reset these values every frame, may get overwritten elsewhere m_gl->functions()->glClearColor(m_currClearColorValue.redF(), m_currClearColorValue.greenF(), m_currClearColorValue.blueF(), m_currClearColorValue.alphaF()); diff --git a/src/render/renderers/opengl/graphicshelpers/submissioncontext_p.h b/src/render/renderers/opengl/graphicshelpers/submissioncontext_p.h index 2881812e5..d502a8b27 100644 --- a/src/render/renderers/opengl/graphicshelpers/submissioncontext_p.h +++ b/src/render/renderers/opengl/graphicshelpers/submissioncontext_p.h @@ -185,7 +185,6 @@ private: QByteArray downloadDataFromGLBuffer(Buffer *buffer, GLBuffer *b); bool bindGLBuffer(GLBuffer *buffer, GLBuffer::Type type); - bool m_initialized; bool m_ownCurrent; const unsigned int m_id; QSurface *m_surface; |