示例#1
0
int
XXorRegion(Region sra, Region srb, Region dr)
{
	GrXorRegion(dr->rid, sra->rid, srb->rid);
#if CLIENTREGIONS
	GR_RECT extents;
	GrGetRegionBox(dr->rid, &extents);
	rectToBox(&extents, &dr->extents);
#endif
	return 0;
}
示例#2
0
int
XIntersectRegion(Region reg1, Region reg2, Region newReg)
{
	GrIntersectRegion(newReg->rid, reg1->rid, reg2->rid);
#if CLIENTREGIONS
	GR_RECT extents;
	GrGetRegionBox(newReg->rid, &extents);
	rectToBox(&extents, &newReg->extents);
#endif
	return 1;
}
示例#3
0
int
XSubtractRegion(Region regM, Region regS, Region regD)
{
	GrSubtractRegion(regD->rid, regM->rid, regS->rid);

#if CLIENTREGIONS
	GR_RECT extents;
	GrGetRegionBox(regD->rid, &extents);
	rectToBox(&extents, &regD->extents);
#endif
	return 1;
}
示例#4
0
static void
GrGetRegionBoxWrapper(void *r)
{
	nxRectInRegionReq *req = r;
	GR_BOOL		   ret_value;
	GR_RECT		   ret_rect;

	ret_value = GrGetRegionBox(req->regionid, &ret_rect);
		
	GsWriteType(current_fd, GrNumGetRegionBox);
	GsWrite(current_fd, &ret_rect, sizeof(ret_rect));
	GsWriteType(current_fd, GrNumGetRegionBox);
	GsWrite(current_fd, &ret_value, sizeof(ret_value));
}
示例#5
0
int
XClipBox(Region r, XRectangle *ret)
{
	GR_RECT rect;

	GrGetRegionBox(r->rid, &rect);

	/* must copy rect since dimensions differ*/
	ret->x = rect.x;
	ret->y = rect.y;
	ret->width = rect.width;
	ret->height = rect.height;
	return 1;
}
示例#6
0
void wxRIRefData::CreateRects( const wxRegion& region )
{
    if (m_rects)
      delete [] m_rects;

    m_rects = 0;
    m_numRects = 0;

    if (region.IsEmpty()) return;

    Region r = (Region) region.GetX11Region();
    if (r)
    {
#if wxUSE_NANOX
        GR_RECT rect;
        GrGetRegionBox(r, & rect);
        m_numRects = 1;
        m_rects = new wxRect[1];
        m_rects[0].x = rect.x;
        m_rects[0].y = rect.y;
        m_rects[0].width = rect.width;
        m_rects[0].height = rect.height;
#else
        m_numRects = r->numRects;
        if (m_numRects)
        {
            m_rects = new wxRect[m_numRects];
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
            for (size_t i=0; i < m_numRects; ++i)
            {
                _XBox &xr = r->rects[i];
                wxRect &wr = m_rects[i];
                wr.x = xr.x1;
                wr.y = xr.y1;
                wr.width = xr.x2-xr.x1;
                wr.height = xr.y2-xr.y1;
            }
        }
#endif
    }
}
示例#7
0
void wxRIRefData::CreateRects( const wxRegion& region )
{
    if (m_rects)
      delete [] m_rects;

    m_rects = 0;
    m_numRects = 0;

    if (region.IsEmpty()) return;

    Region r = (Region) region.GetX11Region();
    if (r)
    {
#if wxUSE_NANOX
        GR_RECT rect;
        GrGetRegionBox(r, & rect);
        m_numRects = 1;
        m_rects = new wxRect[1];
        m_rects[0].x = rect.x;
        m_rects[0].y = rect.y;
        m_rects[0].width = rect.width;
        m_rects[0].height = rect.height;
#else
        m_numRects = r->numRects;
        if (m_numRects)
        {
            m_rects = new wxRect[m_numRects];
            for (size_t i=0; i < m_numRects; ++i)
            {
                _XBox &xr = r->rects[i];
                wxRect &wr = m_rects[i];
                wr.x = xr.x1;
                wr.y = xr.y1;
                wr.width = xr.x2-xr.x1;
                wr.height = xr.y2-xr.y1;
            }
        }
#endif
    }
}
示例#8
0
int
XUnionRectWithRegion(XRectangle *rect, Region source, Region dest)
{
	GR_RECT gr_rect;

	if (!rect->width || !rect->height)
		return 0;

	if (source != dest)
		DPRINTF("XUnionRectWithRegion - Source and dest different FIXME\n");

	/* copy rect since dimensions differ*/
	gr_rect.x = rect->x;
	gr_rect.y = rect->y;
	gr_rect.width = rect->width;
	gr_rect.height = rect->height;

	if (source != dest) {
		/*Region r = XCreateRegion();
		if (!r) return 0;
		//GrUnionRectWithRegion(r->rid, &gr_rect);
		GrSetRectRegionIndirect(r->rid, &gr_rect);
		XUnionRegion(r, source, dest);
		XDestroyRegion(r);*/

		DPRINTF("XUnionRectWithRegion - Source and dest different FIXME\n");
		GrUnionRectWithRegion(dest->rid, &gr_rect);
	} else {
		GrUnionRectWithRegion(dest->rid, &gr_rect);
	}

#if CLIENTREGIONS
	GR_RECT extents;
	/* Get the new extents area */
	GrGetRegionBox(dest->rid, &extents);
	rectToBox(&extents, &dest->extents);
#endif
	return 1;
}