radeon/r200: get rid of some unneeded cliprect/scissor code
authorRoland Scheidegger <sroland@vmware.com>
Fri, 27 Jul 2012 01:49:25 +0000 (03:49 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 1 Aug 2012 12:58:38 +0000 (14:58 +0200)
Noone was interested in the number of cliprects, and noone cared
about the intersect result neither. So just nuke this.

src/mesa/drivers/dri/radeon/radeon_common.c
src/mesa/drivers/dri/radeon/radeon_common.h
src/mesa/drivers/dri/radeon/radeon_common_context.c
src/mesa/drivers/dri/radeon/radeon_common_context.h

index a8dfae0192356ab8c7749c53c621469d5711f2bf..c9f9b2078115c0b75d8fde87bac3c5a0ebc17de2 100644 (file)
@@ -67,57 +67,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  * Scissoring
  */
 
-static GLboolean intersect_rect(drm_clip_rect_t * out,
-                               drm_clip_rect_t * a, drm_clip_rect_t * b)
-{
-       *out = *a;
-       if (b->x1 > out->x1)
-               out->x1 = b->x1;
-       if (b->y1 > out->y1)
-               out->y1 = b->y1;
-       if (b->x2 < out->x2)
-               out->x2 = b->x2;
-       if (b->y2 < out->y2)
-               out->y2 = b->y2;
-       if (out->x1 >= out->x2)
-               return GL_FALSE;
-       if (out->y1 >= out->y2)
-               return GL_FALSE;
-       return GL_TRUE;
-}
-
-void radeonRecalcScissorRects(radeonContextPtr radeon)
-{
-       struct gl_context *ctx = radeon->glCtx;
-       drm_clip_rect_t bounds;
-
-       bounds.x1 = 0;
-       bounds.y1 = 0;
-       bounds.x2 = ctx->DrawBuffer->Width;
-       bounds.y2 = ctx->DrawBuffer->Height;
-
-       if (!radeon->state.scissor.numAllocedClipRects) {
-               radeon->state.scissor.numAllocedClipRects = 1;
-               radeon->state.scissor.pClipRects =
-                       MALLOC(sizeof(drm_clip_rect_t));
-
-               if (radeon->state.scissor.pClipRects == NULL) {
-                       radeon->state.scissor.numAllocedClipRects = 0;
-                       return;
-               }
-       }
-
-       radeon->state.scissor.numClipRects = 0;
-       if (intersect_rect(radeon->state.scissor.pClipRects,
-                          &bounds,
-                          &radeon->state.scissor.rect)) {
-               radeon->state.scissor.numClipRects = 1;
-       }
-
-       if (radeon->vtbl.update_scissor)
-          radeon->vtbl.update_scissor(radeon->glCtx);
-}
-
 /**
  * Update cliprects and scissors.
  */
@@ -149,7 +98,7 @@ void radeonSetCliprects(radeonContextPtr radeon)
        }
 
        if (radeon->state.scissor.enabled)
-               radeonRecalcScissorRects(radeon);
+               radeonUpdateScissor(radeon->glCtx);
 
 }
 
@@ -187,7 +136,8 @@ void radeonUpdateScissor( struct gl_context *ctx )
        rmesa->state.scissor.rect.x2 = CLAMP(x2,  min_x, max_x);
        rmesa->state.scissor.rect.y2 = CLAMP(y2,  min_y, max_y);
 
-       radeonRecalcScissorRects( rmesa );
+       if (rmesa->vtbl.update_scissor)
+          rmesa->vtbl.update_scissor(ctx);
 }
 
 /* =============================================================
index 6f9b5b9a40861ed62f3bdf8905c80d152cbb827d..636822faed2cef19282640969685e9f56df14e17 100644 (file)
@@ -6,7 +6,6 @@
 #include "radeon_texture.h"
 
 void radeonUserClear(struct gl_context *ctx, GLuint mask);
-void radeonRecalcScissorRects(radeonContextPtr radeon);
 void radeonSetCliprects(radeonContextPtr radeon);
 void radeonUpdateScissor( struct gl_context *ctx );
 void radeonScissor(struct gl_context* ctx, GLint x, GLint y, GLsizei w, GLsizei h);
index b5fe7cdd04980ea78808f2e78f67ddc8f08277fb..8ea8925d8a208c08b5cb4b09f328be4611adfecf 100644 (file)
@@ -260,10 +260,6 @@ void radeonDestroyContext(__DRIcontext *driContextPriv )
 
        radeon_destroy_atom_list(radeon);
 
-       if (radeon->state.scissor.pClipRects) {
-               FREE(radeon->state.scissor.pClipRects);
-               radeon->state.scissor.pClipRects = 0;
-       }
 #ifdef RADEON_BO_TRACK
        track = fopen("/tmp/tracklog", "w");
        if (track) {
index 11275f8bc5c0c6108deb6269aa4e6bdf324f5db3..5c2389208f1ca031474cff01c2e73f1fd1707a08 100644 (file)
@@ -122,10 +122,6 @@ struct radeon_depthbuffer_state {
 struct radeon_scissor_state {
        drm_clip_rect_t rect;
        GLboolean enabled;
-
-       GLuint numClipRects;    /* Cliprects active */
-       GLuint numAllocedClipRects;     /* Cliprects available */
-       drm_clip_rect_t *pClipRects;
 };
 
 struct radeon_state_atom {