CanvasRenderer::Shape: Add AddPath() Api 73/262073/6
authorJunsuChoi <jsuya.choi@samsung.com>
Mon, 2 Aug 2021 08:51:16 +0000 (17:51 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Fri, 13 Aug 2021 00:51:51 +0000 (09:51 +0900)
commit2c0625068a251175180f986043cc9541121d39ab
tree14260d0ececb0c37d83f1616be0c0f93b6487cac
parent9a74a0725264526224eac77728de38108e92fb8a
CanvasRenderer::Shape: Add AddPath() Api

Adds an API that adds a large path information.
The PathCommands structure has a PathCommandType array, a Point array
and the number of each array.

ex)
//Prepare Path Commands
Dali::CanvasRenderer::Shape::PathCommandType commands[11];
commands[0] = Dali::CanvasRenderer::Shape::PathCommandType::MOVE_TO;
commands[1] = Dali::CanvasRenderer::Shape::PathCommandType::LINE_TO;
commands[2] = Dali::CanvasRenderer::Shape::PathCommandType::LINE_TO;
commands[3] = Dali::CanvasRenderer::Shape::PathCommandType::LINE_TO;
commands[4] = Dali::CanvasRenderer::Shape::PathCommandType::LINE_TO;
commands[5] = Dali::CanvasRenderer::Shape::PathCommandType::LINE_TO;
commands[6] = Dali::CanvasRenderer::Shape::PathCommandType::LINE_TO;
commands[7] = Dali::CanvasRenderer::Shape::PathCommandType::LINE_TO;
commands[8] = Dali::CanvasRenderer::Shape::PathCommandType::LINE_TO;
commands[9] = Dali::CanvasRenderer::Shape::PathCommandType::LINE_TO;
commands[10] = Dali::CanvasRenderer::Shape::PathCommandType::CLOSE;

//Prepare Path Points
float points[20] = {-1.0f, -165.0f,
                    53.0f, -56.0f,
                    174.0f, -39.0f,
                    87.0f, 45.0f,
                    107.0f, 166.0f,
                    -1.0f, 110.0f,
                    -103.0f, 166.0f,
                    -88.0f, 46.0f,
                    -174.0f, -38.0f,
                    -54.0f, -56.0f};

Dali::CanvasRenderer::Shape::PathCommands starPath = { commands, 11, points, 20 };

Dali::CanvasRenderer::Shape star = Dali::CanvasRenderer::Shape::New();
star.AddPath(starPath);
mCanvasView.AddDrawable(star);

Change-Id: I36cea22b1e80bfe2182cdb7fb2a8e262523c2a4f
dali/devel-api/adaptor-framework/canvas-renderer-shape.cpp
dali/devel-api/adaptor-framework/canvas-renderer-shape.h
dali/internal/canvas-renderer/common/shape-impl.cpp
dali/internal/canvas-renderer/common/shape-impl.h
dali/internal/canvas-renderer/generic/shape-impl-generic.cpp
dali/internal/canvas-renderer/generic/shape-impl-generic.h
dali/internal/canvas-renderer/tizen/shape-impl-tizen.cpp
dali/internal/canvas-renderer/tizen/shape-impl-tizen.h
dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.cpp
dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.h