dri: Remove cliprect information from __DRIdrawable
authorKristian Høgsberg <krh@bitplanet.net>
Fri, 28 Oct 2011 19:40:01 +0000 (15:40 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 2 Nov 2011 15:16:00 +0000 (11:16 -0400)
src/gallium/state_trackers/dri/drm/dri2.c
src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/common/dri_util.h
src/mesa/drivers/dri/common/spantmp_common.h
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/r200/r200_swtcl.c
src/mesa/drivers/dri/radeon/radeon_common_context.c
src/mesa/drivers/dri/radeon/radeon_state.c

index e96440482157dd3584ed91666610d04e0c02c790..d3db0ccda5194cc2de917f06a448fe701ff2bcda 100644 (file)
@@ -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;
 }
index 945c85c06a6c88ba23c48eff52f97640746078df..6d78f82ce398e02665dda4ff6e4cf94b7fc5a290 100644 (file)
@@ -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);
     }
 }
index 817d77d9f7a52ede0a36a0dca5f6a97cb2928d57..e4dc623d4d63e466e1409a13b6be7511d81bcec7 100644 (file)
@@ -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;
 };
 
index a4509a569d5ae1a4cd1c8c43a52e783c5608b79e..8916e7b0ca3a4543a4074888540789d62232bb24 100644 (file)
 #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
 
index 501b00d8ab2c62ad28796413e6a10e36ba207ee3..6190396205cb7d6f8f1536199926379c24766a7d 100644 (file)
@@ -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:
index 7f9bc2d9eddd4aeae233b175d4868aa0a0ee0f83..49f66fb6f46c89c898d9f380971713d441412e35 100644 (file)
@@ -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) |
index 62034eb0e45d934d6adfbb828b12e8be26bbaf5a..303d3fbe459fcc0ff214c1dc46289b0e9736e1a0 100644 (file)
@@ -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?
     */
index e47e655ec2e4d0fca27b4b64396999ba2f989e9e..437f780c2f1522ea6b0194811501fff98e117381 100644 (file)
@@ -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:
index a025a8d665da98bc9eea83b78151e0d6dcaa399e..a207940e526ddae10343aae83e146b7c133f4263 100644 (file)
@@ -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) |