OpenToonz - An open-source full-featured 2D animation creation software
C
add doneCurrent in fx and raster code (#636)
tomosu8d9526db1b0b
diff --git a/toonz/sources/common/tvrender/qtofflinegl.cpp b/toonz/sources/common/tvrender/qtofflinegl.cppindex ce83cddd4..fc44d72d6 100644--- a/toonz/sources/common/tvrender/qtofflinegl.cpp+++ b/toonz/sources/common/tvrender/qtofflinegl.cpp@@ -190,14 +190,13 @@ void QtOfflineGL::makeCurrent() {m_context->moveToThread(QThread::currentThread());m_context->makeCurrent(m_surface.get());}- // else- // m_oldContext = 0;}//-----------------------------------------------------------------------------void QtOfflineGL::doneCurrent() {if (m_context) {+ m_context->moveToThread(0);m_context->doneCurrent();}}diff --git a/toonz/sources/stdfx/particlesfx.cpp b/toonz/sources/stdfx/particlesfx.cppindex 99e28812e..b12c6929f 100644--- a/toonz/sources/stdfx/particlesfx.cpp+++ b/toonz/sources/stdfx/particlesfx.cpp@@ -448,6 +448,7 @@ void ParticlesFx::doCompute(TTile &tile, double frame,partLevel[0]->setName("particles");TDimension vecsize(10, 10);TOfflineGL *offlineGlContext = new TOfflineGL(vecsize);+ offlineGlContext->makeCurrent();offlineGlContext->clear(TPixel32(0, 0, 0, 0));TStroke *stroke;@@ -459,7 +460,7 @@ void ParticlesFx::doCompute(TTile &tile, double frame,vectmp->setPalette(plt);vectmp->addStroke(stroke);TVectorRenderData rd(AffI, TRect(vecsize), plt, 0, true, true);- offlineGlContext->makeCurrent();+offlineGlContext->draw(vectmp, rd);partLevel[0]->setFrame(diff --git a/toonz/sources/toonzlib/trasterimageutils.cpp b/toonz/sources/toonzlib/trasterimageutils.cppindex 982c02152..61d4912a4 100644--- a/toonz/sources/toonzlib/trasterimageutils.cpp+++ b/toonz/sources/toonzlib/trasterimageutils.cpp@@ -87,6 +87,7 @@ void rasterizeWholeStroke(TOfflineGL *&gl, TStroke *stroke, TPalette *palette,}glDisable(GL_ALPHA_TEST);glFinish();+ gl->doneCurrent();}//--------------------------------------------------------------------------@@ -142,6 +143,7 @@ TRect rasterizeRegion(TOfflineGL *&gl, TRect rasBounds, TRegion *region,glPopAttrib();glFinish();+ gl->doneCurrent();}return rect;}diff --git a/toonz/sources/toonzqt/icongenerator.cpp b/toonz/sources/toonzqt/icongenerator.cppindex 23e539321..766a05e77 100644--- a/toonz/sources/toonzqt/icongenerator.cpp+++ b/toonz/sources/toonzqt/icongenerator.cpp@@ -584,7 +584,10 @@ TRaster32P SplineIconRenderer::generateRaster(const TStroke *stroke = m_spline->getStroke();assert(stroke);- if (!stroke) return TRaster32P();+ if (!stroke) {+ glContext->doneCurrent();+ return TRaster32P();+ }TRectD sbbox = stroke->getBBox();glColor3d(0, 0, 0);