mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 20:18:22 +08:00
change WITH_NANOVG_GL to WITH_NANOVG_GPU
This commit is contained in:
parent
5ddd382c25
commit
f0dc4bd0aa
@ -151,7 +151,7 @@ ret_t image_manager_load(image_manager_t* imm, const char* name, bitmap_t* image
|
|||||||
image->name = res->name;
|
image->name = res->name;
|
||||||
image->data = header->data;
|
image->data = header->data;
|
||||||
|
|
||||||
#if defined(WITH_NANOVG_GL) || defined(WITH_NANOVG_SOFT)
|
#if defined(WITH_NANOVG_GPU) || defined(WITH_NANOVG_SOFT)
|
||||||
image_manager_add(imm, name, image);
|
image_manager_add(imm, name, image);
|
||||||
#endif
|
#endif
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
|
@ -67,7 +67,7 @@ ret_t window_animator_destroy(window_animator_t* wa) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret_t window_animator_begin_frame(window_animator_t* wa) {
|
ret_t window_animator_begin_frame(window_animator_t* wa) {
|
||||||
#ifdef WITH_NANOVG_GL
|
#ifdef WITH_NANOVG_GPU
|
||||||
(void)wa;
|
(void)wa;
|
||||||
#else
|
#else
|
||||||
rect_t r;
|
rect_t r;
|
||||||
@ -80,7 +80,7 @@ ret_t window_animator_begin_frame(window_animator_t* wa) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret_t window_animator_begin_frame_overlap(window_animator_t* wa) {
|
ret_t window_animator_begin_frame_overlap(window_animator_t* wa) {
|
||||||
#ifdef WITH_NANOVG_GL
|
#ifdef WITH_NANOVG_GPU
|
||||||
(void)wa;
|
(void)wa;
|
||||||
#else
|
#else
|
||||||
rect_t r;
|
rect_t r;
|
||||||
|
@ -19,7 +19,7 @@ static ret_t window_animator_open_bottom_to_top_draw_prev(window_animator_t* wa)
|
|||||||
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
||||||
dst = rect_init(win->x, win->y, win->w, win->h);
|
dst = rect_init(win->x, win->y, win->w, win->h);
|
||||||
|
|
||||||
#ifndef WITH_NANOVG_GL
|
#ifndef WITH_NANOVG_GPU
|
||||||
if (wa->percent > 0 && !lcd_is_swappable(c->lcd)) {
|
if (wa->percent > 0 && !lcd_is_swappable(c->lcd)) {
|
||||||
wh_t h = (1 - wa->percent) * wa->curr_win->h;
|
wh_t h = (1 - wa->percent) * wa->curr_win->h;
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ static ret_t window_animator_open_bottom_to_top_draw_curr(window_animator_t* wa)
|
|||||||
float_t percent = wa->percent;
|
float_t percent = wa->percent;
|
||||||
float_t alpha = percent;
|
float_t alpha = percent;
|
||||||
|
|
||||||
#ifdef WITH_NANOVG_GL
|
#ifdef WITH_NANOVG_GPU
|
||||||
float_t h = win->h * percent;
|
float_t h = win->h * percent;
|
||||||
float_t y = win->parent->h - h;
|
float_t y = win->parent->h - h;
|
||||||
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
||||||
|
@ -18,13 +18,13 @@ static ret_t window_animator_open_scale_draw_prev(window_animator_t* wa) {
|
|||||||
|
|
||||||
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
||||||
dst = rect_init(win->x, win->y, win->w, win->h);
|
dst = rect_init(win->x, win->y, win->w, win->h);
|
||||||
#ifndef WITH_NANOVG_GL
|
#ifndef WITH_NANOVG_GPU
|
||||||
if (wa->percent > 0 && !lcd_is_swappable(c->lcd)) {
|
if (wa->percent > 0 && !lcd_is_swappable(c->lcd)) {
|
||||||
win = wa->curr_win;
|
win = wa->curr_win;
|
||||||
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
||||||
dst = rect_init(win->x, win->y, win->w, win->h);
|
dst = rect_init(win->x, win->y, win->w, win->h);
|
||||||
}
|
}
|
||||||
#endif /*WITH_NANOVG_GL*/
|
#endif /*WITH_NANOVG_GPU*/
|
||||||
lcd_draw_image(c->lcd, &(wa->prev_img), &src, &dst);
|
lcd_draw_image(c->lcd, &(wa->prev_img), &src, &dst);
|
||||||
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
@ -40,7 +40,7 @@ static ret_t window_animator_open_scale_draw_curr(window_animator_t* wa) {
|
|||||||
float_t alpha = wa->open ? wa->time_percent : 1 - wa->time_percent;
|
float_t alpha = wa->open ? wa->time_percent : 1 - wa->time_percent;
|
||||||
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
||||||
|
|
||||||
#ifdef WITH_NANOVG_GL
|
#ifdef WITH_NANOVG_GPU
|
||||||
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
||||||
dst = rect_init(0, 0, win->w, win->h);
|
dst = rect_init(0, 0, win->w, win->h);
|
||||||
vgcanvas_save(vg);
|
vgcanvas_save(vg);
|
||||||
@ -60,7 +60,7 @@ static ret_t window_animator_open_scale_draw_curr(window_animator_t* wa) {
|
|||||||
lcd_set_global_alpha(c->lcd, alpha * 0xff);
|
lcd_set_global_alpha(c->lcd, alpha * 0xff);
|
||||||
lcd_draw_image(c->lcd, &(wa->curr_img), &src, &dst);
|
lcd_draw_image(c->lcd, &(wa->curr_img), &src, &dst);
|
||||||
}
|
}
|
||||||
#endif /*WITH_NANOVG_GL*/
|
#endif /*WITH_NANOVG_GPU*/
|
||||||
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
@ -18,13 +18,13 @@ static ret_t window_animator_open_fade_draw_prev(window_animator_t* wa) {
|
|||||||
|
|
||||||
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
||||||
dst = rect_init(win->x, win->y, win->w, win->h);
|
dst = rect_init(win->x, win->y, win->w, win->h);
|
||||||
#ifndef WITH_NANOVG_GL
|
#ifndef WITH_NANOVG_GPU
|
||||||
if (wa->percent > 0 && !lcd_is_swappable(c->lcd)) {
|
if (wa->percent > 0 && !lcd_is_swappable(c->lcd)) {
|
||||||
win = wa->curr_win;
|
win = wa->curr_win;
|
||||||
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
||||||
dst = rect_init(win->x, win->y, win->w, win->h);
|
dst = rect_init(win->x, win->y, win->w, win->h);
|
||||||
}
|
}
|
||||||
#endif /*WITH_NANOVG_GL*/
|
#endif /*WITH_NANOVG_GPU*/
|
||||||
lcd_draw_image(c->lcd, &(wa->prev_img), &src, &dst);
|
lcd_draw_image(c->lcd, &(wa->prev_img), &src, &dst);
|
||||||
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
@ -41,7 +41,7 @@ static ret_t window_animator_open_fade_draw_curr(window_animator_t* wa) {
|
|||||||
dst = rect_init(win->x, win->y, win->w, win->h);
|
dst = rect_init(win->x, win->y, win->w, win->h);
|
||||||
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
||||||
|
|
||||||
#ifdef WITH_NANOVG_GL
|
#ifdef WITH_NANOVG_GPU
|
||||||
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
||||||
vgcanvas_save(vg);
|
vgcanvas_save(vg);
|
||||||
vgcanvas_set_global_alpha(vg, alpha);
|
vgcanvas_set_global_alpha(vg, alpha);
|
||||||
@ -52,7 +52,7 @@ static ret_t window_animator_open_fade_draw_curr(window_animator_t* wa) {
|
|||||||
global_alpha = alpha * 0xff;
|
global_alpha = alpha * 0xff;
|
||||||
lcd_set_global_alpha(c->lcd, global_alpha);
|
lcd_set_global_alpha(c->lcd, global_alpha);
|
||||||
lcd_draw_image(c->lcd, &(wa->curr_img), &src, &dst);
|
lcd_draw_image(c->lcd, &(wa->curr_img), &src, &dst);
|
||||||
#endif /*WITH_NANOVG_GL*/
|
#endif /*WITH_NANOVG_GPU*/
|
||||||
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ static ret_t window_animator_open_htranslate_draw_prev(window_animator_t* wa) {
|
|||||||
float_t x = win->w * percent;
|
float_t x = win->w * percent;
|
||||||
float_t w = win->w * (1 - percent);
|
float_t w = win->w * (1 - percent);
|
||||||
|
|
||||||
#ifdef WITH_NANOVG_GL
|
#ifdef WITH_NANOVG_GPU
|
||||||
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
||||||
vgcanvas_draw_image(vg, &(wa->prev_img), x * ratio, win->y * ratio, w * ratio, win->h * ratio, 0,
|
vgcanvas_draw_image(vg, &(wa->prev_img), x * ratio, win->y * ratio, w * ratio, win->h * ratio, 0,
|
||||||
win->y, w, win->h);
|
win->y, w, win->h);
|
||||||
@ -41,7 +41,7 @@ static ret_t window_animator_open_htranslate_draw_curr(window_animator_t* wa) {
|
|||||||
float_t x = win->w * (1 - percent);
|
float_t x = win->w * (1 - percent);
|
||||||
float_t w = win->w * percent;
|
float_t w = win->w * percent;
|
||||||
|
|
||||||
#ifdef WITH_NANOVG_GL
|
#ifdef WITH_NANOVG_GPU
|
||||||
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
||||||
vgcanvas_draw_image(vg, &(wa->curr_img), 0, win->y * ratio, w * ratio, win->h * ratio, x, win->y,
|
vgcanvas_draw_image(vg, &(wa->curr_img), 0, win->y * ratio, w * ratio, win->h * ratio, x, win->y,
|
||||||
w, win->h);
|
w, win->h);
|
||||||
|
@ -18,7 +18,7 @@ static ret_t window_animator_open_top_to_bottom_draw_prev(window_animator_t* wa)
|
|||||||
|
|
||||||
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
src = rect_init(win->x * ratio, win->y * ratio, win->w * ratio, win->h * ratio);
|
||||||
dst = rect_init(win->x, win->y, win->w, win->h);
|
dst = rect_init(win->x, win->y, win->w, win->h);
|
||||||
#ifndef WITH_NANOVG_GL
|
#ifndef WITH_NANOVG_GPU
|
||||||
if (wa->percent > 0 && !lcd_is_swappable(c->lcd)) {
|
if (wa->percent > 0 && !lcd_is_swappable(c->lcd)) {
|
||||||
wh_t y = wa->percent * wa->curr_win->h;
|
wh_t y = wa->percent * wa->curr_win->h;
|
||||||
wh_t h = wa->curr_win->h - y;
|
wh_t h = wa->curr_win->h - y;
|
||||||
@ -45,7 +45,7 @@ static ret_t window_animator_open_top_to_bottom_draw_curr(window_animator_t* wa)
|
|||||||
float_t percent = wa->percent;
|
float_t percent = wa->percent;
|
||||||
float_t alpha = percent;
|
float_t alpha = percent;
|
||||||
|
|
||||||
#ifdef WITH_NANOVG_GL
|
#ifdef WITH_NANOVG_GPU
|
||||||
float_t h = win->h * percent;
|
float_t h = win->h * percent;
|
||||||
float_t y = win->h - h;
|
float_t y = win->h - h;
|
||||||
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
||||||
|
@ -18,7 +18,7 @@ static ret_t window_animator_open_vtranslate_draw_prev(window_animator_t* wa) {
|
|||||||
float_t y = curr_win->h * percent;
|
float_t y = curr_win->h * percent;
|
||||||
float_t h = win->h - y;
|
float_t h = win->h - y;
|
||||||
|
|
||||||
#ifdef WITH_NANOVG_GL
|
#ifdef WITH_NANOVG_GPU
|
||||||
float_t ratio = wa->ratio;
|
float_t ratio = wa->ratio;
|
||||||
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
||||||
vgcanvas_draw_image(vg, &(wa->prev_img), win->x * ratio, y * ratio, win->w * ratio, h * ratio,
|
vgcanvas_draw_image(vg, &(wa->prev_img), win->x * ratio, y * ratio, win->w * ratio, h * ratio,
|
||||||
@ -41,7 +41,7 @@ static ret_t window_animator_open_vtranslate_draw_curr(window_animator_t* wa) {
|
|||||||
float_t h = win->h * percent;
|
float_t h = win->h * percent;
|
||||||
float_t y = win->parent->h - h;
|
float_t y = win->parent->h - h;
|
||||||
|
|
||||||
#ifdef WITH_NANOVG_GL
|
#ifdef WITH_NANOVG_GPU
|
||||||
float_t ratio = wa->ratio;
|
float_t ratio = wa->ratio;
|
||||||
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
vgcanvas_t* vg = lcd_get_vgcanvas(c->lcd);
|
||||||
vgcanvas_draw_image(vg, &(wa->curr_img), win->x * ratio, win->y * ratio, win->w * ratio,
|
vgcanvas_draw_image(vg, &(wa->curr_img), win->x * ratio, win->y * ratio, win->w * ratio,
|
||||||
|
Loading…
Reference in New Issue
Block a user