main: Refactor _mesa_update_draw_buffer_bounds.
authorLaura Ekstrand <laura@jlekstrand.net>
Tue, 3 Feb 2015 22:41:26 +0000 (14:41 -0800)
committerFredrik Höglund <fredrik@kde.org>
Thu, 14 May 2015 13:48:14 +0000 (15:48 +0200)
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
src/mesa/drivers/dri/i915/i830_vtbl.c
src/mesa/drivers/dri/i915/i915_vtbl.c
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/radeon/radeon_common.c
src/mesa/drivers/dri/radeon/radeon_state.c
src/mesa/main/framebuffer.c
src/mesa/main/framebuffer.h
src/mesa/main/state.c

index 4fff29e..8ed8ff5 100644 (file)
@@ -732,7 +732,7 @@ i830_update_draw_buffer(struct intel_context *intel)
       /* this updates the DrawBuffer->_NumColorDrawBuffers fields, etc */
       _mesa_update_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer);
       /* this updates the DrawBuffer's Width/Height if it's a FBO */
-      _mesa_update_draw_buffer_bounds(ctx);
+      _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
    }
 
    if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
index 02ff312..80bd249 100644 (file)
@@ -734,7 +734,7 @@ i915_update_draw_buffer(struct intel_context *intel)
       /* this updates the DrawBuffer->_NumColorDrawBuffers fields, etc */
       _mesa_update_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer);
       /* this updates the DrawBuffer's Width/Height if it's a FBO */
-      _mesa_update_draw_buffer_bounds(ctx);
+      _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
    }
 
    if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
index de5296d..6fe70b5 100644 (file)
@@ -2217,7 +2217,7 @@ GLboolean r200ValidateState( struct gl_context *ctx )
    if (new_state & _NEW_BUFFERS) {
       _mesa_update_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer);
       /* this updates the DrawBuffer's Width/Height if it's a FBO */
-      _mesa_update_draw_buffer_bounds(ctx);
+      _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
 
       R200_STATECHANGE(rmesa, ctx);
    }
index 12502d5..2a8bd6c 100644 (file)
@@ -222,7 +222,7 @@ void radeon_draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb)
                /* this updates the DrawBuffer->_NumColorDrawBuffers fields, etc */
                _mesa_update_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer);
                /* this updates the DrawBuffer's Width/Height if it's a FBO */
-               _mesa_update_draw_buffer_bounds(ctx);
+               _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
        }
 
        if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
index 7bff1d4..cba3d9c 100644 (file)
@@ -1996,7 +1996,7 @@ GLboolean radeonValidateState( struct gl_context *ctx )
    if (new_state & _NEW_BUFFERS) {
      _mesa_update_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer);
      /* this updates the DrawBuffer's Width/Height if it's a FBO */
-     _mesa_update_draw_buffer_bounds(ctx);
+     _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
      RADEON_STATECHANGE(rmesa, ctx);
    }
 
index 5c409db..0a0f73b 100644 (file)
@@ -312,7 +312,7 @@ _mesa_resize_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
 
    if (ctx) {
       /* update scissor / window bounds */
-      _mesa_update_draw_buffer_bounds(ctx);
+      _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
       /* Signal new buffer state so that swrast will update its clipping
        * info (the CLIP_BIT flag).
        */
@@ -413,9 +413,9 @@ _mesa_scissor_bounding_box(const struct gl_context *ctx,
  * \param ctx  the GL context.
  */
 void
-_mesa_update_draw_buffer_bounds(struct gl_context *ctx)
+_mesa_update_draw_buffer_bounds(struct gl_context *ctx,
+                                struct gl_framebuffer *buffer)
 {
-   struct gl_framebuffer *buffer = ctx->DrawBuffer;
    int bbox[4];
 
    if (!buffer)
index d3b7e58..d02b86f 100644 (file)
@@ -77,7 +77,8 @@ _mesa_scissor_bounding_box(const struct gl_context *ctx,
                            unsigned idx, int *bbox);
 
 extern void 
-_mesa_update_draw_buffer_bounds(struct gl_context *ctx);
+_mesa_update_draw_buffer_bounds(struct gl_context *ctx,
+                                struct gl_framebuffer *drawFb);
 
 extern void
 _mesa_update_framebuffer_visual(struct gl_context *ctx,
index 3688736..2657c53 100644 (file)
@@ -392,7 +392,7 @@ _mesa_update_state_locked( struct gl_context *ctx )
       _mesa_update_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer);
 
    if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
-      _mesa_update_draw_buffer_bounds( ctx );
+      _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
 
    if (new_state & _NEW_LIGHT)
       _mesa_update_lighting( ctx );