mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00

we're going to open this project as the independent one, thus removed tizen naming here. Change-Id: Ib3c898067dd9186e893f7cb0903fd70d2ce7b31f
35 lines
825 B
C++
35 lines
825 B
C++
#include <thorvg.h>
|
|
|
|
using namespace std;
|
|
|
|
#define WIDTH 800
|
|
#define HEIGHT 800
|
|
|
|
static uint32_t buffer[WIDTH * HEIGHT];
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
//Initialize ThorVG Engine
|
|
tvg::Initializer::init(tvg::CanvasEngine::Sw);
|
|
|
|
//Create a Composition Source Canvas
|
|
auto canvas1 = tvg::SwCanvas::gen(buffer, WIDTH, HEIGHT);
|
|
|
|
//Draw something onto the Canvas and leaving sync to the target.
|
|
canvas1->draw();
|
|
|
|
//Create a Main Canvas
|
|
auto canvas2 = tvg::SwCanvas::gen(buffer, WIDTH, HEIGHT);
|
|
|
|
//Create a Shape
|
|
auto shape = tvg::Shape::gen();
|
|
shape->composite(canvas, tvg::CompMaskAdd);
|
|
|
|
//Draw the Scene onto the Canvas
|
|
canvas2->push(move(shape));
|
|
canvas2->draw();
|
|
canvas2->sync();
|
|
|
|
//Terminate ThorVG Engine
|
|
tvg::Initializer::term(tvg::CanvasEngine::Sw);
|
|
}
|