From 0f12b3ee16dbdcc32d191451e1c755096d091353 Mon Sep 17 00:00:00 2001 From: Shinya Kitaoka Date: Jul 21 2016 01:34:09 +0000 Subject: use new context (#659) --- diff --git a/toonz/sources/toonzlib/imagebuilders.cpp b/toonz/sources/toonzlib/imagebuilders.cpp index 5f5ad70..eeaa1f7 100644 --- a/toonz/sources/toonzlib/imagebuilders.cpp +++ b/toonz/sources/toonzlib/imagebuilders.cpp @@ -275,6 +275,14 @@ TImageP ImageRasterizer::build(int imFlags, void *extData) { QSurfaceFormat format; format.setProfile(QSurfaceFormat::CompatibilityProfile); + std::unique_ptr surface(new QOffscreenSurface()); + surface->setFormat(format); + surface->create(); + + std::unique_ptr context(new QOpenGLContext()); + context->create(); + context->makeCurrent(surface.get()); + TRaster32P ras(d); glPushAttrib(GL_ALL_ATTRIB_BITS); @@ -326,6 +334,7 @@ TImageP ImageRasterizer::build(int imFlags, void *extData) { glPopAttrib(); + context->doneCurrent(); tglMakeCurrent(oldContext); TRasterImageP ri = TRasterImageP(ras);