Skip to content

Commit 6503b6f

Browse files
tomilovArsentiy Milchakov
authored andcommitted
[drape][OpenGL][Qt] Create framebuffer on the thread which will use it. MAPSME-15297
1 parent ad90c1c commit 6503b6f

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

qt/qt_common/qtoglcontext.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ void QtRenderOGLContext::Resize(int w, int h)
8181
QOpenGLFramebufferObject::Depth);
8282
m_frontFrame = std::make_unique<QOpenGLFramebufferObject>(QSize(m_width, m_height),
8383
QOpenGLFramebufferObject::Depth);
84-
m_needRecreateAcquiredFrame = true;
84+
m_acquiredFrame = std::make_unique<QOpenGLFramebufferObject>(QSize(m_width, m_height),
85+
QOpenGLFramebufferObject::Depth);
8586
}
8687

8788
bool QtRenderOGLContext::AcquireFrame()
@@ -95,12 +96,6 @@ bool QtRenderOGLContext::AcquireFrame()
9596
return true;
9697

9798
// Update acquired frame.
98-
if (m_needRecreateAcquiredFrame)
99-
{
100-
m_acquiredFrame = std::make_unique<QOpenGLFramebufferObject>(QSize(m_width, m_height),
101-
QOpenGLFramebufferObject::Depth);
102-
m_needRecreateAcquiredFrame = false;
103-
}
10499
m_acquiredFrameRect = m_frameRect;
105100
std::swap(m_acquiredFrame, m_frontFrame);
106101
m_frameUpdated = false;

qt/qt_common/qtoglcontext.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class QtRenderOGLContext : public dp::OGLContext
4343
std::atomic<bool> m_isContextAvailable;
4444
int m_width = 0;
4545
int m_height = 0;
46-
bool m_needRecreateAcquiredFrame = false;
4746

4847
std::mutex m_frameMutex;
4948
};

0 commit comments

Comments
 (0)