mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 03:58:33 +08:00
fix get_vgcanvas
This commit is contained in:
parent
305a4bf77d
commit
dfb59b190d
@ -161,6 +161,9 @@ bin\demoui
|
||||
|
||||
## 最新动态
|
||||
|
||||
* 2018/09/20
|
||||
* 移植nanovg-agge到stm32和aworks。
|
||||
|
||||
* 2018/09/12-19
|
||||
* 基于agge用纯软件实现nanovg的渲染接口,去掉对cairo/agg/piccaso的依赖,以最少的代码实现vgcanvas的接口。
|
||||
* 完善vgcanvas-nanovg支持基于OpenGL和纯软件两种实现。
|
||||
|
@ -381,12 +381,19 @@ static ret_t lcd_mem_flush(lcd_t* lcd) {
|
||||
}
|
||||
|
||||
static ret_t lcd_mem_end_frame(lcd_t* lcd) {
|
||||
lcd_mem_t* mem = (lcd_mem_t*)lcd;
|
||||
|
||||
if (lcd->draw_mode == LCD_DRAW_OFFLINE) {
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
/*FIXME: Handle ROTATE*/
|
||||
|
||||
if(mem->vgcanvas) {
|
||||
vgcanvas_destroy(mem->vgcanvas);
|
||||
mem->vgcanvas = NULL;
|
||||
}
|
||||
|
||||
if (lcd_is_swappable(lcd)) {
|
||||
return lcd_swap(lcd);
|
||||
} else {
|
||||
@ -400,6 +407,12 @@ static ret_t lcd_mem_end_frame(lcd_t* lcd) {
|
||||
}
|
||||
|
||||
static ret_t lcd_mem_destroy(lcd_t* lcd) {
|
||||
lcd_mem_t* mem = (lcd_mem_t*)lcd;
|
||||
|
||||
if(mem->vgcanvas) {
|
||||
vgcanvas_destroy(mem->vgcanvas);
|
||||
mem->vgcanvas = NULL;
|
||||
}
|
||||
TKMEM_FREE(lcd);
|
||||
|
||||
return RET_OK;
|
||||
|
@ -768,6 +768,8 @@ vgcanvas_t* vgcanvas_create(uint32_t w, uint32_t h, bitmap_format_t format, void
|
||||
nanovg->base.h = h;
|
||||
nanovg->base.vt = &vt;
|
||||
nanovg->base.ratio = 1;
|
||||
nanovg->base.buff = (uint32_t*)data;
|
||||
|
||||
nanovg->vg = nvgCreateAGGE(w, h, f, (uint8_t*)data);
|
||||
|
||||
return &(nanovg->base);
|
||||
|
Loading…
Reference in New Issue
Block a user