forked from enlightenment/efl
engines: Add a damage_region_set callback
To properly implement EGL_KHR_partial_update we need to know the buffer damage before any drawing operations take place. Add a new callback to software_generic that takes place after combining of surface damage and swap mode when we actually have this available. Note: This means the three copy pasta implementations of EGL_KHR_partial_update scattered around the tree are all wrong. bummer.
This commit is contained in:
parent
20f9acdf19
commit
0c21a926a3
|
@ -97,6 +97,7 @@ _output_setup(int w,
|
|||
evas_buffer_outbuf_buf_rot_get,
|
||||
evas_buffer_outbuf_reconfigure,
|
||||
NULL,
|
||||
NULL,
|
||||
evas_buffer_outbuf_buf_new_region_for_update,
|
||||
evas_buffer_outbuf_buf_push_updated_region,
|
||||
evas_buffer_outbuf_buf_free_region_for_update,
|
||||
|
|
|
@ -26,6 +26,7 @@ _render_engine_setup(Evas_Engine_Info_Drm *info, int w, int h)
|
|||
_outbuf_rotation_get,
|
||||
_outbuf_reconfigure,
|
||||
NULL,
|
||||
NULL,
|
||||
_outbuf_update_region_new,
|
||||
_outbuf_update_region_push,
|
||||
_outbuf_update_region_free,
|
||||
|
|
|
@ -949,6 +949,7 @@ eng_setup(Evas *evas, void *in)
|
|||
evas_outbuf_rot_get,
|
||||
evas_outbuf_reconfigure,
|
||||
evas_outbuf_update_region_first_rect,
|
||||
NULL,
|
||||
evas_outbuf_update_region_new,
|
||||
evas_outbuf_update_region_push,
|
||||
evas_outbuf_update_region_free,
|
||||
|
|
|
@ -45,6 +45,7 @@ evas_render_engine_gl_generic_init(Render_Engine_GL_Generic *re,
|
|||
Outbuf_Get_Rot outbuf_get_rot,
|
||||
Outbuf_Reconfigure outbuf_reconfigure,
|
||||
Outbuf_Region_First_Rect outbuf_region_first_rect,
|
||||
Outbuf_Damage_Region_Set outbuf_damage_region_set,
|
||||
Outbuf_New_Region_For_Update outbuf_new_region_for_update,
|
||||
Outbuf_Push_Updated_Region outbuf_push_updated_region,
|
||||
Outbuf_Free_Region_For_Update outbuf_free_region_for_update,
|
||||
|
@ -64,6 +65,7 @@ evas_render_engine_gl_generic_init(Render_Engine_GL_Generic *re,
|
|||
outbuf_get_rot,
|
||||
outbuf_reconfigure,
|
||||
outbuf_region_first_rect,
|
||||
outbuf_damage_region_set,
|
||||
outbuf_new_region_for_update,
|
||||
outbuf_push_updated_region,
|
||||
outbuf_free_region_for_update,
|
||||
|
|
|
@ -1721,6 +1721,7 @@ eng_setup(Evas *eo_e, void *in)
|
|||
eng_outbuf_get_rot,
|
||||
eng_outbuf_reconfigure,
|
||||
eng_outbuf_region_first_rect,
|
||||
NULL,
|
||||
eng_outbuf_new_region_for_update,
|
||||
eng_outbuf_push_updated_region,
|
||||
eng_outbuf_push_free_region_for_update,
|
||||
|
|
|
@ -46,6 +46,7 @@ typedef struct _Outbuf Outbuf;
|
|||
typedef Render_Engine_Swap_Mode (*Outbuf_Swap_Mode_Get)(Outbuf *ob);
|
||||
typedef void (*Outbuf_Reconfigure)(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth);
|
||||
typedef Eina_Bool (*Outbuf_Region_First_Rect)(Outbuf *ob);
|
||||
typedef void (*Outbuf_Damage_Region_Set)(Outbuf *ob, Tilebuf_Rect *rects);
|
||||
typedef void *(*Outbuf_New_Region_For_Update)(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
|
||||
typedef void (*Outbuf_Push_Updated_Region)(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
|
||||
typedef void (*Outbuf_Idle_Flush)(Outbuf *ob);
|
||||
|
@ -66,6 +67,7 @@ struct _Render_Engine_Software_Generic
|
|||
Outbuf_Get_Rot outbuf_get_rot;
|
||||
Outbuf_Reconfigure outbuf_reconfigure;
|
||||
Outbuf_Region_First_Rect outbuf_region_first_rect;
|
||||
Outbuf_Damage_Region_Set outbuf_damage_region_set;
|
||||
Outbuf_New_Region_For_Update outbuf_new_region_for_update;
|
||||
Outbuf_Push_Updated_Region outbuf_push_updated_region;
|
||||
Outbuf_Idle_Flush outbuf_idle_flush;
|
||||
|
@ -90,6 +92,7 @@ evas_render_engine_software_generic_init(Render_Engine_Software_Generic *re,
|
|||
Outbuf_Get_Rot outbuf_get_rot,
|
||||
Outbuf_Reconfigure outbuf_reconfigure,
|
||||
Outbuf_Region_First_Rect outbuf_region_first_rect,
|
||||
Outbuf_Damage_Region_Set outbuf_damage_region_set,
|
||||
Outbuf_New_Region_For_Update outbuf_new_region_for_update,
|
||||
Outbuf_Push_Updated_Region outbuf_push_updated_region,
|
||||
Outbuf_Free_Region_For_Update outbuf_free_region_for_update,
|
||||
|
@ -105,6 +108,7 @@ evas_render_engine_software_generic_init(Render_Engine_Software_Generic *re,
|
|||
re->outbuf_get_rot = outbuf_get_rot;
|
||||
re->outbuf_reconfigure = outbuf_reconfigure;
|
||||
re->outbuf_region_first_rect = outbuf_region_first_rect;
|
||||
re->outbuf_damage_region_set = outbuf_damage_region_set;
|
||||
re->outbuf_new_region_for_update = outbuf_new_region_for_update;
|
||||
re->outbuf_push_updated_region = outbuf_push_updated_region;
|
||||
re->outbuf_idle_flush = outbuf_idle_flush;
|
||||
|
|
|
@ -3951,6 +3951,8 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
|
|||
}
|
||||
evas_common_tilebuf_clear(re->tb);
|
||||
re->cur_rect = EINA_INLIST_GET(re->rects);
|
||||
if (re->cur_rect && re->outbuf_damage_region_set)
|
||||
re->outbuf_damage_region_set(re->ob, re->rects);
|
||||
}
|
||||
if (!re->cur_rect) return NULL;
|
||||
rect = (Tilebuf_Rect *)re->cur_rect;
|
||||
|
|
|
@ -180,6 +180,7 @@ _output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw,
|
|||
evas_software_xlib_outbuf_get_rot,
|
||||
evas_software_xlib_outbuf_reconfigure,
|
||||
NULL,
|
||||
NULL,
|
||||
evas_software_xlib_outbuf_new_region_for_update,
|
||||
evas_software_xlib_outbuf_push_updated_region,
|
||||
evas_software_xlib_outbuf_free_region_for_update,
|
||||
|
@ -240,6 +241,7 @@ _output_swapbuf_setup(int w, int h, int rot, Display *disp, Drawable draw,
|
|||
evas_software_xlib_swapbuf_get_rot,
|
||||
evas_software_xlib_swapbuf_reconfigure,
|
||||
NULL,
|
||||
NULL,
|
||||
evas_software_xlib_swapbuf_new_region_for_update,
|
||||
evas_software_xlib_swapbuf_push_updated_region,
|
||||
evas_software_xlib_swapbuf_free_region_for_update,
|
||||
|
@ -297,6 +299,7 @@ _output_xcb_setup(int w, int h, int rot, xcb_connection_t *conn,
|
|||
evas_software_xcb_outbuf_rotation_get,
|
||||
evas_software_xcb_outbuf_reconfigure,
|
||||
NULL,
|
||||
NULL,
|
||||
evas_software_xcb_outbuf_new_region_for_update,
|
||||
evas_software_xcb_outbuf_push_updated_region,
|
||||
evas_software_xcb_outbuf_free_region_for_update,
|
||||
|
|
|
@ -591,6 +591,7 @@ eng_setup(Evas *evas, void *info)
|
|||
eng_outbuf_rotation_get,
|
||||
eng_outbuf_reconfigure,
|
||||
eng_outbuf_region_first_rect,
|
||||
NULL,
|
||||
eng_outbuf_update_region_new,
|
||||
eng_outbuf_update_region_push,
|
||||
eng_outbuf_update_region_free,
|
||||
|
|
|
@ -117,6 +117,7 @@ void eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth dept
|
|||
int eng_outbuf_rotation_get(Outbuf *ob);
|
||||
Render_Engine_Swap_Mode eng_outbuf_swap_mode_get(Outbuf *ob);
|
||||
Eina_Bool eng_outbuf_region_first_rect(Outbuf *ob);
|
||||
void eng_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage);
|
||||
void *eng_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
|
||||
void eng_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update);
|
||||
void eng_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
|
||||
|
|
|
@ -48,7 +48,8 @@ _render_engine_swapbuf_setup(int w, int h, Evas_Engine_Info_Wayland_Shm *einfo)
|
|||
_evas_outbuf_swap_mode_get,
|
||||
_evas_outbuf_rotation_get,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
_evas_outbuf_update_region_new,
|
||||
_evas_outbuf_update_region_push,
|
||||
_evas_outbuf_update_region_free,
|
||||
|
|
Loading…
Reference in New Issue