forked from enlightenment/efl
evas-gl-drm: Fix issue with swap mode returning wrong value
Summary: This fixes a crashing issue in evas image cache due to the engine returning an improper swap mode. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
a83bb5e45d
commit
939d221ff1
|
@ -450,6 +450,9 @@ evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth)
|
|||
Render_Engine_Swap_Mode
|
||||
evas_outbuf_buffer_state_get(Outbuf *ob)
|
||||
{
|
||||
/* check for valid output buffer */
|
||||
if (!ob) return MODE_FULL;
|
||||
|
||||
if (ob->swap_mode == MODE_AUTO && _extn_have_buffer_age)
|
||||
{
|
||||
Render_Engine_Swap_Mode swap_mode;
|
||||
|
@ -469,6 +472,29 @@ evas_outbuf_buffer_state_get(Outbuf *ob)
|
|||
|
||||
return swap_mode;
|
||||
}
|
||||
else
|
||||
{
|
||||
int delta;
|
||||
|
||||
delta = (ob->priv.last - ob->priv.curr +
|
||||
(ob->priv.last > ob->priv.last ?
|
||||
0 : ob->priv.num)) % ob->priv.num;
|
||||
|
||||
/* This is the number of frame since last frame */
|
||||
switch (delta)
|
||||
{
|
||||
case 0:
|
||||
return MODE_COPY;
|
||||
case 1:
|
||||
return MODE_DOUBLE;
|
||||
case 2:
|
||||
return MODE_TRIPLE;
|
||||
case 3:
|
||||
return MODE_QUADRUPLE;
|
||||
default:
|
||||
return MODE_FULL;
|
||||
}
|
||||
}
|
||||
|
||||
return ob->swap_mode;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue