mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
rename class names.
RasterMethod -> RenderMethod SwEngine -> SwRenderer GlEngine -> GlRenderer Change-Id: Ic2ded698e49c4373fe21fe31fa34baca01bf43a2
This commit is contained in:
parent
c8d800f6c6
commit
9b7337622d
14 changed files with 96 additions and 96 deletions
|
@ -52,7 +52,7 @@ namespace tvg
|
||||||
|
|
||||||
enum class TIZENVG_EXPORT PathCommand { Close, MoveTo, LineTo, CubicTo };
|
enum class TIZENVG_EXPORT PathCommand { Close, MoveTo, LineTo, CubicTo };
|
||||||
|
|
||||||
class RasterMethod;
|
class RenderMethod;
|
||||||
|
|
||||||
struct Point
|
struct Point
|
||||||
{
|
{
|
||||||
|
@ -73,8 +73,8 @@ class TIZENVG_EXPORT PaintNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~PaintNode() {}
|
virtual ~PaintNode() {}
|
||||||
virtual int dispose(RasterMethod* engine) = 0;
|
virtual int dispose(RenderMethod* engine) = 0;
|
||||||
virtual int update(RasterMethod* engine) = 0;
|
virtual int update(RenderMethod* engine) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,8 +91,8 @@ class TIZENVG_EXPORT ShapeNode final : public PaintNode
|
||||||
public:
|
public:
|
||||||
~ShapeNode();
|
~ShapeNode();
|
||||||
|
|
||||||
int dispose(RasterMethod* engine) noexcept override;
|
int dispose(RenderMethod* engine) noexcept override;
|
||||||
int update(RasterMethod* engine) noexcept override;
|
int update(RenderMethod* engine) noexcept override;
|
||||||
int clear() noexcept;
|
int clear() noexcept;
|
||||||
|
|
||||||
int appendRect(float x, float y, float w, float h, float radius) noexcept;
|
int appendRect(float x, float y, float w, float h, float radius) noexcept;
|
||||||
|
@ -123,8 +123,8 @@ class TIZENVG_EXPORT SceneNode final : public PaintNode
|
||||||
public:
|
public:
|
||||||
~SceneNode();
|
~SceneNode();
|
||||||
|
|
||||||
int dispose(RasterMethod* engine) noexcept override;
|
int dispose(RenderMethod* engine) noexcept override;
|
||||||
int update(RasterMethod* engine) noexcept override;
|
int update(RenderMethod* engine) noexcept override;
|
||||||
|
|
||||||
int push(std::unique_ptr<ShapeNode> shape) noexcept;
|
int push(std::unique_ptr<ShapeNode> shape) noexcept;
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ public:
|
||||||
int update() noexcept;
|
int update() noexcept;
|
||||||
int draw(bool async = true) noexcept;
|
int draw(bool async = true) noexcept;
|
||||||
int sync() noexcept;
|
int sync() noexcept;
|
||||||
RasterMethod* engine() noexcept;
|
RenderMethod* engine() noexcept;
|
||||||
|
|
||||||
int target(uint32_t* buffer, size_t stride, size_t height) noexcept;
|
int target(uint32_t* buffer, size_t stride, size_t height) noexcept;
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ public:
|
||||||
int update() noexcept;
|
int update() noexcept;
|
||||||
int draw(bool async = true) noexcept { return 0; }
|
int draw(bool async = true) noexcept { return 0; }
|
||||||
int sync() noexcept { return 0; }
|
int sync() noexcept { return 0; }
|
||||||
RasterMethod* engine() noexcept;
|
RenderMethod* engine() noexcept;
|
||||||
|
|
||||||
static std::unique_ptr<GlCanvas> gen() noexcept;
|
static std::unique_ptr<GlCanvas> gen() noexcept;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
source_file = [
|
source_file = [
|
||||||
'tvgGlEngine.h',
|
'tvgGlRenderer.h',
|
||||||
'tvgGlEngine.cpp',
|
'tvgGlRenderer.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
glraster_dep = declare_dependency(
|
glraster_dep = declare_dependency(
|
||||||
|
|
|
@ -14,17 +14,17 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _TVG_GL_ENGINE_CPP_
|
#ifndef _TVG_GL_RENDERER_CPP_
|
||||||
#define _TVG_GL_ENGINE_CPP_
|
#define _TVG_GL_RENDERER_CPP_
|
||||||
|
|
||||||
#include "tvgCommon.h"
|
#include "tvgCommon.h"
|
||||||
#include "tvgGlEngine.h"
|
#include "tvgGlRenderer.h"
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* Internal Class Implementation */
|
/* Internal Class Implementation */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
static RasterMethodInit engineInit;
|
static RenderMethodInit engineInit;
|
||||||
|
|
||||||
struct GlShape
|
struct GlShape
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,7 @@ struct GlShape
|
||||||
/* External Class Implementation */
|
/* External Class Implementation */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
void* GlEngine::dispose(const ShapeNode& shape, void *data)
|
void* GlRenderer::dispose(const ShapeNode& shape, void *data)
|
||||||
{
|
{
|
||||||
GlShape* sdata = static_cast<GlShape*>(data);
|
GlShape* sdata = static_cast<GlShape*>(data);
|
||||||
if (!sdata) return nullptr;
|
if (!sdata) return nullptr;
|
||||||
|
@ -44,7 +44,7 @@ void* GlEngine::dispose(const ShapeNode& shape, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void* GlEngine::prepare(const ShapeNode& shape, void* data, UpdateFlag flags)
|
void* GlRenderer::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);
|
||||||
|
@ -56,34 +56,34 @@ void* GlEngine::prepare(const ShapeNode& shape, void* data, UpdateFlag flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GlEngine::init()
|
int GlRenderer::init()
|
||||||
{
|
{
|
||||||
return RasterMethodInit::init(engineInit, new GlEngine);
|
return RenderMethodInit::init(engineInit, new GlRenderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GlEngine::term()
|
int GlRenderer::term()
|
||||||
{
|
{
|
||||||
return RasterMethodInit::term(engineInit);
|
return RenderMethodInit::term(engineInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t GlEngine::unref()
|
size_t GlRenderer::unref()
|
||||||
{
|
{
|
||||||
return RasterMethodInit::unref(engineInit);
|
return RenderMethodInit::unref(engineInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t GlEngine::ref()
|
size_t GlRenderer::ref()
|
||||||
{
|
{
|
||||||
return RasterMethodInit::ref(engineInit);
|
return RenderMethodInit::ref(engineInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GlEngine* GlEngine::inst()
|
GlRenderer* GlRenderer::inst()
|
||||||
{
|
{
|
||||||
return dynamic_cast<GlEngine*>(RasterMethodInit::inst(engineInit));
|
return dynamic_cast<GlRenderer*>(RenderMethodInit::inst(engineInit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* _TVG_GL_ENGINE_CPP_ */
|
#endif /* _TVG_GL_RENDERER_CPP_ */
|
|
@ -14,13 +14,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _TVG_GL_ENGINE_H_
|
#ifndef _TVG_GL_RENDERER_H_
|
||||||
#define _TVG_GL_ENGINE_H_
|
#define _TVG_GL_RENDERER_H_
|
||||||
|
|
||||||
namespace tvg
|
namespace tvg
|
||||||
{
|
{
|
||||||
|
|
||||||
class GlEngine : public RasterMethod
|
class GlRenderer : public RenderMethod
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override;
|
void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override;
|
||||||
|
@ -28,15 +28,15 @@ public:
|
||||||
size_t ref() override;
|
size_t ref() override;
|
||||||
size_t unref() override;
|
size_t unref() override;
|
||||||
|
|
||||||
static GlEngine* inst();
|
static GlRenderer* inst();
|
||||||
static int init();
|
static int init();
|
||||||
static int term();
|
static int term();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GlEngine(){};
|
GlRenderer(){};
|
||||||
~GlEngine(){};
|
~GlRenderer(){};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _TVG_GL_ENGINE_H_ */
|
#endif /* _TVG_GL_RENDERER_H_ */
|
|
@ -1,7 +1,7 @@
|
||||||
source_file = [
|
source_file = [
|
||||||
'tvgSwCommon.h',
|
'tvgSwCommon.h',
|
||||||
'tvgSwEngine.h',
|
'tvgSwRenderer.h',
|
||||||
'tvgSwEngine.cpp',
|
'tvgSwRenderer.cpp',
|
||||||
'tvgSwShape.cpp',
|
'tvgSwShape.cpp',
|
||||||
'tvgSwRle.cpp',
|
'tvgSwRle.cpp',
|
||||||
]
|
]
|
||||||
|
|
|
@ -14,24 +14,24 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _TVG_SW_ENGINE_CPP_
|
#ifndef _TVG_SW_RENDERER_CPP_
|
||||||
#define _TVG_SW_ENGINE_CPP_
|
#define _TVG_SW_RENDERER_CPP_
|
||||||
|
|
||||||
#include "tvgSwCommon.h"
|
#include "tvgSwCommon.h"
|
||||||
#include "tvgSwEngine.h"
|
#include "tvgSwRenderer.h"
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* Internal Class Implementation */
|
/* Internal Class Implementation */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
static RasterMethodInit engineInit;
|
static RenderMethodInit engineInit;
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* External Class Implementation */
|
/* External Class Implementation */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
void* SwEngine::dispose(const ShapeNode& shape, void *data)
|
void* SwRenderer::dispose(const ShapeNode& shape, void *data)
|
||||||
{
|
{
|
||||||
SwShape* sdata = static_cast<SwShape*>(data);
|
SwShape* sdata = static_cast<SwShape*>(data);
|
||||||
if (!sdata) return nullptr;
|
if (!sdata) return nullptr;
|
||||||
|
@ -40,7 +40,7 @@ void* SwEngine::dispose(const ShapeNode& shape, void *data)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* SwEngine::prepare(const ShapeNode& shape, void* data, UpdateFlag flags)
|
void* SwRenderer::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);
|
||||||
|
@ -68,34 +68,34 @@ void* SwEngine::prepare(const ShapeNode& shape, void* data, UpdateFlag flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SwEngine::init()
|
int SwRenderer::init()
|
||||||
{
|
{
|
||||||
return RasterMethodInit::init(engineInit, new SwEngine);
|
return RenderMethodInit::init(engineInit, new SwRenderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SwEngine::term()
|
int SwRenderer::term()
|
||||||
{
|
{
|
||||||
return RasterMethodInit::term(engineInit);
|
return RenderMethodInit::term(engineInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t SwEngine::unref()
|
size_t SwRenderer::unref()
|
||||||
{
|
{
|
||||||
return RasterMethodInit::unref(engineInit);
|
return RenderMethodInit::unref(engineInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t SwEngine::ref()
|
size_t SwRenderer::ref()
|
||||||
{
|
{
|
||||||
return RasterMethodInit::ref(engineInit);
|
return RenderMethodInit::ref(engineInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SwEngine* SwEngine::inst()
|
SwRenderer* SwRenderer::inst()
|
||||||
{
|
{
|
||||||
return dynamic_cast<SwEngine*>(RasterMethodInit::inst(engineInit));
|
return dynamic_cast<SwRenderer*>(RenderMethodInit::inst(engineInit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* _TVG_SW_ENGINE_CPP_ */
|
#endif /* _TVG_SW_RENDERER_CPP_ */
|
|
@ -14,10 +14,10 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _TVG_SW_ENGINE_H_
|
#ifndef _TVG_SW_RENDERER_H_
|
||||||
#define _TVG_SW_ENGINE_H_
|
#define _TVG_SW_RENDERER_H_
|
||||||
|
|
||||||
class SwEngine : public RasterMethod
|
class SwRenderer : public RenderMethod
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override;
|
void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override;
|
||||||
|
@ -25,13 +25,13 @@ public:
|
||||||
size_t ref() override;
|
size_t ref() override;
|
||||||
size_t unref() override;
|
size_t unref() override;
|
||||||
|
|
||||||
static SwEngine* inst();
|
static SwRenderer* inst();
|
||||||
static int init();
|
static int init();
|
||||||
static int term();
|
static int term();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SwEngine(){};
|
SwRenderer(){};
|
||||||
~SwEngine(){};
|
~SwRenderer(){};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _TVG_SW_ENGINE_H_ */
|
#endif /* _TVG_SW_RENDERER_H_ */
|
|
@ -26,17 +26,17 @@
|
||||||
struct CanvasBase
|
struct CanvasBase
|
||||||
{
|
{
|
||||||
vector<PaintNode*> nodes;
|
vector<PaintNode*> nodes;
|
||||||
RasterMethod* raster;
|
RenderMethod* renderer;
|
||||||
|
|
||||||
CanvasBase(RasterMethod *pRaster):raster(pRaster)
|
CanvasBase(RenderMethod *pRenderer):renderer(pRenderer)
|
||||||
{
|
{
|
||||||
raster->ref();
|
renderer->ref();
|
||||||
}
|
}
|
||||||
|
|
||||||
~CanvasBase()
|
~CanvasBase()
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
raster->unref();
|
renderer->unref();
|
||||||
}
|
}
|
||||||
|
|
||||||
int reserve(size_t n)
|
int reserve(size_t n)
|
||||||
|
@ -49,7 +49,7 @@ struct CanvasBase
|
||||||
int clear()
|
int clear()
|
||||||
{
|
{
|
||||||
for (auto node : nodes) {
|
for (auto node : nodes) {
|
||||||
node->dispose(raster);
|
node->dispose(renderer);
|
||||||
delete(node);
|
delete(node);
|
||||||
}
|
}
|
||||||
nodes.clear();
|
nodes.clear();
|
||||||
|
@ -67,11 +67,11 @@ struct CanvasBase
|
||||||
if (SceneNode *scene = dynamic_cast<SceneNode *>(node)) {
|
if (SceneNode *scene = dynamic_cast<SceneNode *>(node)) {
|
||||||
|
|
||||||
} else if (ShapeNode *shape = dynamic_cast<ShapeNode *>(node)) {
|
} else if (ShapeNode *shape = dynamic_cast<ShapeNode *>(node)) {
|
||||||
return shape->update(raster);
|
return shape->update(renderer);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (ShapeNode *shape = dynamic_cast<ShapeNode *>(node)) {
|
if (ShapeNode *shape = dynamic_cast<ShapeNode *>(node)) {
|
||||||
return shape->update(raster);
|
return shape->update(renderer);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
cout << "What type of PaintNode? = " << node << endl;
|
cout << "What type of PaintNode? = " << node << endl;
|
||||||
|
|
|
@ -29,24 +29,24 @@ using namespace tvg;
|
||||||
namespace tvg
|
namespace tvg
|
||||||
{
|
{
|
||||||
|
|
||||||
class RasterMethod
|
class RenderMethod
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum UpdateFlag { None = 0, Path = 1, Fill = 2, All = 3 };
|
enum UpdateFlag { None = 0, Path = 1, Fill = 2, All = 3 };
|
||||||
virtual ~RasterMethod() {}
|
virtual ~RenderMethod() {}
|
||||||
virtual void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) = 0;
|
virtual void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) = 0;
|
||||||
virtual void* dispose(const ShapeNode& shape, void *data) = 0;
|
virtual void* dispose(const ShapeNode& shape, void *data) = 0;
|
||||||
virtual size_t ref() = 0;
|
virtual size_t ref() = 0;
|
||||||
virtual size_t unref() = 0;
|
virtual size_t unref() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RasterMethodInit
|
struct RenderMethodInit
|
||||||
{
|
{
|
||||||
RasterMethod* pInst = nullptr;
|
RenderMethod* pInst = nullptr;
|
||||||
size_t refCnt = 0;
|
size_t refCnt = 0;
|
||||||
bool initted = false;
|
bool initted = false;
|
||||||
|
|
||||||
static int init(RasterMethodInit& initter, RasterMethod* engine)
|
static int init(RenderMethodInit& initter, RenderMethod* engine)
|
||||||
{
|
{
|
||||||
assert(engine);
|
assert(engine);
|
||||||
if (initter.pInst || initter.refCnt > 0) return -1;
|
if (initter.pInst || initter.refCnt > 0) return -1;
|
||||||
|
@ -56,7 +56,7 @@ struct RasterMethodInit
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int term(RasterMethodInit& initter)
|
static int term(RenderMethodInit& initter)
|
||||||
{
|
{
|
||||||
if (!initter.pInst || !initter.initted) return -1;
|
if (!initter.pInst || !initter.initted) return -1;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ struct RasterMethodInit
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t unref(RasterMethodInit& initter)
|
static size_t unref(RenderMethodInit& initter)
|
||||||
{
|
{
|
||||||
assert(initter.refCnt > 0);
|
assert(initter.refCnt > 0);
|
||||||
--initter.refCnt;
|
--initter.refCnt;
|
||||||
|
@ -85,13 +85,13 @@ struct RasterMethodInit
|
||||||
return initter.refCnt;
|
return initter.refCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
static RasterMethod* inst(RasterMethodInit& initter)
|
static RenderMethod* inst(RenderMethodInit& initter)
|
||||||
{
|
{
|
||||||
assert(initter.pInst);
|
assert(initter.pInst);
|
||||||
return initter.pInst;
|
return initter.pInst;
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t ref(RasterMethodInit& initter)
|
static size_t ref(RenderMethodInit& initter)
|
||||||
{
|
{
|
||||||
return ++initter.refCnt;
|
return ++initter.refCnt;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
#define _TVG_ENGINE_CPP_
|
#define _TVG_ENGINE_CPP_
|
||||||
|
|
||||||
#include "tvgCommon.h"
|
#include "tvgCommon.h"
|
||||||
#include "tvgSwEngine.h"
|
#include "tvgSwRenderer.h"
|
||||||
#include "tvgGlEngine.h"
|
#include "tvgGlRenderer.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 |= SwEngine::init();
|
ret |= SwRenderer::init();
|
||||||
ret |= GlEngine::init();
|
ret |= GlRenderer::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 |= SwEngine::term();
|
ret |= SwRenderer::term();
|
||||||
ret |= GlEngine::term();
|
ret |= GlRenderer::term();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "tvgCommon.h"
|
#include "tvgCommon.h"
|
||||||
#include "tvgCanvasBase.h"
|
#include "tvgCanvasBase.h"
|
||||||
#include "tvgGlEngine.h"
|
#include "tvgGlRenderer.h"
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* Internal Class Implementation */
|
/* Internal Class Implementation */
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
struct GlCanvas::Impl : CanvasBase
|
struct GlCanvas::Impl : CanvasBase
|
||||||
{
|
{
|
||||||
Impl() : CanvasBase(GlEngine::inst()) {}
|
Impl() : CanvasBase(GlRenderer::inst()) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,11 +76,11 @@ int GlCanvas::update() noexcept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RasterMethod* GlCanvas::engine() noexcept
|
RenderMethod* GlCanvas::engine() noexcept
|
||||||
{
|
{
|
||||||
auto impl = pImpl.get();
|
auto impl = pImpl.get();
|
||||||
assert(impl);
|
assert(impl);
|
||||||
return impl->raster;
|
return impl->renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _TVG_GLCANVAS_CPP_ */
|
#endif /* _TVG_GLCANVAS_CPP_ */
|
||||||
|
|
|
@ -58,14 +58,14 @@ int SceneNode :: push(unique_ptr<ShapeNode> shape) noexcept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SceneNode :: dispose(RasterMethod* engine) noexcept
|
int SceneNode :: dispose(RenderMethod* engine) noexcept
|
||||||
{
|
{
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SceneNode :: update(RasterMethod* engine) noexcept
|
int SceneNode :: update(RenderMethod* engine) noexcept
|
||||||
{
|
{
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -84,7 +84,7 @@ unique_ptr<ShapeNode> ShapeNode::gen() noexcept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ShapeNode :: dispose(RasterMethod* engine) noexcept
|
int ShapeNode :: dispose(RenderMethod* engine) noexcept
|
||||||
{
|
{
|
||||||
auto impl = pImpl.get();
|
auto impl = pImpl.get();
|
||||||
assert(impl);
|
assert(impl);
|
||||||
|
@ -95,12 +95,12 @@ int ShapeNode :: dispose(RasterMethod* engine) noexcept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ShapeNode :: update(RasterMethod* engine) noexcept
|
int ShapeNode :: update(RenderMethod* engine) noexcept
|
||||||
{
|
{
|
||||||
auto impl = pImpl.get();
|
auto impl = pImpl.get();
|
||||||
assert(impl);
|
assert(impl);
|
||||||
|
|
||||||
impl->edata = engine->prepare(*this, impl->edata, RasterMethod::UpdateFlag::All);
|
impl->edata = engine->prepare(*this, impl->edata, RenderMethod::UpdateFlag::All);
|
||||||
if (impl->edata) return 0;
|
if (impl->edata) return 0;
|
||||||
return - 1;
|
return - 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "tvgCommon.h"
|
#include "tvgCommon.h"
|
||||||
#include "tvgCanvasBase.h"
|
#include "tvgCanvasBase.h"
|
||||||
#include "tvgSwEngine.h"
|
#include "tvgSwRenderer.h"
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
@ -32,7 +32,7 @@ struct SwCanvas::Impl : CanvasBase
|
||||||
int stride = 0;
|
int stride = 0;
|
||||||
int height = 0;
|
int height = 0;
|
||||||
|
|
||||||
Impl() : CanvasBase(SwEngine::inst()) {}
|
Impl() : CanvasBase(SwRenderer::inst()) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,11 +111,11 @@ int SwCanvas::update() noexcept
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RasterMethod* SwCanvas::engine() noexcept
|
RenderMethod* SwCanvas::engine() noexcept
|
||||||
{
|
{
|
||||||
auto impl = pImpl.get();
|
auto impl = pImpl.get();
|
||||||
assert(impl);
|
assert(impl);
|
||||||
return impl->raster;
|
return impl->renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _TVG_SWCANVAS_CPP_ */
|
#endif /* _TVG_SWCANVAS_CPP_ */
|
||||||
|
|
Loading…
Add table
Reference in a new issue