diff --git a/inc/tizenvg.h b/inc/tizenvg.h index 4a947daf..b443d503 100644 --- a/inc/tizenvg.h +++ b/inc/tizenvg.h @@ -61,17 +61,17 @@ struct Point /** - * @class PaintNode + * @class Paint * * @ingroup TizenVG * * @brief description... * */ -class TIZENVG_EXPORT PaintNode +class TIZENVG_EXPORT Paint { public: - virtual ~PaintNode() {} + virtual ~Paint() {} virtual int update(RenderMethod*) = 0; }; @@ -91,7 +91,7 @@ public: virtual ~Canvas(); int reserve(size_t n) noexcept; - virtual int push(std::unique_ptr paint) noexcept; + virtual int push(std::unique_ptr paint) noexcept; virtual int clear() noexcept; virtual int update() noexcept; virtual int draw(bool async = true) noexcept; @@ -104,17 +104,17 @@ public: /** - * @class ShapeNode + * @class Shape * * @ingroup TizenVG * * @brief description... * */ -class TIZENVG_EXPORT ShapeNode final : public PaintNode +class TIZENVG_EXPORT Shape final : public Paint { public: - ~ShapeNode(); + ~Shape(); int update(RenderMethod* engine) noexcept override; int reset() noexcept; @@ -134,35 +134,35 @@ public: int pathCoords(const Point** pts) const noexcept; int fill(size_t* r, size_t* g, size_t* b, size_t* a) const noexcept; - static std::unique_ptr gen() noexcept; + static std::unique_ptr gen() noexcept; //FIXME: Ugly... Better design? void *engine() noexcept; - _TIZENVG_DECLARE_PRIVATE(ShapeNode); + _TIZENVG_DECLARE_PRIVATE(Shape); }; /** - * @class SceneNode + * @class Scene * * @ingroup TizenVG * * @brief description... * */ -class TIZENVG_EXPORT SceneNode final : public PaintNode +class TIZENVG_EXPORT Scene final : public Paint { public: - ~SceneNode(); + ~Scene(); int update(RenderMethod* engine) noexcept override; - int push(std::unique_ptr shape) noexcept; + int push(std::unique_ptr shape) noexcept; - static std::unique_ptr gen() noexcept; + static std::unique_ptr gen() noexcept; - _TIZENVG_DECLARE_PRIVATE(SceneNode); + _TIZENVG_DECLARE_PRIVATE(Scene); }; diff --git a/src/lib/gl_engine/tvgGlRenderer.cpp b/src/lib/gl_engine/tvgGlRenderer.cpp index ca319ed7..4e0aa518 100644 --- a/src/lib/gl_engine/tvgGlRenderer.cpp +++ b/src/lib/gl_engine/tvgGlRenderer.cpp @@ -42,7 +42,7 @@ bool GlRenderer::clear() return true; } -bool GlRenderer::render(const ShapeNode& shape, void *data) +bool GlRenderer::render(const Shape& shape, void *data) { GlShape* sdata = static_cast(data); if (!sdata) return false; @@ -53,7 +53,7 @@ bool GlRenderer::render(const ShapeNode& shape, void *data) } -bool GlRenderer::dispose(const ShapeNode& shape, void *data) +bool GlRenderer::dispose(const Shape& shape, void *data) { GlShape* sdata = static_cast(data); if (!sdata) return false; @@ -65,7 +65,7 @@ bool GlRenderer::dispose(const ShapeNode& shape, void *data) } -void* GlRenderer::prepare(const ShapeNode& shape, void* data, UpdateFlag flags) +void* GlRenderer::prepare(const Shape& shape, void* data, UpdateFlag flags) { //prepare shape data GlShape* sdata = static_cast(data); diff --git a/src/lib/gl_engine/tvgGlRenderer.h b/src/lib/gl_engine/tvgGlRenderer.h index b6b95631..a508eed6 100644 --- a/src/lib/gl_engine/tvgGlRenderer.h +++ b/src/lib/gl_engine/tvgGlRenderer.h @@ -23,9 +23,9 @@ namespace tvg class GlRenderer : public RenderMethod { public: - void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override; - bool dispose(const ShapeNode& shape, void *data) override; - bool render(const ShapeNode& shape, void *data) override; + void* prepare(const Shape& shape, void* data, UpdateFlag flags) override; + bool dispose(const Shape& shape, void *data) override; + bool render(const Shape& shape, void *data) override; bool clear() override; size_t ref() override; size_t unref() override; diff --git a/src/lib/meson.build b/src/lib/meson.build index 976aa5ee..5b47bcf9 100644 --- a/src/lib/meson.build +++ b/src/lib/meson.build @@ -9,8 +9,8 @@ source_file = [ 'tvgCanvas.cpp', 'tvgSwCanvas.cpp', 'tvgGlCanvas.cpp', - 'tvgSceneNode.cpp', - 'tvgShapeNode.cpp' + 'tvgScene.cpp', + 'tvgShape.cpp' ] src_dep = declare_dependency( diff --git a/src/lib/sw_engine/tvgSwCommon.h b/src/lib/sw_engine/tvgSwCommon.h index 2900577d..4d654c93 100644 --- a/src/lib/sw_engine/tvgSwCommon.h +++ b/src/lib/sw_engine/tvgSwCommon.h @@ -93,10 +93,10 @@ struct SwShape }; void shapeReset(SwShape& sdata); -bool shapeGenOutline(const ShapeNode& shape, SwShape& sdata); -void shapeDelOutline(const ShapeNode& shape, SwShape& sdata); -bool shapeGenRle(const ShapeNode& shape, SwShape& sdata, const SwSize& clip); -bool shapeTransformOutline(const ShapeNode& shape, SwShape& sdata); +bool shapeGenOutline(const Shape& shape, SwShape& sdata); +void shapeDelOutline(const Shape& shape, SwShape& sdata); +bool shapeGenRle(const Shape& shape, SwShape& sdata, const SwSize& clip); +bool shapeTransformOutline(const Shape& shape, SwShape& sdata); SwRleData* rleRender(const SwShape& sdata, const SwSize& clip); bool rasterShape(Surface& surface, SwShape& sdata, uint8_t r, uint8_t g, uint8_t b, uint8_t a); diff --git a/src/lib/sw_engine/tvgSwRenderer.cpp b/src/lib/sw_engine/tvgSwRenderer.cpp index 983a1cab..eda12cc1 100644 --- a/src/lib/sw_engine/tvgSwRenderer.cpp +++ b/src/lib/sw_engine/tvgSwRenderer.cpp @@ -58,7 +58,7 @@ bool SwRenderer::target(uint32_t* buffer, size_t stride, size_t w, size_t h) } -bool SwRenderer::render(const ShapeNode& shape, void *data) +bool SwRenderer::render(const Shape& shape, void *data) { SwShape* sdata = static_cast(data); if (!sdata) return false; @@ -72,7 +72,7 @@ bool SwRenderer::render(const ShapeNode& shape, void *data) } -bool SwRenderer::dispose(const ShapeNode& shape, void *data) +bool SwRenderer::dispose(const Shape& shape, void *data) { SwShape* sdata = static_cast(data); if (!sdata) return false; @@ -81,7 +81,7 @@ bool SwRenderer::dispose(const ShapeNode& shape, void *data) return true; } -void* SwRenderer::prepare(const ShapeNode& shape, void* data, UpdateFlag flags) +void* SwRenderer::prepare(const Shape& shape, void* data, UpdateFlag flags) { //prepare shape data SwShape* sdata = static_cast(data); diff --git a/src/lib/sw_engine/tvgSwRenderer.h b/src/lib/sw_engine/tvgSwRenderer.h index 95c5a0a1..ce87fa9c 100644 --- a/src/lib/sw_engine/tvgSwRenderer.h +++ b/src/lib/sw_engine/tvgSwRenderer.h @@ -22,9 +22,9 @@ class SwRenderer : public RenderMethod public: Surface surface; - void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) override; - bool dispose(const ShapeNode& shape, void *data) override; - bool render(const ShapeNode& shape, void *data) override; + void* prepare(const Shape& shape, void* data, UpdateFlag flags) override; + bool dispose(const Shape& shape, void *data) override; + bool render(const Shape& shape, void *data) override; bool target(uint32_t* buffer, size_t stride, size_t w, size_t h); bool clear() override; size_t ref() override; diff --git a/src/lib/sw_engine/tvgSwShape.cpp b/src/lib/sw_engine/tvgSwShape.cpp index 82235456..5a1c6c3d 100644 --- a/src/lib/sw_engine/tvgSwShape.cpp +++ b/src/lib/sw_engine/tvgSwShape.cpp @@ -228,14 +228,14 @@ void _deleteOutline(SwShape& sdata) /* External Class Implementation */ /************************************************************************/ -bool shapeTransformOutline(const ShapeNode& shape, SwShape& sdata) +bool shapeTransformOutline(const Shape& shape, SwShape& sdata) { //TODO: return true; } -bool shapeGenRle(const ShapeNode& shape, SwShape& sdata, const SwSize& clip) +bool shapeGenRle(const Shape& shape, SwShape& sdata, const SwSize& clip) { if (sdata.outline->ptsCnt == 0 || sdata.outline->cntrsCnt <= 0) goto end; if (!_updateBBox(sdata)) goto end; @@ -262,7 +262,7 @@ void shapeReset(SwShape& sdata) } -bool shapeGenOutline(const ShapeNode& shape, SwShape& sdata) +bool shapeGenOutline(const Shape& shape, SwShape& sdata) { const PathCommand* cmds = nullptr; auto cmdCnt = shape.pathCommands(&cmds); diff --git a/src/lib/tvgCanvas.cpp b/src/lib/tvgCanvas.cpp index d9bf1764..84a13275 100644 --- a/src/lib/tvgCanvas.cpp +++ b/src/lib/tvgCanvas.cpp @@ -26,10 +26,10 @@ struct Canvas::Impl { - vector nodes; + vector nodes; RenderMethod* renderer; - Impl(RenderMethod *pRenderer):renderer(pRenderer) + Impl(RenderMethod* pRenderer):renderer(pRenderer) { renderer->ref(); } @@ -47,9 +47,9 @@ struct Canvas::Impl return 0; } - int push(unique_ptr paint) + int push(unique_ptr paint) { - PaintNode *node = paint.release(); + Paint* node = paint.release(); assert(node); nodes.push_back(node); return node->update(renderer); @@ -60,9 +60,9 @@ struct Canvas::Impl assert(renderer); for (auto node : nodes) { - if (SceneNode *scene = dynamic_cast(node)) { + if (Scene* scene = dynamic_cast(node)) { cout << "TODO: " << scene << endl; - } else if (ShapeNode *shape = dynamic_cast(node)) { + } else if (Shape *shape = dynamic_cast(node)) { if (!renderer->dispose(*shape, shape->engine())) return -1; } delete(node); @@ -91,9 +91,9 @@ struct Canvas::Impl if (!renderer->clear()) return -1; for(auto node: nodes) { - if (SceneNode *scene = dynamic_cast(node)) { + if (Scene* scene = dynamic_cast(node)) { cout << "TODO: " << scene << endl; - } else if (ShapeNode *shape = dynamic_cast(node)) { + } else if (Shape *shape = dynamic_cast(node)) { if (!renderer->render(*shape, shape->engine())) return -1; } } @@ -125,7 +125,7 @@ int Canvas::reserve(size_t n) noexcept } -int Canvas::push(unique_ptr paint) noexcept +int Canvas::push(unique_ptr paint) noexcept { auto impl = pImpl.get(); assert(impl); diff --git a/src/lib/tvgRenderCommon.h b/src/lib/tvgRenderCommon.h index 07b33cd8..5d619913 100644 --- a/src/lib/tvgRenderCommon.h +++ b/src/lib/tvgRenderCommon.h @@ -33,9 +33,9 @@ class RenderMethod public: enum UpdateFlag { None = 0, Path = 1, Fill = 2, All = 3 }; virtual ~RenderMethod() {} - virtual void* prepare(const ShapeNode& shape, void* data, UpdateFlag flags) = 0; - virtual bool dispose(const ShapeNode& shape, void *data) = 0; - virtual bool render(const ShapeNode& shape, void *data) = 0; + virtual void* prepare(const Shape& shape, void* data, UpdateFlag flags) = 0; + virtual bool dispose(const Shape& shape, void *data) = 0; + virtual bool render(const Shape& shape, void *data) = 0; virtual bool clear() = 0; virtual size_t ref() = 0; virtual size_t unref() = 0; diff --git a/src/lib/tvgSceneNode.cpp b/src/lib/tvgScene.cpp similarity index 72% rename from src/lib/tvgSceneNode.cpp rename to src/lib/tvgScene.cpp index db3ae1d8..75725617 100644 --- a/src/lib/tvgSceneNode.cpp +++ b/src/lib/tvgScene.cpp @@ -14,8 +14,8 @@ * limitations under the License. * */ -#ifndef _TVG_SCENE_NODE_CPP_ -#define _TVG_SCENE_NODE_CPP_ +#ifndef _TVG_SCENE_CPP_ +#define _TVG_SCENE_CPP_ #include "tvgCommon.h" @@ -23,7 +23,7 @@ /* Internal Class Implementation */ /************************************************************************/ -struct SceneNode::Impl +struct Scene::Impl { }; @@ -34,34 +34,34 @@ struct SceneNode::Impl /* External Class Implementation */ /************************************************************************/ -SceneNode::SceneNode() : pImpl(make_unique()) +Scene::Scene() : pImpl(make_unique()) { } -SceneNode::~SceneNode() +Scene::~Scene() { - cout << "SceneNode(" << this << ") destroyed!" << endl; + cout << "Scene(" << this << ") destroyed!" << endl; } -unique_ptr SceneNode::gen() noexcept +unique_ptr Scene::gen() noexcept { - return unique_ptr(new SceneNode); + return unique_ptr(new Scene); } -int SceneNode::push(unique_ptr shape) noexcept +int Scene::push(unique_ptr shape) noexcept { return 0; } -int SceneNode::update(RenderMethod* engine) noexcept +int Scene::update(RenderMethod* engine) noexcept { return 0; } -#endif /* _TVG_SCENE_NODE_CPP_ */ +#endif /* _TVG_SCENE_CPP_ */ diff --git a/src/lib/tvgShapeNode.cpp b/src/lib/tvgShape.cpp similarity index 82% rename from src/lib/tvgShapeNode.cpp rename to src/lib/tvgShape.cpp index 0a872115..5fbfce84 100644 --- a/src/lib/tvgShapeNode.cpp +++ b/src/lib/tvgShape.cpp @@ -14,8 +14,8 @@ * limitations under the License. * */ -#ifndef _TVG_SHAPE_NODE_CPP_ -#define _TVG_SHAPE_NODE_CPP_ +#ifndef _TVG_SHAPE_CPP_ +#define _TVG_SHAPE_CPP_ #include "tvgCommon.h" #include "tvgShapePath.h" @@ -41,7 +41,7 @@ struct ShapeTransform }; -struct ShapeNode::Impl +struct Shape::Impl { ShapeTransform *transform = nullptr; ShapeFill *fill = nullptr; @@ -68,23 +68,23 @@ struct ShapeNode::Impl /* External Class Implementation */ /************************************************************************/ -ShapeNode :: ShapeNode() : pImpl(make_unique()) +Shape :: Shape() : pImpl(make_unique()) { } -ShapeNode :: ~ShapeNode() +Shape :: ~Shape() { } -unique_ptr ShapeNode::gen() noexcept +unique_ptr Shape::gen() noexcept { - return unique_ptr(new ShapeNode); + return unique_ptr(new Shape); } -void* ShapeNode::engine() noexcept +void* Shape::engine() noexcept { auto impl = pImpl.get(); assert(impl); @@ -92,7 +92,7 @@ void* ShapeNode::engine() noexcept } -int ShapeNode::update(RenderMethod* engine) noexcept +int Shape::update(RenderMethod* engine) noexcept { auto impl = pImpl.get(); assert(impl); @@ -103,7 +103,7 @@ int ShapeNode::update(RenderMethod* engine) noexcept } -int ShapeNode::reset() noexcept +int Shape::reset() noexcept { auto impl = pImpl.get(); assert(impl); @@ -114,7 +114,7 @@ int ShapeNode::reset() noexcept } -int ShapeNode::pathCommands(const PathCommand** cmds) const noexcept +int Shape::pathCommands(const PathCommand** cmds) const noexcept { auto impl = pImpl.get(); assert(impl && cmds); @@ -125,7 +125,7 @@ int ShapeNode::pathCommands(const PathCommand** cmds) const noexcept } -int ShapeNode::pathCoords(const Point** pts) const noexcept +int Shape::pathCoords(const Point** pts) const noexcept { auto impl = pImpl.get(); assert(impl && pts); @@ -136,7 +136,7 @@ int ShapeNode::pathCoords(const Point** pts) const noexcept } -int ShapeNode::appendPath(const PathCommand *cmds, size_t cmdCnt, const Point* pts, size_t ptsCnt) noexcept +int Shape::appendPath(const PathCommand *cmds, size_t cmdCnt, const Point* pts, size_t ptsCnt) noexcept { if (cmdCnt < 0 || ptsCnt < 0) return -1; assert(cmds && pts); @@ -151,7 +151,7 @@ int ShapeNode::appendPath(const PathCommand *cmds, size_t cmdCnt, const Point* p } -int ShapeNode::moveTo(float x, float y) noexcept +int Shape::moveTo(float x, float y) noexcept { auto impl = pImpl.get(); assert(impl); @@ -162,7 +162,7 @@ int ShapeNode::moveTo(float x, float y) noexcept } -int ShapeNode::lineTo(float x, float y) noexcept +int Shape::lineTo(float x, float y) noexcept { auto impl = pImpl.get(); assert(impl); @@ -173,7 +173,7 @@ int ShapeNode::lineTo(float x, float y) noexcept } -int ShapeNode::cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y) noexcept +int Shape::cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y) noexcept { auto impl = pImpl.get(); assert(impl); @@ -184,7 +184,7 @@ int ShapeNode::cubicTo(float cx1, float cy1, float cx2, float cy2, float x, floa } -int ShapeNode::close() noexcept +int Shape::close() noexcept { auto impl = pImpl.get(); assert(impl); @@ -195,7 +195,7 @@ int ShapeNode::close() noexcept } -int ShapeNode::appendCircle(float cx, float cy, float radiusW, float radiusH) noexcept +int Shape::appendCircle(float cx, float cy, float radiusW, float radiusH) noexcept { auto impl = pImpl.get(); assert(impl); @@ -215,7 +215,7 @@ int ShapeNode::appendCircle(float cx, float cy, float radiusW, float radiusH) no } -int ShapeNode::appendRect(float x, float y, float w, float h, float cornerRadius) noexcept +int Shape::appendRect(float x, float y, float w, float h, float cornerRadius) noexcept { auto impl = pImpl.get(); assert(impl); @@ -254,7 +254,7 @@ int ShapeNode::appendRect(float x, float y, float w, float h, float cornerRadius } -int ShapeNode::fill(size_t r, size_t g, size_t b, size_t a) noexcept +int Shape::fill(size_t r, size_t g, size_t b, size_t a) noexcept { auto impl = pImpl.get(); assert(impl); @@ -268,7 +268,7 @@ int ShapeNode::fill(size_t r, size_t g, size_t b, size_t a) noexcept } -int ShapeNode::fill(size_t* r, size_t* g, size_t* b, size_t* a) const noexcept +int Shape::fill(size_t* r, size_t* g, size_t* b, size_t* a) const noexcept { auto impl = pImpl.get(); assert(impl); @@ -281,4 +281,4 @@ int ShapeNode::fill(size_t* r, size_t* g, size_t* b, size_t* a) const noexcept return 0; } -#endif //_TVG_SHAPE_NODE_CPP_ +#endif //_TVG_SHAPE_CPP_ diff --git a/test/testBlending.cpp b/test/testBlending.cpp index ef142aa7..58ae0251 100644 --- a/test/testBlending.cpp +++ b/test/testBlending.cpp @@ -19,25 +19,25 @@ void tvgtest() canvas->reserve(5); //Prepare Round Rectangle - auto shape1 = tvg::ShapeNode::gen(); + auto shape1 = tvg::Shape::gen(); shape1->appendRect(0, 0, 400, 400, 50); //x, y, w, h, cornerRadius shape1->fill(0, 255, 0, 255); //r, g, b, a canvas->push(move(shape1)); //Prepare Circle - auto shape2 = tvg::ShapeNode::gen(); + auto shape2 = tvg::Shape::gen(); shape2->appendCircle(400, 400, 200, 200); //cx, cy, radiusW, radiusH shape2->fill(170, 170, 0, 170); //r, g, b, a canvas->push(move(shape2)); //Prepare Ellipse - auto shape3 = tvg::ShapeNode::gen(); + auto shape3 = tvg::Shape::gen(); shape3->appendCircle(400, 400, 250, 100); //cx, cy, radiusW, radiusH shape3->fill(100, 100, 100, 100); //r, g, b, a canvas->push(move(shape3)); //Prepare Star - auto shape4 = tvg::ShapeNode::gen(); + auto shape4 = tvg::Shape::gen(); shape4->moveTo(199, 234); shape4->lineTo(253, 343); shape4->lineTo(374, 360); @@ -53,7 +53,7 @@ void tvgtest() canvas->push(move(shape4)); //Prepare Opaque Ellipse - auto shape5 = tvg::ShapeNode::gen(); + auto shape5 = tvg::Shape::gen(); shape5->appendCircle(600, 650, 200, 150); shape5->fill(0, 0, 255, 255); canvas->push(move(shape5)); diff --git a/test/testBoundary.cpp b/test/testBoundary.cpp index 7d305be9..c5d39f62 100644 --- a/test/testBoundary.cpp +++ b/test/testBoundary.cpp @@ -19,31 +19,31 @@ void tvgtest() canvas->reserve(5); //reserve 5 shape nodes (optional) //Prepare Shape1 - auto shape1 = tvg::ShapeNode::gen(); + auto shape1 = tvg::Shape::gen(); shape1->appendRect(-100, -100, 1000, 1000, 50); shape1->fill(255, 255, 255, 255); canvas->push(move(shape1)); //Prepare Shape2 - auto shape2 = tvg::ShapeNode::gen(); + auto shape2 = tvg::Shape::gen(); shape2->appendRect(-100, -100, 250, 250, 50); shape2->fill(0, 0, 255, 255); canvas->push(move(shape2)); //Prepare Shape3 - auto shape3 = tvg::ShapeNode::gen(); + auto shape3 = tvg::Shape::gen(); shape3->appendRect(500, 500, 550, 550, 0); shape3->fill(0, 255, 255, 255); canvas->push(move(shape3)); //Prepare Shape4 - auto shape4 = tvg::ShapeNode::gen(); + auto shape4 = tvg::Shape::gen(); shape4->appendCircle(800, 100, 200, 200); shape4->fill(255, 255, 0, 255); canvas->push(move(shape4)); //Prepare Shape5 - auto shape5 = tvg::ShapeNode::gen(); + auto shape5 = tvg::Shape::gen(); shape5->appendCircle(200, 650, 250, 200); shape5->fill(0, 0, 0, 255); canvas->push(move(shape5)); diff --git a/test/testComposition.cpp b/test/testComposition.cpp index cf5ed264..57a8e435 100644 --- a/test/testComposition.cpp +++ b/test/testComposition.cpp @@ -22,7 +22,7 @@ int main(int argc, char **argv) auto canvas2 = tvg::SwCanvas::gen(buffer, WIDTH, HEIGHT); //Create a Shape - auto shape = tvg::ShapeNode::gen(); + auto shape = tvg::Shape::gen(); shape->composite(canvas, tvg::CompMaskAdd); //Draw the Scene onto the Canvas diff --git a/test/testDirectUpdate.cpp b/test/testDirectUpdate.cpp index ac6bdc37..df5384df 100644 --- a/test/testDirectUpdate.cpp +++ b/test/testDirectUpdate.cpp @@ -8,7 +8,7 @@ using namespace std; static uint32_t buffer[WIDTH * HEIGHT]; unique_ptr canvas = nullptr; -tvg::ShapeNode* pShape = nullptr; +tvg::Shape* pShape = nullptr; void tvgtest() { @@ -17,7 +17,7 @@ void tvgtest() canvas->target(buffer, WIDTH, WIDTH, HEIGHT); //Shape - auto shape = tvg::ShapeNode::gen(); + auto shape = tvg::Shape::gen(); /* Acquire shape pointer to access it again. instead, you should consider not to interrupt this pointer life-cycle. */ diff --git a/test/testGradient.cpp b/test/testGradient.cpp index a696839b..6a7b6ba7 100644 --- a/test/testGradient.cpp +++ b/test/testGradient.cpp @@ -16,7 +16,7 @@ int main(int argc, char **argv) auto canvas = tvg::SwCanvas::gen(buffer, WIDTH, HEIGHT); //Prepare a Shape - auto shape1 = tvg::ShapeNode::gen(); + auto shape1 = tvg::Shape::gen(); shape1->rect(0, 0, 400, 400, 0.1); //x, y, w, h, corner_radius //Linear Gradient Fill @@ -30,7 +30,7 @@ int main(int argc, char **argv) canvas->push(move(shape1)); //Prepare Circle - auto shape2 = tvg::ShapeNode::gen(); + auto shape2 = tvg::Shape::gen(); shape2->circle(400, 400, 200); //cx, cy, radius //Radial Gradient Fill diff --git a/test/testMergeShapes.cpp b/test/testMergeShapes.cpp index 27ef0c57..8cff17d2 100644 --- a/test/testMergeShapes.cpp +++ b/test/testMergeShapes.cpp @@ -18,7 +18,7 @@ void tvgtest() canvas->target(buffer, WIDTH, WIDTH, HEIGHT); //Prepare a Shape (Rectangle + Rectangle + Circle + Circle) - auto shape1 = tvg::ShapeNode::gen(); + auto shape1 = tvg::Shape::gen(); shape1->appendRect(0, 0, 200, 200, 0); //x, y, w, h, cornerRadius shape1->appendRect(100, 100, 300, 300, 100); //x, y, w, h, cornerRadius shape1->appendCircle(400, 400, 100, 100); //cx, cy, radiusW, radiusH diff --git a/test/testMultiShapes.cpp b/test/testMultiShapes.cpp index d53e9fc4..25393822 100644 --- a/test/testMultiShapes.cpp +++ b/test/testMultiShapes.cpp @@ -19,19 +19,19 @@ void tvgtest() canvas->reserve(3); //reserve 3 shape nodes (optional) //Prepare Round Rectangle - auto shape1 = tvg::ShapeNode::gen(); + auto shape1 = tvg::Shape::gen(); shape1->appendRect(0, 0, 400, 400, 50); //x, y, w, h, cornerRadius shape1->fill(0, 255, 0, 255); //r, g, b, a canvas->push(move(shape1)); //Prepare Circle - auto shape2 = tvg::ShapeNode::gen(); + auto shape2 = tvg::Shape::gen(); shape2->appendCircle(400, 400, 200, 200); //cx, cy, radiusW, radiusH shape2->fill(255, 255, 0, 255); //r, g, b, a canvas->push(move(shape2)); //Prepare Ellipse - auto shape3 = tvg::ShapeNode::gen(); + auto shape3 = tvg::Shape::gen(); shape3->appendCircle(600, 600, 150, 100); //cx, cy, radiusW, radiusH shape3->fill(0, 255, 255, 255); //r, g, b, a canvas->push(move(shape3)); diff --git a/test/testPath.cpp b/test/testPath.cpp index 1ae897d6..c2ca8754 100644 --- a/test/testPath.cpp +++ b/test/testPath.cpp @@ -18,7 +18,7 @@ void tvgtest() canvas->target(buffer, WIDTH, WIDTH, HEIGHT); //Star - auto shape1 = tvg::ShapeNode::gen(); + auto shape1 = tvg::Shape::gen(); //Appends Paths shape1->moveTo(199, 34); @@ -36,7 +36,7 @@ void tvgtest() canvas->push(move(shape1)); //Circle - auto shape2 = tvg::ShapeNode::gen(); + auto shape2 = tvg::Shape::gen(); auto cx = 550.0f; auto cy = 550.0f; diff --git a/test/testPathCopy.cpp b/test/testPathCopy.cpp index e555226f..28d19eb9 100644 --- a/test/testPathCopy.cpp +++ b/test/testPathCopy.cpp @@ -46,7 +46,7 @@ void tvgtest() pts[8] = {26, 161}; //LineTo pts[9] = {146, 143}; //LineTo - auto shape1 = tvg::ShapeNode::gen(); + auto shape1 = tvg::Shape::gen(); shape1->appendPath(cmds, 11, pts, 10); //copy path data shape1->fill(0, 255, 0, 255); canvas->push(move(shape1)); @@ -87,7 +87,7 @@ void tvgtest() pts2[11] = {cx - halfRadius, cy - radius}; //Ctrl2 pts2[12] = {cx, cy - radius}; //To - auto shape2 = tvg::ShapeNode::gen(); + auto shape2 = tvg::Shape::gen(); shape2->appendPath(cmds2, 6, pts2, 13); //copy path data shape2->fill(255, 255, 0, 255); canvas->push(move(shape2)); diff --git a/test/testScene.cpp b/test/testScene.cpp index f3010dca..3232b659 100644 --- a/test/testScene.cpp +++ b/test/testScene.cpp @@ -16,25 +16,25 @@ int main(int argc, char **argv) auto canvas = tvg::SwCanvas::gen(buffer, WIDTH, HEIGHT); //Create a Scene - auto scene = tvg::SceneNode::gen(); + auto scene = tvg::Scene::gen(); scene->reserve(3); //reserve 3 shape nodes (optional) //Shape1 - auto shape1 = tvg::ShapeNode::gen(); + auto shape1 = tvg::Shape::gen(); shape1->rect(0, 0, 400, 400, 0.1); shape1->fill(255, 0, 0, 255); shape1->rotate(0, 0, 45); //axis x, y, z scene->push(move(shape1)); //Shape2 - auto shape2 = tvg::ShapeNode::gen(); + auto shape2 = tvg::Shape::gen(); shape2->rect(0, 0, 400, 400, 0.1); shape2->fill(0, 255, 0, 255); shape2->transform(matrix); //by matrix (var matrix[4 * 4];) scene->push(move(shape2)); //Shape3 - auto shape3 = tvg::ShapeNode::gen(); + auto shape3 = tvg::Shape::gen(); shape3->rect(0, 0, 400, 400, 0.1); shape3->fill(0, 0, 255, 255); shape3->origin(100, 100); //offset diff --git a/test/testShape.cpp b/test/testShape.cpp index 4386637a..8f60263a 100644 --- a/test/testShape.cpp +++ b/test/testShape.cpp @@ -18,7 +18,7 @@ void tvgtest() canvas->target(buffer, WIDTH, WIDTH, HEIGHT); //Prepare a Shape (Rectangle) - auto shape1 = tvg::ShapeNode::gen(); + auto shape1 = tvg::Shape::gen(); shape1->appendRect(100, 100, 400, 400, 0); //x, y, w, h, cornerRadius shape1->fill(255, 0, 0, 255); //r, g, b, a diff --git a/test/testStroke.cpp b/test/testStroke.cpp index de84c32a..e2ae1bc2 100644 --- a/test/testStroke.cpp +++ b/test/testStroke.cpp @@ -16,7 +16,7 @@ int main(int argc, char **argv) auto canvas = tvg::SwCanvas::gen(buffer, WIDTH, HEIGHT); //Prepare a Shape - auto shape1 = tvg::ShapeNode::gen(); + auto shape1 = tvg::Shape::gen(); shape1->rect(0, 0, 400, 400, 0.1); //x, y, w, h, cornerRadius shape1->fill(0, 255, 0, 255); diff --git a/test/testUpdate.cpp b/test/testUpdate.cpp index 97e81ec0..f2256245 100644 --- a/test/testUpdate.cpp +++ b/test/testUpdate.cpp @@ -16,7 +16,7 @@ void tvgtest() canvas->target(buffer, WIDTH, WIDTH, HEIGHT); //Shape - auto shape = tvg::ShapeNode::gen(); + auto shape = tvg::Shape::gen(); shape->appendRect(-100, -100, 200, 200, 0); shape->fill(255, 255, 255, 255); canvas->push(move(shape)); @@ -32,7 +32,7 @@ void transit_cb(Elm_Transit_Effect *effect, Elm_Transit* transit, double progres canvas->clear(); //Shape - auto shape = tvg::ShapeNode::gen(); + auto shape = tvg::Shape::gen(); shape->appendRect(-100 + (800 * progress), -100 + (800 * progress), 200, 200, (100 * progress)); shape->fill(rand()%255, rand()%255, rand()%255, 255); canvas->push(move(shape));