st/mesa: remove dependencies on code in st_cb_readpixels.c
authorBrian Paul <brianp@vmware.com>
Sat, 12 Nov 2011 18:50:32 +0000 (11:50 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 15 Nov 2011 14:49:26 +0000 (07:49 -0700)
st_cb_readpixels.c is going away next.

Acked-by: Eric Anholt <eric@anholt.net>
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/state_tracker/st_cb_readpixels.h

index 5714d343d57c0b66605b2a75b67647b80e892e44..95805fd3c05111e1d3df05685a13ea7d983eae3b 100644 (file)
@@ -38,6 +38,7 @@
 #include "main/mtypes.h"
 #include "main/pack.h"
 #include "main/pbo.h"
+#include "main/readpix.h"
 #include "main/texformat.h"
 #include "main/teximage.h"
 #include "main/texstore.h"
@@ -1189,9 +1190,9 @@ copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
       rbDraw = st_renderbuffer(rbDraw->Base.Wrapped);
 
    /* this will do stencil pixel transfer ops */
-   st_read_stencil_pixels(ctx, srcx, srcy, width, height,
-                          GL_STENCIL_INDEX, GL_UNSIGNED_BYTE,
-                          &ctx->DefaultPacking, buffer);
+   _mesa_readpixels(ctx, srcx, srcy, width, height,
+                    GL_STENCIL_INDEX, GL_UNSIGNED_BYTE,
+                    &ctx->DefaultPacking, buffer);
 
    if (0) {
       /* debug code: dump stencil values */
@@ -1296,6 +1297,20 @@ copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
 }
 
 
+/**
+ * Return renderbuffer to use for reading color pixels for glCopyPixels
+ */
+static struct st_renderbuffer *
+st_get_color_read_renderbuffer(struct gl_context *ctx)
+{
+   struct gl_framebuffer *fb = ctx->ReadBuffer;
+   struct st_renderbuffer *strb =
+      st_renderbuffer(fb->_ColorReadBuffer);
+
+   return strb;
+}
+
+
 /** Do the src/dest regions overlap? */
 static GLboolean
 regions_overlap(GLint srcX, GLint srcY, GLint dstX, GLint dstY,
index 0c68e02fc87a2cfcd53b99e34507020fe590f248..f11d6dbe7409ea6adce94b34cf816273e106f2f7 100644 (file)
@@ -195,7 +195,7 @@ st_read_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
  * Return renderbuffer to use for reading color pixels for glRead/CopyPixel
  * commands.
  */
-struct st_renderbuffer *
+static struct st_renderbuffer *
 st_get_color_read_renderbuffer(struct gl_context *ctx)
 {
    struct gl_framebuffer *fb = ctx->ReadBuffer;
index 9622ae6feea17ac734aca51b0fb0a1eee19e401a..cbfe3f2eee71db34c1ff834b51832b9cd2efeb2c 100644 (file)
@@ -35,9 +35,6 @@ struct dd_function_table;
 struct gl_context;
 struct gl_pixelstore_attrib;
 
-extern struct st_renderbuffer *
-st_get_color_read_renderbuffer(struct gl_context *ctx);
-
 extern void
 st_read_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
                        GLsizei width, GLsizei height,