예제 #1
0
파일: scene_xrender.cpp 프로젝트: 8l/kwin
void X11XRenderBackend::present(int mask, const QRegion &damage)
{
    if (mask & Scene::PAINT_SCREEN_REGION) {
        // Use the damage region as the clip region for the root window
        XFixesRegion frontRegion(damage);
        xcb_xfixes_set_picture_clip_region(connection(), m_front, frontRegion, 0, 0);
        // copy composed buffer to the root window
        xcb_xfixes_set_picture_clip_region(connection(), buffer(), XCB_XFIXES_REGION_NONE, 0, 0);
        xcb_render_composite(connection(), XCB_RENDER_PICT_OP_SRC, buffer(), XCB_RENDER_PICTURE_NONE,
                             m_front, 0, 0, 0, 0, 0, 0, displayWidth(), displayHeight());
        xcb_xfixes_set_picture_clip_region(connection(), m_front, XCB_XFIXES_REGION_NONE, 0, 0);
        xcb_flush(connection());
    } else {
        // copy composed buffer to the root window
        xcb_render_composite(connection(), XCB_RENDER_PICT_OP_SRC, buffer(), XCB_RENDER_PICTURE_NONE,
                             m_front, 0, 0, 0, 0, 0, 0, displayWidth(), displayHeight());
        xcb_flush(connection());
    }
}
예제 #2
0
/**
 * Change clip-mask in picture to the specified region.
 * @param region   The region.
 * @param picture  The picture.
 * @param x The X coordinate of the origin.
 * @param y The Y coordinate of the origin.
 *
 * Changes clip-mask in picture to the specified @p region
 * and sets the clip origin.  Input and output will be clipped to
 * remain contained within the region.  The clip origin is interpreted
 * relative to the origin of the drawable associated with @p picture.  The
 * region is interpreted relative to the clip origin.  Future changes
 * to region have no effect on the picture clip-mask.
 * @ingroup Ecore_X_Fixes_Group
 */
EAPI void
ecore_x_region_picture_clip_set(Ecore_X_Region  region,
                                Ecore_X_Picture picture,
                                int             x,
                                int             y)
{
   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   CHECK_XCB_CONN;

   if (!_xfixes_avail) return;

#ifdef ECORE_XCB_XFIXES
   xcb_xfixes_set_picture_clip_region(_ecore_xcb_conn, picture, region, x, y);
//   ecore_x_flush();
#endif
}