fix(layer): use provided buf stride directly
In case of externally provided draw buffer, it already has its own stride parameter set. Use it directly Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
committed by
Gabor Kiss-Vamosi
parent
61367fcd5f
commit
9278c42c9b
@@ -391,7 +391,7 @@ void * lv_draw_layer_alloc_buf(lv_layer_t * layer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*Set the stride also for static allocated buffers as well as for new dynamically allocated*/
|
/*Set the stride also for static allocated buffers as well as for new dynamically allocated*/
|
||||||
layer->buf_stride = stride;
|
if(layer->buf_stride == 0) layer->buf_stride = stride;
|
||||||
|
|
||||||
/*Make sure the buffer address is aligned in case of already allocated buffers*/
|
/*Make sure the buffer address is aligned in case of already allocated buffers*/
|
||||||
return lv_draw_buf_align(layer->buf, layer->color_format);
|
return lv_draw_buf_align(layer->buf, layer->color_format);
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ void lv_canvas_init_layer(lv_obj_t * obj, lv_layer_t * layer)
|
|||||||
layer->color_format = header->cf;
|
layer->color_format = header->cf;
|
||||||
layer->buf_area = canvas_area;
|
layer->buf_area = canvas_area;
|
||||||
layer->_clip_area = canvas_area;
|
layer->_clip_area = canvas_area;
|
||||||
layer->buf_stride = lv_draw_buf_width_to_stride(lv_area_get_width(&layer->buf_area), layer->color_format);
|
layer->buf_stride = header->stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_canvas_finish_layer(lv_obj_t * canvas, lv_layer_t * layer)
|
void lv_canvas_finish_layer(lv_obj_t * canvas, lv_layer_t * layer)
|
||||||
|
|||||||
Reference in New Issue
Block a user