mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 07:13:57 +02:00
commit
3240c1dbfe
5 changed files with 11 additions and 10 deletions
|
@ -45,7 +45,7 @@
|
|||
#include <QtNetwork/QNetworkDiskCache>
|
||||
|
||||
#include <gl/Config.h>
|
||||
#include <QtGui/QOpenGLContext>
|
||||
#include <QOpenGLContextWrapper.h>
|
||||
|
||||
#include <AccountManager.h>
|
||||
#include <AddressManager.h>
|
||||
|
@ -1397,13 +1397,13 @@ void Application::paintGL() {
|
|||
_lockedFramebufferMap[finalTexture] = scratchFramebuffer;
|
||||
|
||||
uint64_t displayStart = usecTimestampNow();
|
||||
Q_ASSERT(QOpenGLContext::currentContext() == _offscreenContext->getContext());
|
||||
Q_ASSERT(isCurrentContext(_offscreenContext->getContext()));
|
||||
{
|
||||
PROFILE_RANGE(__FUNCTION__ "/pluginSubmitScene");
|
||||
PerformanceTimer perfTimer("pluginSubmitScene");
|
||||
displayPlugin->submitSceneTexture(_frameCount, finalTexture, toGlm(size));
|
||||
}
|
||||
Q_ASSERT(QOpenGLContext::currentContext() == _offscreenContext->getContext());
|
||||
Q_ASSERT(isCurrentContext(_offscreenContext->getContext()));
|
||||
|
||||
uint64_t displayEnd = usecTimestampNow();
|
||||
const float displayPeriodUsec = (float)(displayEnd - displayStart); // usecs
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <QtCore/QTimer>
|
||||
|
||||
#include <QtOpenGL/QGLWidget>
|
||||
#include <QtGui/QOpenGLContext>
|
||||
#include <QtGui/QImage>
|
||||
|
||||
#include <gl/GLWidget.h>
|
||||
|
@ -46,7 +45,6 @@ public:
|
|||
// Extra code because of the widget 'wrapper' context
|
||||
_context = context;
|
||||
_context->moveToThread(this);
|
||||
_context->contextHandle()->moveToThread(this);
|
||||
}
|
||||
|
||||
virtual void run() override {
|
||||
|
@ -57,7 +55,6 @@ public:
|
|||
Lock lock(_mutex);
|
||||
// Move the context to the main thread
|
||||
_context->moveToThread(qApp->thread());
|
||||
_context->contextHandle()->moveToThread(qApp->thread());
|
||||
_pendingMainThreadOperation = false;
|
||||
// Release the main thread to do it's action
|
||||
_condition.notify_one();
|
||||
|
@ -104,7 +101,6 @@ public:
|
|||
|
||||
_context->doneCurrent();
|
||||
_context->moveToThread(qApp->thread());
|
||||
_context->contextHandle()->moveToThread(qApp->thread());
|
||||
}
|
||||
|
||||
void withMainThreadContext(std::function<void()> f) {
|
||||
|
@ -120,7 +116,6 @@ public:
|
|||
|
||||
// Move the context back to the presentation thread
|
||||
_context->moveToThread(this);
|
||||
_context->contextHandle()->moveToThread(this);
|
||||
|
||||
// restore control of the context to the presentation thread and signal
|
||||
// the end of the operation
|
||||
|
|
|
@ -68,8 +68,8 @@ public:
|
|||
virtual bool contains(const glm::vec3& point) const override;
|
||||
|
||||
// these are in the frame of this object
|
||||
virtual glm::quat getJointRotation(int index) const;
|
||||
virtual glm::vec3 getJointTranslation(int index) const;
|
||||
virtual glm::quat getJointRotation(int index) const override;
|
||||
virtual glm::vec3 getJointTranslation(int index) const override;
|
||||
|
||||
private:
|
||||
void remapTextures();
|
||||
|
|
|
@ -37,4 +37,8 @@ bool QOpenGLContextWrapper::makeCurrent(QSurface* surface) {
|
|||
|
||||
void QOpenGLContextWrapper::doneCurrent() {
|
||||
_context->doneCurrent();
|
||||
}
|
||||
|
||||
bool isCurrentContext(QOpenGLContext* context) {
|
||||
return QOpenGLContext::currentContext() == context;
|
||||
}
|
|
@ -30,4 +30,6 @@ private:
|
|||
QOpenGLContext* _context { nullptr };
|
||||
};
|
||||
|
||||
bool isCurrentContext(QOpenGLContext* context);
|
||||
|
||||
#endif // hifi_QOpenGLContextWrapper_h
|
Loading…
Reference in a new issue