/* local functions */ static void * _output_setup(Evas_Engine_Info_Drm *info, int w, int h) { Render_Engine *re = NULL; Outbuf *ob; /* try to allocate space for our render engine structure */ if (!(re = calloc(1, sizeof(Render_Engine)))) goto on_error; /* try to create new outbuf */ if (!(ob = evas_outbuf_setup(info, w, h))) goto on_error; if (!evas_render_engine_software_generic_init(&re->generic, ob, evas_outbuf_buffer_state_get, evas_outbuf_rot_get, evas_outbuf_reconfigure, NULL, evas_outbuf_update_region_new, evas_outbuf_update_region_push, evas_outbuf_update_region_free, NULL, evas_outbuf_flush, evas_outbuf_free, ob->w, ob->h)) goto on_error; /* return the allocated render_engine structure */ return re; on_error: if (re) evas_render_engine_software_generic_clean(&re->generic); free(re); return NULL; }
static void * _output_xcb_setup(int w, int h, int rot, xcb_connection_t *conn, xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, int depth, int debug, int grayscale, int max_colors, xcb_drawable_t mask, int shape_dither, int destination_alpha) { Render_Engine *re; Outbuf *ob; if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; evas_software_xcb_init(); evas_software_xcb_color_init(); evas_software_xcb_outbuf_init(); ob = evas_software_xcb_outbuf_setup(w, h, rot, OUTBUF_DEPTH_INHERIT, conn, screen, draw, vis, cmap, depth, grayscale, max_colors, mask, shape_dither, destination_alpha); if (!ob) goto on_error; /* for updates return 1 big buffer, but only use portions of it, also cache * it and keepit around until an idle_flush */ /* disable for now - i am hunting down why some expedite tests are slower, * as well as shaped stuff is broken and probable non-32bpp is broken as * convert funcs dont do the right thing * */ // re->ob->onebuf = 1; evas_software_xcb_outbuf_debug_set(ob, debug); if (!evas_render_engine_software_generic_init(&re->generic, ob, NULL, evas_software_xcb_outbuf_rotation_get, evas_software_xcb_outbuf_reconfigure, NULL, evas_software_xcb_outbuf_new_region_for_update, evas_software_xcb_outbuf_push_updated_region, evas_software_xcb_outbuf_free_region_for_update, evas_software_xcb_outbuf_idle_flush, evas_software_xcb_outbuf_flush, evas_software_xcb_outbuf_free, w, h)) goto on_error; return re; on_error: if (ob) evas_software_xcb_outbuf_free(ob); free(re); return NULL; }
/* LOCAL FUNCTIONS */ Render_Engine * _render_engine_swapbuf_setup(int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface, struct wl_display *disp) { Render_Engine *re; Outbuf *ob; Render_Engine_Merge_Mode merge_mode = MERGE_SMART; const char *s; LOGFN(__FILE__, __LINE__, __FUNCTION__); /* try to allocate space for new render engine */ if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; ob = _evas_outbuf_setup(w, h, rotation, depth, alpha, shm, surface, disp); if (!ob) goto err; if (!evas_render_engine_software_generic_init(&re->generic, ob, _evas_outbuf_swap_mode_get, _evas_outbuf_rotation_get, NULL, NULL, _evas_outbuf_update_region_new, _evas_outbuf_update_region_push, _evas_outbuf_update_region_free, _evas_outbuf_idle_flush, _evas_outbuf_flush, _evas_outbuf_free, w, h)) goto err; re->outbuf_reconfigure = _evas_outbuf_reconfigure; s = getenv("EVAS_WAYLAND_PARTIAL_MERGE"); if (s) { if ((!strcmp(s, "bounding")) || (!strcmp(s, "b"))) merge_mode = MERGE_BOUNDING; else if ((!strcmp(s, "full")) || (!strcmp(s, "f"))) merge_mode = MERGE_FULL; else if ((!strcmp(s, "smart")) || (!strcmp(s, "s"))) merge_mode = MERGE_SMART; } evas_render_engine_software_generic_merge_mode_set(&re->generic, merge_mode); /* return allocated render engine */ return re; err: if (ob) _evas_outbuf_free(ob); free(re); return NULL; }
/* local functions */ static void * _output_engine_setup(Evas_Engine_Info_Wayland_Shm *info, int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool destination_alpha, struct wl_shm *wl_shm, struct wl_surface *wl_surface) { Render_Engine *re = NULL; Outbuf *ob; LOGFN(__FILE__, __LINE__, __FUNCTION__); /* try to allocate a new render engine */ if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; ob = evas_swapbuf_setup(info, w, h, rotation, depth, destination_alpha, wl_shm, wl_surface); if (!ob) goto on_error; if (!evas_render_engine_software_generic_init(&re->generic, ob, evas_swapbuf_state_get, evas_swapbuf_rotation_get, NULL, NULL, evas_swapbuf_update_region_new, evas_swapbuf_update_region_push, evas_swapbuf_update_region_free, evas_swapbuf_idle_flush, evas_swapbuf_flush, evas_swapbuf_free, w, h)) goto on_error; re->outbuf_reconfigure = evas_swapbuf_reconfigure; /* return allocated render engine */ return re; on_error: if (ob) evas_swapbuf_free(ob); free(re); return NULL; }
static void * _output_swapbuf_setup(int w, int h, int rot, Display *disp, Drawable draw, Visual *vis, Colormap cmap, int depth, int debug EINA_UNUSED, int grayscale, int max_colors, Pixmap mask, int shape_dither, int destination_alpha) { Render_Engine *re; Outbuf *ob; if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; evas_software_xlib_x_init(); evas_software_xlib_x_color_init(); evas_software_xlib_swapbuf_init(); ob = evas_software_xlib_swapbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, disp, draw, vis, cmap, depth, grayscale, max_colors, mask, shape_dither, destination_alpha); if (!ob) goto on_error; if (!evas_render_engine_software_generic_init(&re->generic, ob, evas_software_xlib_swapbuf_buffer_state_get, evas_software_xlib_swapbuf_get_rot, evas_software_xlib_swapbuf_reconfigure, NULL, evas_software_xlib_swapbuf_new_region_for_update, evas_software_xlib_swapbuf_push_updated_region, evas_software_xlib_swapbuf_free_region_for_update, evas_software_xlib_swapbuf_idle_flush, evas_software_xlib_swapbuf_flush, evas_software_xlib_swapbuf_free, w, h)) goto on_error; return re; on_error: if (ob) evas_software_xlib_swapbuf_free(ob); free(re); return NULL; }
/* LOCAL FUNCTIONS */ Render_Engine * _render_engine_swapbuf_setup(int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface) { Render_Engine *re; Outbuf *ob; LOGFN(__FILE__, __LINE__, __FUNCTION__); /* try to allocate space for new render engine */ if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; ob = _evas_outbuf_setup(w, h, rotation, depth, alpha, shm, surface); if (!ob) goto err; if (!evas_render_engine_software_generic_init(&re->generic, ob, _evas_outbuf_swapmode_get, _evas_outbuf_rotation_get, NULL, NULL, _evas_outbuf_update_region_new, _evas_outbuf_update_region_push, _evas_outbuf_update_region_free, _evas_outbuf_idle_flush, _evas_outbuf_flush, _evas_outbuf_free, w, h)) goto err; re->outbuf_reconfigure = _evas_outbuf_reconfigure; /* return allocated render engine */ return re; err: if (ob) _evas_outbuf_free(ob); free(re); return NULL; }
static void * _output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw, Visual *vis, Colormap cmap, int depth, int debug, int grayscale, int max_colors, Pixmap mask, int shape_dither, int destination_alpha) { Render_Engine *re; Outbuf *ob; Render_Engine_Merge_Mode merge_mode = MERGE_SMART; const char *s; if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; evas_software_xlib_x_init(); evas_software_xlib_x_color_init(); evas_software_xlib_outbuf_init(); ob = evas_software_xlib_outbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, disp, draw, vis, cmap, depth, grayscale, max_colors, mask, shape_dither, destination_alpha); if (!ob) goto on_error; /* for updates return 1 big buffer, but only use portions of it, also cache * it and keepit around until an idle_flush */ /* disable for now - i am hunting down why some expedite tests are slower, * as well as shaped stuff is broken and probable non-32bpp is broken as * convert funcs dont do the right thing * */ // re->ob->onebuf = 1; evas_software_xlib_outbuf_debug_set(ob, debug); if (!evas_render_engine_software_generic_init(&re->generic, ob, NULL, evas_software_xlib_outbuf_get_rot, evas_software_xlib_outbuf_reconfigure, NULL, evas_software_xlib_outbuf_new_region_for_update, evas_software_xlib_outbuf_push_updated_region, evas_software_xlib_outbuf_free_region_for_update, evas_software_xlib_outbuf_idle_flush, evas_software_xlib_outbuf_flush, evas_software_xlib_outbuf_free, w, h)) goto on_error; if ((s = getenv("EVAS_SOFTWARE_PARTIAL_MERGE"))) { if ((!strcmp(s, "bounding")) || (!strcmp(s, "b"))) merge_mode = MERGE_BOUNDING; else if ((!strcmp(s, "full")) || (!strcmp(s, "f"))) merge_mode = MERGE_FULL; else if ((!strcmp(s, "smart")) || (!strcmp(s, "s"))) merge_mode = MERGE_SMART; } evas_render_engine_software_generic_merge_mode_set(&re->generic, merge_mode); return re; on_error: if (ob) evas_software_xlib_outbuf_free(ob); free(re); return NULL; }