Пример #1
0
/**
 * Make the union of two regions.
 * @param dest    The destination region.
 * @param source1 The first source region.
 * @param source2 The second source region.
 *
 * Replace the contents of @p dest with the union of @p source1 and
 * @p source2.
 * @ingroup Ecore_X_Fixes_Group
 */
EAPI void
ecore_x_region_combine(Ecore_X_Region dest,
                       Ecore_X_Region source1,
                       Ecore_X_Region source2)
{
   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   CHECK_XCB_CONN;

   if (!_xfixes_avail) return;

#ifdef ECORE_XCB_XFIXES
   xcb_xfixes_union_region(_ecore_xcb_conn, source1, source2, dest);
//   ecore_x_flush();
#endif
}
Пример #2
0
/** 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;
}