diff --git a/toonz/sources/common/tvrender/qtofflinegl.cpp b/toonz/sources/common/tvrender/qtofflinegl.cpp index 0793b00..4c8eca5 100644 --- a/toonz/sources/common/tvrender/qtofflinegl.cpp +++ b/toonz/sources/common/tvrender/qtofflinegl.cpp @@ -78,10 +78,12 @@ void rightRotateBits(UCHAR *buf, int bufferSize) //----------------------------------------------------------------------------- -QtOfflineGL::QtOfflineGL(TDimension rasterSize, const TOfflineGL::Imp *shared) - : TOfflineGL::Imp(rasterSize.lx, rasterSize.ly), m_context(0), m_oldContext(0) +QtOfflineGL::QtOfflineGL(TDimension rasterSize, std::shared_ptr shared) + : TOfflineGL::Imp(rasterSize.lx, rasterSize.ly) + , m_context(0) + , m_oldContext(0) { - createContext(rasterSize, shared); + createContext(rasterSize, std::move(shared)); /* makeCurrent(); @@ -101,7 +103,7 @@ QtOfflineGL::~QtOfflineGL() //----------------------------------------------------------------------------- -void QtOfflineGL::createContext(TDimension rasterSize, const TOfflineGL::Imp *shared) +void QtOfflineGL::createContext(TDimension rasterSize, std::shared_ptr shared) { // Imposto il formato dei Pixel (pixelFormat) /* diff --git a/toonz/sources/common/tvrender/tofflinegl.cpp b/toonz/sources/common/tvrender/tofflinegl.cpp index 6ed5cd5..bccfb70 100644 --- a/toonz/sources/common/tvrender/tofflinegl.cpp +++ b/toonz/sources/common/tvrender/tofflinegl.cpp @@ -87,7 +87,7 @@ public: : TOfflineGL::Imp(rasterSize.lx, rasterSize.ly) { m_offData = 0; - createContext(rasterSize, shared); //makeCurrent is called at the end of this + createContext(rasterSize, std::move(shared)); //makeCurrent is called at the end of this glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); diff --git a/toonz/sources/include/qtofflinegl.h b/toonz/sources/include/qtofflinegl.h index 5fd8316..f0e6022 100644 --- a/toonz/sources/include/qtofflinegl.h +++ b/toonz/sources/include/qtofflinegl.h @@ -1,8 +1,8 @@ - - #ifndef QTOFFLINEGL_H #define QTOFFLINEGL_H +#include + #include #include #include @@ -17,10 +17,10 @@ public: QOpenGLContext *m_oldContext; QOffscreenSurface *m_surface; - QtOfflineGL(TDimension rasterSize, const TOfflineGL::Imp *shared = 0); + QtOfflineGL(TDimension rasterSize, std::shared_ptr shared); ~QtOfflineGL(); - void createContext(TDimension rasterSize, const TOfflineGL::Imp *shared); + void createContext(TDimension rasterSize, std::shared_ptr shared); void makeCurrent(); void doneCurrent();