forked from enlightenment/efl
gl_x11: Do KHR Partial Damage properly
KHR partial damage must be set once at the beginning of rendering with buffer damage for the entire scene to be rendered. Doing otherwise can result in graphical anomalies on some GL implementations.
This commit is contained in:
parent
d29bb3bbec
commit
1809b3b959
|
@ -1751,7 +1751,11 @@ eng_setup(Evas *eo_e, void *in)
|
||||||
eng_outbuf_get_rot,
|
eng_outbuf_get_rot,
|
||||||
eng_outbuf_reconfigure,
|
eng_outbuf_reconfigure,
|
||||||
eng_outbuf_region_first_rect,
|
eng_outbuf_region_first_rect,
|
||||||
|
#ifdef GL_GLES
|
||||||
|
eng_outbuf_damage_region_set,
|
||||||
|
#else
|
||||||
NULL,
|
NULL,
|
||||||
|
#endif
|
||||||
eng_outbuf_new_region_for_update,
|
eng_outbuf_new_region_for_update,
|
||||||
eng_outbuf_push_updated_region,
|
eng_outbuf_push_updated_region,
|
||||||
eng_outbuf_push_free_region_for_update,
|
eng_outbuf_push_free_region_for_update,
|
||||||
|
|
|
@ -187,6 +187,9 @@ void eng_gl_context_use(Context_3D *context);
|
||||||
void eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth);
|
void eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth);
|
||||||
int eng_outbuf_get_rot(Outbuf *ob);
|
int eng_outbuf_get_rot(Outbuf *ob);
|
||||||
Render_Engine_Swap_Mode eng_outbuf_swap_mode(Outbuf *ob);
|
Render_Engine_Swap_Mode eng_outbuf_swap_mode(Outbuf *ob);
|
||||||
|
#ifdef GL_GLES
|
||||||
|
void eng_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage);
|
||||||
|
#endif
|
||||||
Eina_Bool eng_outbuf_region_first_rect(Outbuf *ob);
|
Eina_Bool eng_outbuf_region_first_rect(Outbuf *ob);
|
||||||
void *eng_outbuf_new_region_for_update(Outbuf *ob,
|
void *eng_outbuf_new_region_for_update(Outbuf *ob,
|
||||||
int x, int y, int w, int h,
|
int x, int y, int w, int h,
|
||||||
|
|
|
@ -1479,20 +1479,24 @@ _convert_to_glcoords(int *result, Outbuf *ob, int x, int y, int w, int h)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
_set_damage_rect(Outbuf *ob, int x, int y, int w, int h)
|
eng_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage)
|
||||||
{
|
{
|
||||||
int rects[4];
|
if (glsym_eglSetDamageRegionKHR)
|
||||||
|
|
||||||
if ((x==0) && (y==0) &&
|
|
||||||
(((w == ob->gl_context->w) && (h == ob->gl_context->h))
|
|
||||||
|| ((h == ob->gl_context->w) && (w == ob->gl_context->h))))
|
|
||||||
{
|
{
|
||||||
return;
|
Tilebuf_Rect *tr;
|
||||||
}
|
int *rect, *rects, count;
|
||||||
|
|
||||||
_convert_to_glcoords(rects, ob, x, y, w, h);
|
count = eina_inlist_count(EINA_INLIST_GET(damage));
|
||||||
glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], rects, 1);
|
rects = alloca(sizeof(int) * 4 * count);
|
||||||
|
rect = rects;
|
||||||
|
EINA_INLIST_FOREACH(damage, tr)
|
||||||
|
{
|
||||||
|
_convert_to_glcoords(rect, ob, tr->x, tr->y, tr->w, tr->h);
|
||||||
|
rect += 4;
|
||||||
|
}
|
||||||
|
glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], rects, count);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1513,10 +1517,6 @@ eng_outbuf_new_region_for_update(Outbuf *ob,
|
||||||
ob->gl_context->master_clip.y = y;
|
ob->gl_context->master_clip.y = y;
|
||||||
ob->gl_context->master_clip.w = w;
|
ob->gl_context->master_clip.w = w;
|
||||||
ob->gl_context->master_clip.h = h;
|
ob->gl_context->master_clip.h = h;
|
||||||
#ifdef GL_GLES
|
|
||||||
if (glsym_eglSetDamageRegionKHR)
|
|
||||||
_set_damage_rect(ob, x, y, w, h);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return ob->gl_context->def_surface;
|
return ob->gl_context->def_surface;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue