glx: Refactor DRI2CopyRegion calls.
I needed to add some code to each one, so it's a good time to make a helper func. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
008f1ab31e
commit
f3f2fb6baa
|
@ -115,55 +115,49 @@ __glXDRIdrawableDestroy(__GLXdrawable * drawable)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
__glXDRIdrawableCopySubBuffer(__GLXdrawable * drawable,
|
copy_box(__GLXdrawable * drawable,
|
||||||
int x, int y, int w, int h)
|
int dst, int src,
|
||||||
|
int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
RegionRec region;
|
RegionRec region;
|
||||||
|
|
||||||
box.x1 = x;
|
box.x1 = x;
|
||||||
box.y1 = private->height - y - h;
|
box.y1 = y;
|
||||||
box.x2 = x + w;
|
box.x2 = x + w;
|
||||||
box.y2 = private->height - y;
|
box.y2 = y + h;
|
||||||
RegionInit(®ion, &box, 0);
|
RegionInit(®ion, &box, 0);
|
||||||
|
|
||||||
DRI2CopyRegion(drawable->pDraw, ®ion,
|
DRI2CopyRegion(drawable->pDraw, ®ion, dst, src);
|
||||||
DRI2BufferFrontLeft, DRI2BufferBackLeft);
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
__glXDRIdrawableCopySubBuffer(__GLXdrawable * drawable,
|
||||||
|
int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
||||||
|
|
||||||
|
copy_box(drawable, x, private->height - y - h,
|
||||||
|
w, h,
|
||||||
|
DRI2BufferFrontLeft, DRI2BufferBackLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
__glXDRIdrawableWaitX(__GLXdrawable * drawable)
|
__glXDRIdrawableWaitX(__GLXdrawable * drawable)
|
||||||
{
|
{
|
||||||
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
||||||
BoxRec box;
|
|
||||||
RegionRec region;
|
|
||||||
|
|
||||||
box.x1 = 0;
|
copy_box(drawable, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft,
|
||||||
box.y1 = 0;
|
0, 0, private->width, private->height);
|
||||||
box.x2 = private->width;
|
|
||||||
box.y2 = private->height;
|
|
||||||
RegionInit(®ion, &box, 0);
|
|
||||||
|
|
||||||
DRI2CopyRegion(drawable->pDraw, ®ion,
|
|
||||||
DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
__glXDRIdrawableWaitGL(__GLXdrawable * drawable)
|
__glXDRIdrawableWaitGL(__GLXdrawable * drawable)
|
||||||
{
|
{
|
||||||
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
||||||
BoxRec box;
|
|
||||||
RegionRec region;
|
|
||||||
|
|
||||||
box.x1 = 0;
|
copy_box(drawable, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft,
|
||||||
box.y1 = 0;
|
0, 0, private->width, private->height);
|
||||||
box.x2 = private->width;
|
|
||||||
box.y2 = private->height;
|
|
||||||
RegionInit(®ion, &box, 0);
|
|
||||||
|
|
||||||
DRI2CopyRegion(drawable->pDraw, ®ion,
|
|
||||||
DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user