thorvg/test/testComposition.cpp
Hermet Park f627679882 common initializer: replace engine class with intializer
This initializer will take over the global environments of tvg engines.

Change-Id: I7b99973dafaea57ddd3134800bd442ef4dc319ae
2020-06-16 12:54:53 +09:00

35 lines
828 B
C++

#include <tizenvg.h>
using namespace std;
#define WIDTH 800
#define HEIGHT 800
static uint32_t buffer[WIDTH * HEIGHT];
int main(int argc, char **argv)
{
//Initialize TizenVG 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 TizenVG Engine
tvg::Initializer::term(tvg::CanvasEngine::Sw);
}