/** * Copy the content of a region. * @param dest The destination region. * @param source The source region. * * Replace the contents of @p dest with the contents of @p source. * @ingroup Ecore_X_Fixes_Group */ EAPI void ecore_x_region_copy(Ecore_X_Region dest, Ecore_X_Region source) { LOGFN(__FILE__, __LINE__, __FUNCTION__); CHECK_XCB_CONN; if (!_xfixes_avail) return; // NB: Hmmmm...this may need converting to/fro xcb_rectangle_t #ifdef ECORE_XCB_XFIXES xcb_xfixes_copy_region(_ecore_xcb_conn, source, dest); // ecore_x_flush(); #endif }
/** Add the given Region to the damaged Region by either copying it if * the global Damaged is currently empty or adding it otherwise * * @todo: Perhaps the copy of the region could be avoided if it * really impacts on performances, but for now this does not * seem to be an issue * * \param region Damaged Region to be added to the global one */ void display_add_damaged_region(xcb_xfixes_region_t *region, bool do_destroy_region) { if(!*region) return; if(globalconf.damaged) { xcb_xfixes_union_region(globalconf.connection, globalconf.damaged, *region, globalconf.damaged); debug("Added %x to damaged region %x", *region, globalconf.damaged); if(do_destroy_region) xcb_xfixes_destroy_region(globalconf.connection, *region); } else { /* If the region should not be destroyed, then copy the given Region as it is generally the Window Region and can still be used later on whereas the damaged Region is cleared at each painting iteration */ if(!do_destroy_region) { globalconf.damaged = xcb_generate_id(globalconf.connection); xcb_xfixes_create_region(globalconf.connection, globalconf.damaged, 0, NULL); xcb_xfixes_copy_region(globalconf.connection, *region, globalconf.damaged); } else globalconf.damaged = *region; debug("Initialized damaged region to %x (copied: %d)", globalconf.damaged, !do_destroy_region); } if(do_destroy_region) *region = XCB_NONE; }