forked from enlightenment/efl
evas-drm: Add trapping for a canvas below framebuffer size
@bugfix: This adds some safety trapping for trying to create a canvas below the drm framebuffer size. Drm does not support creating a canvas smaller than the framebuffer output, so we will add some trapping to catch that, and internally create the framebuffers to the proper size. Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
bba98a515c
commit
531d6f3515
|
@ -13,6 +13,8 @@ _evas_outbuf_buffer_new(Outbuf *ob, Buffer *buff)
|
|||
{
|
||||
buff->w = ob->w;
|
||||
buff->h = ob->h;
|
||||
if (buff->w < ob->priv.mode.hdisplay) buff->w = ob->priv.mode.hdisplay;
|
||||
if (buff->h < ob->priv.mode.vdisplay) buff->h = ob->priv.mode.vdisplay;
|
||||
|
||||
/* create a dumb framebuffer */
|
||||
if (!evas_drm_framebuffer_create(ob->priv.fd, buff, ob->depth))
|
||||
|
@ -81,6 +83,9 @@ evas_outbuf_setup(Evas_Engine_Info_Drm *info, int w, int h)
|
|||
/* set properties of outbuf */
|
||||
ob->w = w;
|
||||
ob->h = h;
|
||||
if (ob->w < ob->priv.mode.hdisplay) ob->w = ob->priv.mode.hdisplay;
|
||||
if (ob->h < ob->priv.mode.vdisplay) ob->h = ob->priv.mode.vdisplay;
|
||||
|
||||
ob->depth = info->info.depth;
|
||||
ob->rotation = info->info.rotation;
|
||||
ob->destination_alpha = info->info.destination_alpha;
|
||||
|
@ -166,11 +171,15 @@ evas_outbuf_reconfigure(Evas_Engine_Info_Drm *info, Outbuf *ob, int w, int h)
|
|||
{
|
||||
ob->w = w;
|
||||
ob->h = h;
|
||||
if (ob->w < ob->priv.mode.hdisplay) ob->w = ob->priv.mode.hdisplay;
|
||||
if (ob->h < ob->priv.mode.vdisplay) ob->h = ob->priv.mode.vdisplay;
|
||||
}
|
||||
else
|
||||
{
|
||||
ob->w = h;
|
||||
ob->h = w;
|
||||
if (ob->w < ob->priv.mode.vdisplay) ob->w = ob->priv.mode.vdisplay;
|
||||
if (ob->h < ob->priv.mode.hdisplay) ob->h = ob->priv.mode.hdisplay;
|
||||
}
|
||||
|
||||
/* destroy the old buffers */
|
||||
|
|
Loading…
Reference in New Issue