@@ -158,25 +158,8 @@ dri2_drawable_get_buffers(struct dri_drawable *drawable, | |||
&num_buffers, dri_drawable->loaderPrivate); | |||
} | |||
if (buffers) { | |||
/* set one cliprect to cover the whole dri_drawable */ | |||
dri_drawable->x = 0; | |||
dri_drawable->y = 0; | |||
dri_drawable->backX = 0; | |||
dri_drawable->backY = 0; | |||
dri_drawable->numClipRects = 1; | |||
dri_drawable->pClipRects[0].x1 = 0; | |||
dri_drawable->pClipRects[0].y1 = 0; | |||
dri_drawable->pClipRects[0].x2 = dri_drawable->w; | |||
dri_drawable->pClipRects[0].y2 = dri_drawable->h; | |||
dri_drawable->numBackClipRects = 1; | |||
dri_drawable->pBackClipRects[0].x1 = 0; | |||
dri_drawable->pBackClipRects[0].y1 = 0; | |||
dri_drawable->pBackClipRects[0].x2 = dri_drawable->w; | |||
dri_drawable->pBackClipRects[0].y2 = dri_drawable->h; | |||
if (buffers) | |||
*count = num_buffers; | |||
} | |||
return buffers; | |||
} |
@@ -175,14 +175,8 @@ dri2CreateNewDrawable(__DRIscreen *screen, | |||
pdraw->pStamp = NULL; | |||
pdraw->lastStamp = 0; | |||
pdraw->index = 0; | |||
pdraw->x = 0; | |||
pdraw->y = 0; | |||
pdraw->w = 0; | |||
pdraw->h = 0; | |||
pdraw->numClipRects = 0; | |||
pdraw->numBackClipRects = 0; | |||
pdraw->pClipRects = NULL; | |||
pdraw->pBackClipRects = NULL; | |||
pdraw->vblSeq = 0; | |||
pdraw->vblFlags = 0; | |||
@@ -201,9 +195,6 @@ dri2CreateNewDrawable(__DRIscreen *screen, | |||
*/ | |||
pdraw->swap_interval = (unsigned)-1; | |||
pdraw->pClipRects = &pdraw->dri2.clipRect; | |||
pdraw->pBackClipRects = &pdraw->dri2.clipRect; | |||
pdraw->pStamp = &pdraw->dri2.stamp; | |||
*pdraw->pStamp = pdraw->lastStamp + 1; | |||
@@ -277,14 +268,6 @@ static void dri_put_drawable(__DRIdrawable *pdp) | |||
psp = pdp->driScreenPriv; | |||
(*psp->DriverAPI.DestroyBuffer)(pdp); | |||
if (pdp->pClipRects && pdp->pClipRects != &pdp->dri2.clipRect) { | |||
free(pdp->pClipRects); | |||
pdp->pClipRects = NULL; | |||
} | |||
if (pdp->pBackClipRects && pdp->pClipRects != &pdp->dri2.clipRect) { | |||
free(pdp->pBackClipRects); | |||
pdp->pBackClipRects = NULL; | |||
} | |||
free(pdp); | |||
} | |||
} |
@@ -218,32 +218,7 @@ struct __DRIdrawableRec { | |||
*/ | |||
unsigned int lastStamp; | |||
/** | |||
* \name Drawable | |||
* | |||
* Drawable information used in software fallbacks. | |||
*/ | |||
/*@{*/ | |||
int x; | |||
int y; | |||
int w; | |||
int h; | |||
int numClipRects; | |||
drm_clip_rect_t *pClipRects; | |||
/*@}*/ | |||
/** | |||
* \name Back and depthbuffer | |||
* | |||
* Information about the back and depthbuffer where different from above. | |||
*/ | |||
/*@{*/ | |||
int backX; | |||
int backY; | |||
int backClipRectType; | |||
int numBackClipRects; | |||
drm_clip_rect_t *pBackClipRects; | |||
/*@}*/ | |||
int w, h; | |||
/** | |||
* \name Vertical blank tracking information | |||
@@ -289,7 +264,6 @@ struct __DRIdrawableRec { | |||
struct { | |||
unsigned int stamp; | |||
drm_clip_rect_t clipRect; | |||
} dri2; | |||
}; | |||
@@ -49,17 +49,14 @@ | |||
#ifndef HW_CLIPLOOP | |||
#define HW_CLIPLOOP() \ | |||
do { \ | |||
int _nc = dPriv->numClipRects; \ | |||
while ( _nc-- ) { \ | |||
int minx = dPriv->pClipRects[_nc].x1 - dPriv->x; \ | |||
int miny = dPriv->pClipRects[_nc].y1 - dPriv->y; \ | |||
int maxx = dPriv->pClipRects[_nc].x2 - dPriv->x; \ | |||
int maxy = dPriv->pClipRects[_nc].y2 - dPriv->y; | |||
int minx = 0; \ | |||
int miny = 0; \ | |||
int maxx = dPriv->w; \ | |||
int maxy = dPriv->h; | |||
#endif | |||
#ifndef HW_ENDCLIPLOOP | |||
#define HW_ENDCLIPLOOP() \ | |||
} \ | |||
} while (0) | |||
#endif | |||
@@ -311,21 +311,6 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) | |||
if (buffers == NULL) | |||
return; | |||
drawable->x = 0; | |||
drawable->y = 0; | |||
drawable->backX = 0; | |||
drawable->backY = 0; | |||
drawable->numClipRects = 1; | |||
drawable->pClipRects[0].x1 = 0; | |||
drawable->pClipRects[0].y1 = 0; | |||
drawable->pClipRects[0].x2 = drawable->w; | |||
drawable->pClipRects[0].y2 = drawable->h; | |||
drawable->numBackClipRects = 1; | |||
drawable->pBackClipRects[0].x1 = 0; | |||
drawable->pBackClipRects[0].y1 = 0; | |||
drawable->pBackClipRects[0].x2 = drawable->w; | |||
drawable->pBackClipRects[0].y2 = drawable->h; | |||
for (i = 0; i < count; i++) { | |||
switch (buffers[i].attachment) { | |||
case __DRI_BUFFER_FRONT_LEFT: |
@@ -1570,8 +1570,8 @@ void r200UpdateWindow( struct gl_context *ctx ) | |||
{ | |||
r200ContextPtr rmesa = R200_CONTEXT(ctx); | |||
__DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon); | |||
GLfloat xoffset = dPriv ? (GLfloat) dPriv->x : 0; | |||
GLfloat yoffset = dPriv ? (GLfloat) dPriv->y + dPriv->h : 0; | |||
GLfloat xoffset = 0; | |||
GLfloat yoffset = dPriv ? (GLfloat) dPriv->h : 0; | |||
const GLfloat *v = ctx->Viewport._WindowMap.m; | |||
const GLboolean render_to_fbo = (ctx->DrawBuffer ? (ctx->DrawBuffer->Name != 0) : 0); | |||
const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF; | |||
@@ -1650,8 +1650,8 @@ void r200UpdateViewportOffset( struct gl_context *ctx ) | |||
{ | |||
r200ContextPtr rmesa = R200_CONTEXT(ctx); | |||
__DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon); | |||
GLfloat xoffset = (GLfloat)dPriv->x; | |||
GLfloat yoffset = (GLfloat)dPriv->y + dPriv->h; | |||
GLfloat xoffset = (GLfloat)0; | |||
GLfloat yoffset = (GLfloat)dPriv->h; | |||
const GLfloat *v = ctx->Viewport._WindowMap.m; | |||
float_ui32_type tx; | |||
@@ -1679,8 +1679,8 @@ void r200UpdateViewportOffset( struct gl_context *ctx ) | |||
R200_STIPPLE_Y_OFFSET_MASK); | |||
/* add magic offsets, then invert */ | |||
stx = 31 - ((dPriv->x - 1) & R200_STIPPLE_COORD_MASK); | |||
sty = 31 - ((dPriv->y + dPriv->h - 1) | |||
stx = 31 - ((-1) & R200_STIPPLE_COORD_MASK); | |||
sty = 31 - ((dPriv->h - 1) | |||
& R200_STIPPLE_COORD_MASK); | |||
m |= ((stx << R200_STIPPLE_X_OFFSET_SHIFT) | |
@@ -850,8 +850,7 @@ r200PointsBitmap( struct gl_context *ctx, GLint px, GLint py, | |||
/* Update window height | |||
*/ | |||
h = radeon_get_drawable(&rmesa->radeon)->h + radeon_get_drawable(&rmesa->radeon)->y; | |||
px += radeon_get_drawable(&rmesa->radeon)->x; | |||
h = radeon_get_drawable(&rmesa->radeon)->h; | |||
/* Clipping handled by existing mechansims in r200_ioctl.c? | |||
*/ |
@@ -538,21 +538,6 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable, | |||
if (buffers == NULL) | |||
return; | |||
/* set one cliprect to cover the whole drawable */ | |||
drawable->x = 0; | |||
drawable->y = 0; | |||
drawable->backX = 0; | |||
drawable->backY = 0; | |||
drawable->numClipRects = 1; | |||
drawable->pClipRects[0].x1 = 0; | |||
drawable->pClipRects[0].y1 = 0; | |||
drawable->pClipRects[0].x2 = drawable->w; | |||
drawable->pClipRects[0].y2 = drawable->h; | |||
drawable->numBackClipRects = 1; | |||
drawable->pBackClipRects[0].x1 = 0; | |||
drawable->pBackClipRects[0].y1 = 0; | |||
drawable->pBackClipRects[0].x2 = drawable->w; | |||
drawable->pBackClipRects[0].y2 = drawable->h; | |||
for (i = 0; i < count; i++) { | |||
switch (buffers[i].attachment) { | |||
case __DRI_BUFFER_FRONT_LEFT: |
@@ -1376,8 +1376,8 @@ void radeonUpdateWindow( struct gl_context *ctx ) | |||
{ | |||
r100ContextPtr rmesa = R100_CONTEXT(ctx); | |||
__DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon); | |||
GLfloat xoffset = dPriv ? (GLfloat) dPriv->x : 0; | |||
GLfloat yoffset = dPriv ? (GLfloat) dPriv->y + dPriv->h : 0; | |||
GLfloat xoffset = 0.0; | |||
GLfloat yoffset = dPriv ? (GLfloat) dPriv->h : 0; | |||
const GLfloat *v = ctx->Viewport._WindowMap.m; | |||
const GLboolean render_to_fbo = (ctx->DrawBuffer ? (ctx->DrawBuffer->Name != 0) : 0); | |||
const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF; | |||
@@ -1431,8 +1431,8 @@ void radeonUpdateViewportOffset( struct gl_context *ctx ) | |||
{ | |||
r100ContextPtr rmesa = R100_CONTEXT(ctx); | |||
__DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon); | |||
GLfloat xoffset = (GLfloat)dPriv->x; | |||
GLfloat yoffset = (GLfloat)dPriv->y + dPriv->h; | |||
GLfloat xoffset = 0.0; | |||
GLfloat yoffset = (GLfloat)dPriv->h; | |||
const GLfloat *v = ctx->Viewport._WindowMap.m; | |||
float_ui32_type tx; | |||
@@ -1460,8 +1460,8 @@ void radeonUpdateViewportOffset( struct gl_context *ctx ) | |||
RADEON_STIPPLE_Y_OFFSET_MASK); | |||
/* add magic offsets, then invert */ | |||
stx = 31 - ((dPriv->x - 1) & RADEON_STIPPLE_COORD_MASK); | |||
sty = 31 - ((dPriv->y + dPriv->h - 1) | |||
stx = 31 - ((-1) & RADEON_STIPPLE_COORD_MASK); | |||
sty = 31 - ((dPriv->h - 1) | |||
& RADEON_STIPPLE_COORD_MASK); | |||
m |= ((stx << RADEON_STIPPLE_X_OFFSET_SHIFT) | |