mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-19 05:49:15 +02:00
Lock the QML Surface resizing better
This commit is contained in:
parent
b41c106f3c
commit
fe1d8b24b4
1 changed files with 23 additions and 23 deletions
|
@ -241,6 +241,7 @@ void OffscreenQmlRenderThread::cleanup() {
|
||||||
|
|
||||||
void OffscreenQmlRenderThread::resize() {
|
void OffscreenQmlRenderThread::resize() {
|
||||||
// Lock _newSize changes
|
// Lock _newSize changes
|
||||||
|
{
|
||||||
QMutexLocker locker(&_mutex);
|
QMutexLocker locker(&_mutex);
|
||||||
|
|
||||||
// Update our members
|
// Update our members
|
||||||
|
@ -257,16 +258,15 @@ void OffscreenQmlRenderThread::resize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
uvec2 newOffscreenSize = toGlm(_newSize * pixelRatio);
|
uvec2 newOffscreenSize = toGlm(_newSize * pixelRatio);
|
||||||
_textures.setSize(newOffscreenSize);
|
|
||||||
if (newOffscreenSize == _size) {
|
if (newOffscreenSize == _size) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_size = newOffscreenSize;
|
|
||||||
|
|
||||||
qDebug() << "Offscreen UI resizing to " << _newSize.width() << "x" << _newSize.height() << " with pixel ratio " << pixelRatio;
|
qDebug() << "Offscreen UI resizing to " << _newSize.width() << "x" << _newSize.height() << " with pixel ratio " << pixelRatio;
|
||||||
|
_size = newOffscreenSize;
|
||||||
|
}
|
||||||
|
|
||||||
locker.unlock();
|
_textures.setSize(_size);
|
||||||
|
|
||||||
setupFbo();
|
setupFbo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue