replace backend class names.

SwRaster to SwEngine
GlRaster to GlEngine

Change-Id: I3cf70e168b78c64754807a62c221e13c11b95c35
This commit is contained in:
Hermet Park 2020-04-18 12:43:30 +09:00
parent 2a39617527
commit de242b018b
9 changed files with 50 additions and 50 deletions

View file

@ -1,6 +1,6 @@
source_file = [
'tvgGlRaster.h',
'tvgGlRaster.cpp',
'tvgGlEngine.h',
'tvgGlEngine.cpp',
]
glraster_dep = declare_dependency(

View file

@ -14,14 +14,14 @@
* limitations under the License.
*
*/
#ifndef _TVG_GL_RASTER_CPP_
#define _TVG_GL_RASTER_CPP_
#ifndef _TVG_GL_ENGINE_CPP_
#define _TVG_GL_ENGINE_CPP_
#include "tvgCommon.h"
#include "tvgGlRaster.h"
#include "tvgGlEngine.h"
static GlRaster* pInst = nullptr;
static GlEngine* pInst = nullptr;
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
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;
pInst = new GlRaster();
pInst = new GlEngine();
assert(pInst);
return 0;
}
int GlRaster::term()
int GlEngine::term()
{
if (!pInst) return -1;
cout << "GlRaster(" << pInst << ") destroyed!" << endl;
cout << "GlEngine(" << pInst << ") destroyed!" << endl;
delete(pInst);
pInst = nullptr;
return 0;
}
GlRaster* GlRaster::inst()
GlEngine* GlEngine::inst()
{
assert(pInst);
return pInst;
}
#endif /* _TVG_GL_RASTER_CPP_ */
#endif /* _TVG_GL_ENGINE_CPP_ */

View file

@ -14,25 +14,25 @@
* limitations under the License.
*
*/
#ifndef _TVG_GL_RASTER_H_
#define _TVG_GL_RASTER_H_
#ifndef _TVG_GL_ENGINE_H_
#define _TVG_GL_ENGINE_H_
namespace tvg
{
class GlRaster : public RasterMethod
class GlEngine : public RasterMethod
{
public:
void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override;
static GlRaster* inst();
static GlEngine* inst();
static int init();
static int term();
private:
GlRaster(){};
~GlRaster(){};
GlEngine(){};
~GlEngine(){};
};
}
#endif /* _TVG_GL_RASTER_H_ */
#endif /* _TVG_GL_ENGINE_H_ */

View file

@ -1,7 +1,7 @@
source_file = [
'tvgSwCommon.h',
'tvgSwRaster.h',
'tvgSwRaster.cpp',
'tvgSwEngine.h',
'tvgSwEngine.cpp',
'tvgSwShape.cpp',
'tvgSwRle.cpp',
]

View file

@ -14,24 +14,24 @@
* limitations under the License.
*
*/
#ifndef _TVG_SW_RASTER_CPP_
#define _TVG_SW_RASTER_CPP_
#ifndef _TVG_SW_ENGINE_CPP_
#define _TVG_SW_ENGINE_CPP_
#include "tvgSwCommon.h"
#include "tvgSwRaster.h"
#include "tvgSwEngine.h"
/************************************************************************/
/* Internal Class Implementation */
/************************************************************************/
static SwRaster* pInst = nullptr;
static SwEngine* pInst = nullptr;
/************************************************************************/
/* 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
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;
pInst = new SwRaster();
pInst = new SwEngine();
assert(pInst);
return 0;
}
int SwRaster::term()
int SwEngine::term()
{
if (!pInst) return -1;
cout << "SwRaster(" << pInst << ") destroyed!" << endl;
cout << "SwEngine(" << pInst << ") destroyed!" << endl;
delete(pInst);
pInst = nullptr;
return 0;
}
SwRaster* SwRaster::inst()
SwEngine* SwEngine::inst()
{
assert(pInst);
return pInst;
}
#endif /* _TVG_SW_RASTER_CPP_ */
#endif /* _TVG_SW_ENGINE_CPP_ */

View file

@ -14,20 +14,20 @@
* limitations under the License.
*
*/
#ifndef _TVG_SW_RASTER_H_
#define _TVG_SW_RASTER_H_
#ifndef _TVG_SW_ENGINE_H_
#define _TVG_SW_ENGINE_H_
class SwRaster : public RasterMethod
class SwEngine : public RasterMethod
{
public:
void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override;
static SwRaster* inst();
static SwEngine* inst();
static int init();
static int term();
private:
SwRaster(){};
~SwRaster(){};
SwEngine(){};
~SwEngine(){};
};
#endif /* _TVG_SW_RASTER_H_ */
#endif /* _TVG_SW_ENGINE_H_ */

View file

@ -18,8 +18,8 @@
#define _TVG_ENGINE_CPP_
#include "tvgCommon.h"
#include "tvgSwRaster.h"
#include "tvgGlRaster.h"
#include "tvgSwEngine.h"
#include "tvgGlEngine.h"
/************************************************************************/
/* Internal Class Implementation */
@ -35,8 +35,8 @@ int Engine::init() noexcept
//TODO: Initialize Raster engines by configuration.
int ret = 0;
ret |= SwRaster::init();
ret |= GlRaster::init();
ret |= SwEngine::init();
ret |= GlEngine::init();
return ret;
}
@ -45,8 +45,8 @@ int Engine::init() noexcept
int Engine::term() noexcept
{
int ret = 0;
ret |= SwRaster::term();
ret |= GlRaster::term();
ret |= SwEngine::term();
ret |= GlEngine::term();
return ret;
}

View file

@ -19,7 +19,7 @@
#include "tvgCommon.h"
#include "tvgCanvasBase.h"
#include "tvgGlRaster.h"
#include "tvgGlEngine.h"
/************************************************************************/
/* Internal Class Implementation */
@ -27,7 +27,7 @@
struct GlCanvas::Impl : CanvasBase
{
Impl() : CanvasBase(GlRaster::inst()) {}
Impl() : CanvasBase(GlEngine::inst()) {}
};

View file

@ -19,7 +19,7 @@
#include "tvgCommon.h"
#include "tvgCanvasBase.h"
#include "tvgSwRaster.h"
#include "tvgSwEngine.h"
/************************************************************************/
@ -32,7 +32,7 @@ struct SwCanvas::Impl : CanvasBase
int stride = 0;
int height = 0;
Impl() : CanvasBase(SwRaster::inst()) {}
Impl() : CanvasBase(SwEngine::inst()) {}
};