MCPcopy Create free account
hub / github.com/comaps/comaps / Resize

Method Resize

qt/qt_common/qtoglcontext.cpp:56–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void QtRenderOGLContext::Resize(uint32_t w, uint32_t h)
57{
58 CHECK(m_isContextAvailable, ());
59
60 // This function can't be called inside BeginRendering - EndRendering.
61 std::lock_guard lock(m_frameMutex);
62
63 auto const nw = static_cast<int>(math::NextPowOf2(w));
64 auto const nh = static_cast<int>(math::NextPowOf2(h));
65
66 if (nw <= m_width && nh <= m_height && m_backFrame != nullptr)
67 {
68 m_frameRect = QRectF(0.0, 0.0, w / static_cast<float>(m_width), h / static_cast<float>(m_height));
69 return;
70 }
71
72 m_width = nw;
73 m_height = nh;
74 m_frameRect = QRectF(0.0, 0.0, w / static_cast<float>(m_width), h / static_cast<float>(m_height));
75
76 m_backFrame = std::make_unique<QOpenGLFramebufferObject>(QSize(m_width, m_height), QOpenGLFramebufferObject::Depth);
77 m_frontFrame = std::make_unique<QOpenGLFramebufferObject>(QSize(m_width, m_height), QOpenGLFramebufferObject::Depth);
78 m_acquiredFrame =
79 std::make_unique<QOpenGLFramebufferObject>(QSize(m_width, m_height), QOpenGLFramebufferObject::Depth);
80}
81
82bool QtRenderOGLContext::AcquireFrame()
83{

Callers 2

CreateEngineMethod · 0.45
resizeGLMethod · 0.45

Calls 1

NextPowOf2Function · 0.85

Tested by

no test coverage detected