mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 20:14:37 +00:00
renderer/gl_engine: Refine GlCanvas Interface
Refactor the GlCanvas::target() interface to allow passing the drawing target ID from the user side. Previously, it performed the drawing on the currently set FBO target. Beta API change: Result GlCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h) -> Result GlCanvas::target(int32_t id, uint32_t w, uint32_t h)
This commit is contained in:
parent
68f7e4c245
commit
754a4aeaea
56 changed files with 383 additions and 170 deletions
18
inc/thorvg.h
18
inc/thorvg.h
|
@ -1596,7 +1596,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the target buffer for the rasterization.
|
* @brief Sets the drawing target for the rasterization.
|
||||||
*
|
*
|
||||||
* The buffer of a desirable size should be allocated and owned by the caller.
|
* The buffer of a desirable size should be allocated and owned by the caller.
|
||||||
*
|
*
|
||||||
|
@ -1665,13 +1665,21 @@ public:
|
||||||
~GlCanvas();
|
~GlCanvas();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the target buffer for the rasterization.
|
* @brief Sets the drawing target for rasterization.
|
||||||
*
|
*
|
||||||
* @warning Please do not use it, this API is not official one. It could be modified in the next version.
|
* This function specifies the drawing target where the rasterization will occur. It can target
|
||||||
|
* a specific framebuffer object (FBO) or the main surface.
|
||||||
*
|
*
|
||||||
|
* @param[in] id The GL target ID, usually indicating the FBO ID. A value of @c 0 specifies the main surface.
|
||||||
|
* @param[in] w The width (in pixels) of the raster image.
|
||||||
|
* @param[in] h The height (in pixels) of the raster image.
|
||||||
|
*
|
||||||
|
* @warning This API is experimental and not officially supported. It may be modified or removed in future versions.
|
||||||
|
*
|
||||||
|
* @note Currently, this only allows the GL_RGBA8 color space format.
|
||||||
* @note Experimental API
|
* @note Experimental API
|
||||||
*/
|
*/
|
||||||
Result target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h) noexcept;
|
Result target(int32_t id, uint32_t w, uint32_t h) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates a new GlCanvas object.
|
* @brief Creates a new GlCanvas object.
|
||||||
|
|
|
@ -97,11 +97,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -133,11 +133,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -130,11 +130,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
tvgDrawCmds(glCanvas.get());
|
tvgDrawCmds(glCanvas.get());
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,11 +126,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -207,11 +207,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -188,11 +188,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -135,11 +135,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -84,11 +84,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -127,11 +127,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -191,11 +191,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -92,11 +92,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -175,11 +175,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -159,11 +159,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -156,11 +156,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -102,11 +102,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -102,11 +102,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -152,11 +152,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -157,11 +157,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -125,11 +125,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -194,11 +194,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
tvgDrawCmds(glCanvas.get());
|
tvgDrawCmds(glCanvas.get());
|
||||||
|
|
||||||
|
|
|
@ -137,11 +137,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
tvgDrawCmds(glCanvas.get());
|
tvgDrawCmds(glCanvas.get());
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,11 +152,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -159,11 +159,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -424,11 +424,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -156,11 +156,15 @@ void initGLview(Evas_Object *obj)
|
||||||
auto objData = reinterpret_cast<ObjData*>(evas_object_data_get(obj, "objdata"));
|
auto objData = reinterpret_cast<ObjData*>(evas_object_data_get(obj, "objdata"));
|
||||||
objData->idx = counter;
|
objData->idx = counter;
|
||||||
|
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
auto canvas = tvg::GlCanvas::gen();
|
auto canvas = tvg::GlCanvas::gen();
|
||||||
canvas->target(nullptr, SIZE * BPP, SIZE, SIZE);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
canvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -85,11 +85,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -141,11 +141,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -104,11 +104,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -141,11 +141,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -130,11 +130,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -107,11 +107,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -113,11 +113,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -105,11 +105,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -104,11 +104,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -84,11 +84,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -113,11 +113,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -125,11 +125,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -128,11 +128,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -132,11 +132,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -147,11 +147,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -110,11 +110,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -156,11 +156,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -77,11 +77,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -163,11 +163,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -209,11 +209,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -198,11 +198,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -134,11 +134,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -124,11 +124,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -208,11 +208,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -113,11 +113,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -120,11 +120,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -101,11 +101,15 @@ static unique_ptr<tvg::GlCanvas> glCanvas;
|
||||||
|
|
||||||
void initGLview(Evas_Object *obj)
|
void initGLview(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
static constexpr auto BPP = 4;
|
|
||||||
|
|
||||||
//Create a Canvas
|
//Create a Canvas
|
||||||
glCanvas = tvg::GlCanvas::gen();
|
glCanvas = tvg::GlCanvas::gen();
|
||||||
glCanvas->target(nullptr, WIDTH * BPP, WIDTH, HEIGHT);
|
|
||||||
|
//Get the drawing target id
|
||||||
|
int32_t targetId;
|
||||||
|
auto gl = elm_glview_gl_api_get(obj);
|
||||||
|
gl->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &targetId);
|
||||||
|
|
||||||
|
glCanvas->target(targetId, WIDTH, HEIGHT);
|
||||||
|
|
||||||
/* Push the shape into the Canvas drawing list
|
/* Push the shape into the Canvas drawing list
|
||||||
When this shape is into the canvas list, the shape could update & prepare
|
When this shape is into the canvas list, the shape could update & prepare
|
||||||
|
|
|
@ -54,11 +54,11 @@ bool GlRenderer::clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GlRenderer::target(TVG_UNUSED uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
|
bool GlRenderer::target(int32_t id, uint32_t w, uint32_t h)
|
||||||
{
|
{
|
||||||
assert(w > 0 && h > 0);
|
assert(w > 0 && h > 0);
|
||||||
|
|
||||||
surface.stride = stride;
|
surface.stride = w;
|
||||||
surface.w = w;
|
surface.w = w;
|
||||||
surface.h = h;
|
surface.h = h;
|
||||||
|
|
||||||
|
@ -67,10 +67,7 @@ bool GlRenderer::target(TVG_UNUSED uint32_t* buffer, uint32_t stride, uint32_t w
|
||||||
mViewport.w = surface.w;
|
mViewport.w = surface.w;
|
||||||
mViewport.h = surface.h;
|
mViewport.h = surface.h;
|
||||||
|
|
||||||
// get current binded framebuffer id
|
mTargetFboId = static_cast<GLint>(id);
|
||||||
// EFL seems has a seperate framebuffer for evagl view
|
|
||||||
//TODO: introduce a new api to specify which fbo this canvas is binded
|
|
||||||
GL_CHECK(glGetIntegerv(GL_FRAMEBUFFER_BINDING, &mTargetFboId));
|
|
||||||
|
|
||||||
mRootTarget = make_unique<GlRenderTarget>(surface.w, surface.h);
|
mRootTarget = make_unique<GlRenderTarget>(surface.w, surface.h);
|
||||||
mRootTarget->init(mTargetFboId);
|
mRootTarget->init(mTargetFboId);
|
||||||
|
|
|
@ -67,7 +67,7 @@ public:
|
||||||
bool blend(BlendMethod method) override;
|
bool blend(BlendMethod method) override;
|
||||||
ColorSpace colorSpace() override;
|
ColorSpace colorSpace() override;
|
||||||
|
|
||||||
bool target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h);
|
bool target(int32_t id, uint32_t w, uint32_t h);
|
||||||
bool sync() override;
|
bool sync() override;
|
||||||
bool clear() override;
|
bool clear() override;
|
||||||
|
|
||||||
|
|
|
@ -60,14 +60,14 @@ GlCanvas::~GlCanvas()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Result GlCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h) noexcept
|
Result GlCanvas::target(int32_t id, uint32_t w, uint32_t h) noexcept
|
||||||
{
|
{
|
||||||
#ifdef THORVG_GL_RASTER_SUPPORT
|
#ifdef THORVG_GL_RASTER_SUPPORT
|
||||||
//We know renderer type, avoid dynamic_cast for performance.
|
//We know renderer type, avoid dynamic_cast for performance.
|
||||||
auto renderer = static_cast<GlRenderer*>(Canvas::pImpl->renderer);
|
auto renderer = static_cast<GlRenderer*>(Canvas::pImpl->renderer);
|
||||||
if (!renderer) return Result::MemoryCorruption;
|
if (!renderer) return Result::MemoryCorruption;
|
||||||
|
|
||||||
if (!renderer->target(buffer, stride, w, h)) return Result::Unknown;
|
if (!renderer->target(id, w, h)) return Result::Unknown;
|
||||||
|
|
||||||
//Paints must be updated again with this new target.
|
//Paints must be updated again with this new target.
|
||||||
Canvas::pImpl->needRefresh();
|
Canvas::pImpl->needRefresh();
|
||||||
|
|
Loading…
Add table
Reference in a new issue