Exit cleanly in debug with GL logger

This commit is contained in:
Zach Pomerantz 2016-04-11 16:32:32 -07:00
parent 666bf8d42b
commit c72a5f3605
2 changed files with 5 additions and 2 deletions

View file

@ -36,7 +36,7 @@ using namespace gpu;
GLTextureTransferHelper::GLTextureTransferHelper() {
#ifdef THREADED_TEXTURE_TRANSFER
_canvas = std::make_shared<OffscreenGLCanvas>();
_canvas = QSharedPointer<OffscreenGLCanvas>(new OffscreenGLCanvas(), &QObject::deleteLater);
_canvas->create(QOpenGLContextWrapper::currentContext());
if (!_canvas->makeCurrent()) {
qFatal("Unable to create texture transfer context");
@ -89,9 +89,11 @@ void GLTextureTransferHelper::setup() {
}
void GLTextureTransferHelper::shutdown() {
#ifdef THREADED_TEXTURE_TRANSFER
_canvas->doneCurrent();
_canvas->moveToThreadWithContext(qApp->thread());
_canvas.reset();
#endif
}

View file

@ -6,6 +6,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <QSharedPointer>
#include <GenericQueueThread.h>
#include "GLBackendShared.h"
@ -34,7 +35,7 @@ protected:
void transferTextureSynchronous(const gpu::Texture& texture);
private:
std::shared_ptr<OffscreenGLCanvas> _canvas;
QSharedPointer<OffscreenGLCanvas> _canvas;
};
template <typename F>