Mesa (master): mesa: make _mesa_update_depth/stencil_buffer() static

Brian Paul brianp at kemper.freedesktop.org
Tue Oct 11 17:44:54 PDT 2011


Module: Mesa
Branch: master
Commit: 7aab0fbaa6ec41c720bed6cfcb53a50c2a646a26
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7aab0fbaa6ec41c720bed6cfcb53a50c2a646a26

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Oct 10 21:00:01 2011 -0600

mesa: make _mesa_update_depth/stencil_buffer() static

These functions were only called in framebuffer.c where they were defined.
Remove the unneeded attIndex parameter too.

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/main/framebuffer.c |   34 ++++++++++------------------------
 src/mesa/main/framebuffer.h |    8 --------
 2 files changed, 10 insertions(+), 32 deletions(-)

diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 42da176..8beda31 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -608,19 +608,12 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
  * create and install a depth wrapper/adaptor.
  *
  * \param fb  the framebuffer whose _DepthBuffer field to update
- * \param attIndex  indicates the renderbuffer to possibly wrap
  */
-void
-_mesa_update_depth_buffer(struct gl_context *ctx,
-                          struct gl_framebuffer *fb,
-                          GLuint attIndex)
+static void
+update_depth_buffer(struct gl_context *ctx, struct gl_framebuffer *fb)
 {
-   struct gl_renderbuffer *depthRb;
-
-   /* only one possiblity for now */
-   ASSERT(attIndex == BUFFER_DEPTH);
-
-   depthRb = fb->Attachment[attIndex].Renderbuffer;
+   struct gl_renderbuffer *depthRb =
+      fb->Attachment[BUFFER_DEPTH].Renderbuffer;
 
    if (depthRb && _mesa_is_format_packed_depth_stencil(depthRb->Format)) {
       /* The attached depth buffer is a GL_DEPTH_STENCIL renderbuffer */
@@ -655,19 +648,12 @@ _mesa_update_depth_buffer(struct gl_context *ctx,
  * create and install a stencil wrapper/adaptor.
  *
  * \param fb  the framebuffer whose _StencilBuffer field to update
- * \param attIndex  indicates the renderbuffer to possibly wrap
  */
-void
-_mesa_update_stencil_buffer(struct gl_context *ctx,
-                            struct gl_framebuffer *fb,
-                            GLuint attIndex)
+static void
+update_stencil_buffer(struct gl_context *ctx, struct gl_framebuffer *fb)
 {
-   struct gl_renderbuffer *stencilRb;
-
-   ASSERT(attIndex == BUFFER_DEPTH ||
-          attIndex == BUFFER_STENCIL);
-
-   stencilRb = fb->Attachment[attIndex].Renderbuffer;
+   struct gl_renderbuffer *stencilRb =
+      fb->Attachment[BUFFER_STENCIL].Renderbuffer;
 
    if (stencilRb && _mesa_is_format_packed_depth_stencil(stencilRb->Format)) {
       /* The attached stencil buffer is a GL_DEPTH_STENCIL renderbuffer */
@@ -826,8 +812,8 @@ update_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
     */
    update_color_draw_buffers(ctx, fb);
    update_color_read_buffer(ctx, fb);
-   _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH);
-   _mesa_update_stencil_buffer(ctx, fb, BUFFER_STENCIL);
+   update_depth_buffer(ctx, fb);
+   update_stencil_buffer(ctx, fb);
 
    compute_depth_max(fb);
 }
diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h
index 7aef3e0..ad53d8c 100644
--- a/src/mesa/main/framebuffer.h
+++ b/src/mesa/main/framebuffer.h
@@ -82,14 +82,6 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
 				struct gl_framebuffer *fb);
 
 extern void
-_mesa_update_depth_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,
-                            GLuint attIndex);
-
-extern void
-_mesa_update_stencil_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,
-                            GLuint attIndex);
-
-extern void
 _mesa_update_framebuffer(struct gl_context *ctx);
 
 extern GLboolean



More information about the mesa-commit mailing list