mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
replace backend class names.
SwRaster to SwEngine GlRaster to GlEngine Change-Id: I3cf70e168b78c64754807a62c221e13c11b95c35
This commit is contained in:
parent
2a39617527
commit
de242b018b
9 changed files with 50 additions and 50 deletions
|
@ -1,6 +1,6 @@
|
||||||
source_file = [
|
source_file = [
|
||||||
'tvgGlRaster.h',
|
'tvgGlEngine.h',
|
||||||
'tvgGlRaster.cpp',
|
'tvgGlEngine.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
glraster_dep = declare_dependency(
|
glraster_dep = declare_dependency(
|
||||||
|
|
|
@ -14,14 +14,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _TVG_GL_RASTER_CPP_
|
#ifndef _TVG_GL_ENGINE_CPP_
|
||||||
#define _TVG_GL_RASTER_CPP_
|
#define _TVG_GL_ENGINE_CPP_
|
||||||
|
|
||||||
#include "tvgCommon.h"
|
#include "tvgCommon.h"
|
||||||
#include "tvgGlRaster.h"
|
#include "tvgGlEngine.h"
|
||||||
|
|
||||||
|
|
||||||
static GlRaster* pInst = nullptr;
|
static GlEngine* pInst = nullptr;
|
||||||
|
|
||||||
struct GlShape
|
struct GlShape
|
||||||
{
|
{
|
||||||
|
@ -29,7 +29,7 @@ struct GlShape
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void* GlRaster::prepare(const ShapeNode& shape, void* data, UpdateFlag flags)
|
void* GlEngine::prepare(const ShapeNode& shape, void* data, UpdateFlag flags)
|
||||||
{
|
{
|
||||||
//prepare shape data
|
//prepare shape data
|
||||||
GlShape* sdata = static_cast<GlShape*>(data);
|
GlShape* sdata = static_cast<GlShape*>(data);
|
||||||
|
@ -42,31 +42,31 @@ void* GlRaster::prepare(const ShapeNode& shape, void* data, UpdateFlag flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GlRaster::init()
|
int GlEngine::init()
|
||||||
{
|
{
|
||||||
if (pInst) return -1;
|
if (pInst) return -1;
|
||||||
pInst = new GlRaster();
|
pInst = new GlEngine();
|
||||||
assert(pInst);
|
assert(pInst);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GlRaster::term()
|
int GlEngine::term()
|
||||||
{
|
{
|
||||||
if (!pInst) return -1;
|
if (!pInst) return -1;
|
||||||
cout << "GlRaster(" << pInst << ") destroyed!" << endl;
|
cout << "GlEngine(" << pInst << ") destroyed!" << endl;
|
||||||
delete(pInst);
|
delete(pInst);
|
||||||
pInst = nullptr;
|
pInst = nullptr;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GlRaster* GlRaster::inst()
|
GlEngine* GlEngine::inst()
|
||||||
{
|
{
|
||||||
assert(pInst);
|
assert(pInst);
|
||||||
return pInst;
|
return pInst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* _TVG_GL_RASTER_CPP_ */
|
#endif /* _TVG_GL_ENGINE_CPP_ */
|
|
@ -14,25 +14,25 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _TVG_GL_RASTER_H_
|
#ifndef _TVG_GL_ENGINE_H_
|
||||||
#define _TVG_GL_RASTER_H_
|
#define _TVG_GL_ENGINE_H_
|
||||||
|
|
||||||
namespace tvg
|
namespace tvg
|
||||||
{
|
{
|
||||||
|
|
||||||
class GlRaster : public RasterMethod
|
class GlEngine : public RasterMethod
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override;
|
void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override;
|
||||||
static GlRaster* inst();
|
static GlEngine* inst();
|
||||||
static int init();
|
static int init();
|
||||||
static int term();
|
static int term();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GlRaster(){};
|
GlEngine(){};
|
||||||
~GlRaster(){};
|
~GlEngine(){};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _TVG_GL_RASTER_H_ */
|
#endif /* _TVG_GL_ENGINE_H_ */
|
|
@ -1,7 +1,7 @@
|
||||||
source_file = [
|
source_file = [
|
||||||
'tvgSwCommon.h',
|
'tvgSwCommon.h',
|
||||||
'tvgSwRaster.h',
|
'tvgSwEngine.h',
|
||||||
'tvgSwRaster.cpp',
|
'tvgSwEngine.cpp',
|
||||||
'tvgSwShape.cpp',
|
'tvgSwShape.cpp',
|
||||||
'tvgSwRle.cpp',
|
'tvgSwRle.cpp',
|
||||||
]
|
]
|
||||||
|
|
|
@ -14,24 +14,24 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _TVG_SW_RASTER_CPP_
|
#ifndef _TVG_SW_ENGINE_CPP_
|
||||||
#define _TVG_SW_RASTER_CPP_
|
#define _TVG_SW_ENGINE_CPP_
|
||||||
|
|
||||||
#include "tvgSwCommon.h"
|
#include "tvgSwCommon.h"
|
||||||
#include "tvgSwRaster.h"
|
#include "tvgSwEngine.h"
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* Internal Class Implementation */
|
/* Internal Class Implementation */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
static SwRaster* pInst = nullptr;
|
static SwEngine* pInst = nullptr;
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* External Class Implementation */
|
/* External Class Implementation */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
void* SwRaster::prepare(const ShapeNode& shape, void* data, UpdateFlag flags)
|
void* SwEngine::prepare(const ShapeNode& shape, void* data, UpdateFlag flags)
|
||||||
{
|
{
|
||||||
//prepare shape data
|
//prepare shape data
|
||||||
SwShape* sdata = static_cast<SwShape*>(data);
|
SwShape* sdata = static_cast<SwShape*>(data);
|
||||||
|
@ -59,31 +59,31 @@ void* SwRaster::prepare(const ShapeNode& shape, void* data, UpdateFlag flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SwRaster::init()
|
int SwEngine::init()
|
||||||
{
|
{
|
||||||
if (pInst) return -1;
|
if (pInst) return -1;
|
||||||
pInst = new SwRaster();
|
pInst = new SwEngine();
|
||||||
assert(pInst);
|
assert(pInst);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SwRaster::term()
|
int SwEngine::term()
|
||||||
{
|
{
|
||||||
if (!pInst) return -1;
|
if (!pInst) return -1;
|
||||||
cout << "SwRaster(" << pInst << ") destroyed!" << endl;
|
cout << "SwEngine(" << pInst << ") destroyed!" << endl;
|
||||||
delete(pInst);
|
delete(pInst);
|
||||||
pInst = nullptr;
|
pInst = nullptr;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SwRaster* SwRaster::inst()
|
SwEngine* SwEngine::inst()
|
||||||
{
|
{
|
||||||
assert(pInst);
|
assert(pInst);
|
||||||
return pInst;
|
return pInst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* _TVG_SW_RASTER_CPP_ */
|
#endif /* _TVG_SW_ENGINE_CPP_ */
|
|
@ -14,20 +14,20 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _TVG_SW_RASTER_H_
|
#ifndef _TVG_SW_ENGINE_H_
|
||||||
#define _TVG_SW_RASTER_H_
|
#define _TVG_SW_ENGINE_H_
|
||||||
|
|
||||||
class SwRaster : public RasterMethod
|
class SwEngine : public RasterMethod
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override;
|
void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override;
|
||||||
static SwRaster* inst();
|
static SwEngine* inst();
|
||||||
static int init();
|
static int init();
|
||||||
static int term();
|
static int term();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SwRaster(){};
|
SwEngine(){};
|
||||||
~SwRaster(){};
|
~SwEngine(){};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _TVG_SW_RASTER_H_ */
|
#endif /* _TVG_SW_ENGINE_H_ */
|
|
@ -18,8 +18,8 @@
|
||||||
#define _TVG_ENGINE_CPP_
|
#define _TVG_ENGINE_CPP_
|
||||||
|
|
||||||
#include "tvgCommon.h"
|
#include "tvgCommon.h"
|
||||||
#include "tvgSwRaster.h"
|
#include "tvgSwEngine.h"
|
||||||
#include "tvgGlRaster.h"
|
#include "tvgGlEngine.h"
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* Internal Class Implementation */
|
/* Internal Class Implementation */
|
||||||
|
@ -35,8 +35,8 @@ int Engine::init() noexcept
|
||||||
//TODO: Initialize Raster engines by configuration.
|
//TODO: Initialize Raster engines by configuration.
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
ret |= SwRaster::init();
|
ret |= SwEngine::init();
|
||||||
ret |= GlRaster::init();
|
ret |= GlEngine::init();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,8 @@ int Engine::init() noexcept
|
||||||
int Engine::term() noexcept
|
int Engine::term() noexcept
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
ret |= SwRaster::term();
|
ret |= SwEngine::term();
|
||||||
ret |= GlRaster::term();
|
ret |= GlEngine::term();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "tvgCommon.h"
|
#include "tvgCommon.h"
|
||||||
#include "tvgCanvasBase.h"
|
#include "tvgCanvasBase.h"
|
||||||
#include "tvgGlRaster.h"
|
#include "tvgGlEngine.h"
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* Internal Class Implementation */
|
/* Internal Class Implementation */
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
struct GlCanvas::Impl : CanvasBase
|
struct GlCanvas::Impl : CanvasBase
|
||||||
{
|
{
|
||||||
Impl() : CanvasBase(GlRaster::inst()) {}
|
Impl() : CanvasBase(GlEngine::inst()) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "tvgCommon.h"
|
#include "tvgCommon.h"
|
||||||
#include "tvgCanvasBase.h"
|
#include "tvgCanvasBase.h"
|
||||||
#include "tvgSwRaster.h"
|
#include "tvgSwEngine.h"
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
@ -32,7 +32,7 @@ struct SwCanvas::Impl : CanvasBase
|
||||||
int stride = 0;
|
int stride = 0;
|
||||||
int height = 0;
|
int height = 0;
|
||||||
|
|
||||||
Impl() : CanvasBase(SwRaster::inst()) {}
|
Impl() : CanvasBase(SwEngine::inst()) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue