From 9b7337622d1770f7d4e692bb60f838ca7ba9c5ca Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Sat, 18 Apr 2020 22:59:27 +0900 Subject: [PATCH] rename class names. RasterMethod -> RenderMethod SwEngine -> SwRenderer GlEngine -> GlRenderer Change-Id: Ic2ded698e49c4373fe21fe31fa34baca01bf43a2 --- inc/tizenvg.h | 18 ++++++------ src/lib/gl_engine/meson.build | 4 +-- .../{tvgGlEngine.cpp => tvgGlRenderer.cpp} | 34 +++++++++++----------- .../gl_engine/{tvgGlEngine.h => tvgGlRenderer.h} | 14 ++++----- src/lib/sw_engine/meson.build | 4 +-- .../{tvgSwEngine.cpp => tvgSwRenderer.cpp} | 34 +++++++++++----------- .../sw_engine/{tvgSwEngine.h => tvgSwRenderer.h} | 14 ++++----- src/lib/tvgCanvasBase.h | 14 ++++----- src/lib/tvgCommon.h | 18 ++++++------ src/lib/tvgEngine.cpp | 12 ++++---- src/lib/tvgGlCanvas.cpp | 8 ++--- src/lib/tvgSceneNode.cpp | 4 +-- src/lib/tvgShapeNode.cpp | 6 ++-- src/lib/tvgSwCanvas.cpp | 8 ++--- 14 files changed, 96 insertions(+), 96 deletions(-) rename src/lib/gl_engine/{tvgGlEngine.cpp => tvgGlRenderer.cpp} (68%) rename src/lib/gl_engine/{tvgGlEngine.h => tvgGlRenderer.h} (82%) rename src/lib/sw_engine/{tvgSwEngine.cpp => tvgSwRenderer.cpp} (73%) rename src/lib/sw_engine/{tvgSwEngine.h => tvgSwRenderer.h} (82%) diff --git a/inc/tizenvg.h b/inc/tizenvg.h index e9f49d3..dd125b5 100644 --- a/inc/tizenvg.h +++ b/inc/tizenvg.h @@ -52,7 +52,7 @@ namespace tvg enum class TIZENVG_EXPORT PathCommand { Close, MoveTo, LineTo, CubicTo }; -class RasterMethod; +class RenderMethod; struct Point { @@ -73,8 +73,8 @@ class TIZENVG_EXPORT PaintNode { public: virtual ~PaintNode() {} - virtual int dispose(RasterMethod* engine) = 0; - virtual int update(RasterMethod* engine) = 0; + virtual int dispose(RenderMethod* engine) = 0; + virtual int update(RenderMethod* engine) = 0; }; @@ -91,8 +91,8 @@ class TIZENVG_EXPORT ShapeNode final : public PaintNode public: ~ShapeNode(); - int dispose(RasterMethod* engine) noexcept override; - int update(RasterMethod* engine) noexcept override; + int dispose(RenderMethod* engine) noexcept override; + int update(RenderMethod* engine) noexcept override; int clear() 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: ~SceneNode(); - int dispose(RasterMethod* engine) noexcept override; - int update(RasterMethod* engine) noexcept override; + int dispose(RenderMethod* engine) noexcept override; + int update(RenderMethod* engine) noexcept override; int push(std::unique_ptr shape) noexcept; @@ -153,7 +153,7 @@ public: int update() noexcept; int draw(bool async = true) noexcept; int sync() noexcept; - RasterMethod* engine() noexcept; + RenderMethod* engine() noexcept; int target(uint32_t* buffer, size_t stride, size_t height) noexcept; @@ -183,7 +183,7 @@ public: int update() noexcept; int draw(bool async = true) noexcept { return 0; } int sync() noexcept { return 0; } - RasterMethod* engine() noexcept; + RenderMethod* engine() noexcept; static std::unique_ptr gen() noexcept; diff --git a/src/lib/gl_engine/meson.build b/src/lib/gl_engine/meson.build index 117149a..13e7fef 100644 --- a/src/lib/gl_engine/meson.build +++ b/src/lib/gl_engine/meson.build @@ -1,6 +1,6 @@ source_file = [ - 'tvgGlEngine.h', - 'tvgGlEngine.cpp', + 'tvgGlRenderer.h', + 'tvgGlRenderer.cpp', ] glraster_dep = declare_dependency( diff --git a/src/lib/gl_engine/tvgGlEngine.cpp b/src/lib/gl_engine/tvgGlRenderer.cpp similarity index 68% rename from src/lib/gl_engine/tvgGlEngine.cpp rename to src/lib/gl_engine/tvgGlRenderer.cpp index 65a5ce3..92f00dd 100644 --- a/src/lib/gl_engine/tvgGlEngine.cpp +++ b/src/lib/gl_engine/tvgGlRenderer.cpp @@ -14,17 +14,17 @@ * limitations under the License. * */ -#ifndef _TVG_GL_ENGINE_CPP_ -#define _TVG_GL_ENGINE_CPP_ +#ifndef _TVG_GL_RENDERER_CPP_ +#define _TVG_GL_RENDERER_CPP_ #include "tvgCommon.h" -#include "tvgGlEngine.h" +#include "tvgGlRenderer.h" /************************************************************************/ /* Internal Class Implementation */ /************************************************************************/ -static RasterMethodInit engineInit; +static RenderMethodInit engineInit; struct GlShape { @@ -35,7 +35,7 @@ struct GlShape /* External Class Implementation */ /************************************************************************/ -void* GlEngine::dispose(const ShapeNode& shape, void *data) +void* GlRenderer::dispose(const ShapeNode& shape, void *data) { GlShape* sdata = static_cast(data); 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 GlShape* sdata = static_cast(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(RasterMethodInit::inst(engineInit)); + return dynamic_cast(RenderMethodInit::inst(engineInit)); } -#endif /* _TVG_GL_ENGINE_CPP_ */ +#endif /* _TVG_GL_RENDERER_CPP_ */ diff --git a/src/lib/gl_engine/tvgGlEngine.h b/src/lib/gl_engine/tvgGlRenderer.h similarity index 82% rename from src/lib/gl_engine/tvgGlEngine.h rename to src/lib/gl_engine/tvgGlRenderer.h index ebd1fd5..534969a 100644 --- a/src/lib/gl_engine/tvgGlEngine.h +++ b/src/lib/gl_engine/tvgGlRenderer.h @@ -14,13 +14,13 @@ * limitations under the License. * */ -#ifndef _TVG_GL_ENGINE_H_ -#define _TVG_GL_ENGINE_H_ +#ifndef _TVG_GL_RENDERER_H_ +#define _TVG_GL_RENDERER_H_ namespace tvg { -class GlEngine : public RasterMethod +class GlRenderer : public RenderMethod { public: void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override; @@ -28,15 +28,15 @@ public: size_t ref() override; size_t unref() override; - static GlEngine* inst(); + static GlRenderer* inst(); static int init(); static int term(); private: - GlEngine(){}; - ~GlEngine(){}; + GlRenderer(){}; + ~GlRenderer(){}; }; } -#endif /* _TVG_GL_ENGINE_H_ */ +#endif /* _TVG_GL_RENDERER_H_ */ diff --git a/src/lib/sw_engine/meson.build b/src/lib/sw_engine/meson.build index a1bb0e0..4edd489 100644 --- a/src/lib/sw_engine/meson.build +++ b/src/lib/sw_engine/meson.build @@ -1,7 +1,7 @@ source_file = [ 'tvgSwCommon.h', - 'tvgSwEngine.h', - 'tvgSwEngine.cpp', + 'tvgSwRenderer.h', + 'tvgSwRenderer.cpp', 'tvgSwShape.cpp', 'tvgSwRle.cpp', ] diff --git a/src/lib/sw_engine/tvgSwEngine.cpp b/src/lib/sw_engine/tvgSwRenderer.cpp similarity index 73% rename from src/lib/sw_engine/tvgSwEngine.cpp rename to src/lib/sw_engine/tvgSwRenderer.cpp index 683bffa..a4f126d 100644 --- a/src/lib/sw_engine/tvgSwEngine.cpp +++ b/src/lib/sw_engine/tvgSwRenderer.cpp @@ -14,24 +14,24 @@ * limitations under the License. * */ -#ifndef _TVG_SW_ENGINE_CPP_ -#define _TVG_SW_ENGINE_CPP_ +#ifndef _TVG_SW_RENDERER_CPP_ +#define _TVG_SW_RENDERER_CPP_ #include "tvgSwCommon.h" -#include "tvgSwEngine.h" +#include "tvgSwRenderer.h" /************************************************************************/ /* Internal Class Implementation */ /************************************************************************/ -static RasterMethodInit engineInit; +static RenderMethodInit engineInit; /************************************************************************/ /* External Class Implementation */ /************************************************************************/ -void* SwEngine::dispose(const ShapeNode& shape, void *data) +void* SwRenderer::dispose(const ShapeNode& shape, void *data) { SwShape* sdata = static_cast(data); if (!sdata) return nullptr; @@ -40,7 +40,7 @@ void* SwEngine::dispose(const ShapeNode& shape, void *data) 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 SwShape* sdata = static_cast(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(RasterMethodInit::inst(engineInit)); + return dynamic_cast(RenderMethodInit::inst(engineInit)); } -#endif /* _TVG_SW_ENGINE_CPP_ */ +#endif /* _TVG_SW_RENDERER_CPP_ */ diff --git a/src/lib/sw_engine/tvgSwEngine.h b/src/lib/sw_engine/tvgSwRenderer.h similarity index 82% rename from src/lib/sw_engine/tvgSwEngine.h rename to src/lib/sw_engine/tvgSwRenderer.h index dd2d401..13f4f27 100644 --- a/src/lib/sw_engine/tvgSwEngine.h +++ b/src/lib/sw_engine/tvgSwRenderer.h @@ -14,10 +14,10 @@ * limitations under the License. * */ -#ifndef _TVG_SW_ENGINE_H_ -#define _TVG_SW_ENGINE_H_ +#ifndef _TVG_SW_RENDERER_H_ +#define _TVG_SW_RENDERER_H_ -class SwEngine : public RasterMethod +class SwRenderer : public RenderMethod { public: void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override; @@ -25,13 +25,13 @@ public: size_t ref() override; size_t unref() override; - static SwEngine* inst(); + static SwRenderer* inst(); static int init(); static int term(); private: - SwEngine(){}; - ~SwEngine(){}; + SwRenderer(){}; + ~SwRenderer(){}; }; -#endif /* _TVG_SW_ENGINE_H_ */ +#endif /* _TVG_SW_RENDERER_H_ */ diff --git a/src/lib/tvgCanvasBase.h b/src/lib/tvgCanvasBase.h index 3ec6c7a..89476ad 100644 --- a/src/lib/tvgCanvasBase.h +++ b/src/lib/tvgCanvasBase.h @@ -26,17 +26,17 @@ struct CanvasBase { vector nodes; - RasterMethod* raster; + RenderMethod* renderer; - CanvasBase(RasterMethod *pRaster):raster(pRaster) + CanvasBase(RenderMethod *pRenderer):renderer(pRenderer) { - raster->ref(); + renderer->ref(); } ~CanvasBase() { clear(); - raster->unref(); + renderer->unref(); } int reserve(size_t n) @@ -49,7 +49,7 @@ struct CanvasBase int clear() { for (auto node : nodes) { - node->dispose(raster); + node->dispose(renderer); delete(node); } nodes.clear(); @@ -67,11 +67,11 @@ struct CanvasBase if (SceneNode *scene = dynamic_cast(node)) { } else if (ShapeNode *shape = dynamic_cast(node)) { - return shape->update(raster); + return shape->update(renderer); } #else if (ShapeNode *shape = dynamic_cast(node)) { - return shape->update(raster); + return shape->update(renderer); } #endif cout << "What type of PaintNode? = " << node << endl; diff --git a/src/lib/tvgCommon.h b/src/lib/tvgCommon.h index fe2d8e2..d7d1d4d 100644 --- a/src/lib/tvgCommon.h +++ b/src/lib/tvgCommon.h @@ -29,24 +29,24 @@ using namespace tvg; namespace tvg { -class RasterMethod +class RenderMethod { public: 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* dispose(const ShapeNode& shape, void *data) = 0; virtual size_t ref() = 0; virtual size_t unref() = 0; }; -struct RasterMethodInit +struct RenderMethodInit { - RasterMethod* pInst = nullptr; + RenderMethod* pInst = nullptr; size_t refCnt = 0; bool initted = false; - static int init(RasterMethodInit& initter, RasterMethod* engine) + static int init(RenderMethodInit& initter, RenderMethod* engine) { assert(engine); if (initter.pInst || initter.refCnt > 0) return -1; @@ -56,7 +56,7 @@ struct RasterMethodInit return 0; } - static int term(RasterMethodInit& initter) + static int term(RenderMethodInit& initter) { if (!initter.pInst || !initter.initted) return -1; @@ -70,7 +70,7 @@ struct RasterMethodInit return 0; } - static size_t unref(RasterMethodInit& initter) + static size_t unref(RenderMethodInit& initter) { assert(initter.refCnt > 0); --initter.refCnt; @@ -85,13 +85,13 @@ struct RasterMethodInit return initter.refCnt; } - static RasterMethod* inst(RasterMethodInit& initter) + static RenderMethod* inst(RenderMethodInit& initter) { assert(initter.pInst); return initter.pInst; } - static size_t ref(RasterMethodInit& initter) + static size_t ref(RenderMethodInit& initter) { return ++initter.refCnt; } diff --git a/src/lib/tvgEngine.cpp b/src/lib/tvgEngine.cpp index d99ee2d..fa005dc 100644 --- a/src/lib/tvgEngine.cpp +++ b/src/lib/tvgEngine.cpp @@ -18,8 +18,8 @@ #define _TVG_ENGINE_CPP_ #include "tvgCommon.h" -#include "tvgSwEngine.h" -#include "tvgGlEngine.h" +#include "tvgSwRenderer.h" +#include "tvgGlRenderer.h" /************************************************************************/ /* Internal Class Implementation */ @@ -35,8 +35,8 @@ int Engine::init() noexcept //TODO: Initialize Raster engines by configuration. int ret = 0; - ret |= SwEngine::init(); - ret |= GlEngine::init(); + ret |= SwRenderer::init(); + ret |= GlRenderer::init(); return ret; } @@ -45,8 +45,8 @@ int Engine::init() noexcept int Engine::term() noexcept { int ret = 0; - ret |= SwEngine::term(); - ret |= GlEngine::term(); + ret |= SwRenderer::term(); + ret |= GlRenderer::term(); return ret; } diff --git a/src/lib/tvgGlCanvas.cpp b/src/lib/tvgGlCanvas.cpp index 7fb9a28..619ea4b 100644 --- a/src/lib/tvgGlCanvas.cpp +++ b/src/lib/tvgGlCanvas.cpp @@ -19,7 +19,7 @@ #include "tvgCommon.h" #include "tvgCanvasBase.h" -#include "tvgGlEngine.h" +#include "tvgGlRenderer.h" /************************************************************************/ /* Internal Class Implementation */ @@ -27,7 +27,7 @@ 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(); assert(impl); - return impl->raster; + return impl->renderer; } #endif /* _TVG_GLCANVAS_CPP_ */ diff --git a/src/lib/tvgSceneNode.cpp b/src/lib/tvgSceneNode.cpp index 93a9b21..9c7d11f 100644 --- a/src/lib/tvgSceneNode.cpp +++ b/src/lib/tvgSceneNode.cpp @@ -58,14 +58,14 @@ int SceneNode :: push(unique_ptr shape) noexcept } -int SceneNode :: dispose(RasterMethod* engine) noexcept +int SceneNode :: dispose(RenderMethod* engine) noexcept { return 0; } -int SceneNode :: update(RasterMethod* engine) noexcept +int SceneNode :: update(RenderMethod* engine) noexcept { return 0; diff --git a/src/lib/tvgShapeNode.cpp b/src/lib/tvgShapeNode.cpp index f17021a..74dae23 100644 --- a/src/lib/tvgShapeNode.cpp +++ b/src/lib/tvgShapeNode.cpp @@ -84,7 +84,7 @@ unique_ptr ShapeNode::gen() noexcept } -int ShapeNode :: dispose(RasterMethod* engine) noexcept +int ShapeNode :: dispose(RenderMethod* engine) noexcept { auto impl = pImpl.get(); 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(); 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; return - 1; } diff --git a/src/lib/tvgSwCanvas.cpp b/src/lib/tvgSwCanvas.cpp index e85275f..4d930a7 100644 --- a/src/lib/tvgSwCanvas.cpp +++ b/src/lib/tvgSwCanvas.cpp @@ -19,7 +19,7 @@ #include "tvgCommon.h" #include "tvgCanvasBase.h" -#include "tvgSwEngine.h" +#include "tvgSwRenderer.h" /************************************************************************/ @@ -32,7 +32,7 @@ struct SwCanvas::Impl : CanvasBase int stride = 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(); assert(impl); - return impl->raster; + return impl->renderer; } #endif /* _TVG_SWCANVAS_CPP_ */ -- 2.7.4