Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix TOfflineGL::Imp

Shinya Kitaokac3fda32ba4e8
diff --git a/toonz/sources/common/tvrender/qtofflinegl.cpp b/toonz/sources/common/tvrender/qtofflinegl.cpp
index 0793b00b1..4c8eca57b 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<TOfflineGL::Imp> 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<TOfflineGL::Imp> shared)
{
// Imposto il formato dei Pixel (pixelFormat)
/*
diff --git a/toonz/sources/common/tvrender/tofflinegl.cpp b/toonz/sources/common/tvrender/tofflinegl.cpp
index 6ed5cd56f..bccfb7013 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 5fd8316f9..f0e6022cc 100644
--- a/toonz/sources/include/qtofflinegl.h
+++ b/toonz/sources/include/qtofflinegl.h
@@ -1,8 +1,8 @@
-
-
#ifndef QTOFFLINEGL_H
#define QTOFFLINEGL_H
+#include <memory>
+
#include <QtOpenGL>
#include <QGLFormat>
#include <QGLContext>
@@ -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<TOfflineGL::Imp> shared);
~QtOfflineGL();
- void createContext(TDimension rasterSize, const TOfflineGL::Imp *shared);
+ void createContext(TDimension rasterSize, std::shared_ptr<TOfflineGL::Imp> shared);
void makeCurrent();
void doneCurrent();