summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-09-25 15:48:14 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-09-25 15:48:14 -0600
commit02ea8b81414b50936b8b6b7b8031511e12ef55cd (patch)
tree61ece69f744367cdbcf24c35b62ab7a129554150 /src
parentb5051bf6bbe54269c78f4dd545791e51bc7ce9e0 (diff)
re-org/prep for glBitmap
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 619c5d8ab7..c30d4ede4a 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -30,7 +30,8 @@
* Brian Paul
*/
-#include "imports.h"
+#include "main/imports.h"
+#include "main/image.h"
#include "st_context.h"
#include "st_atom.h"
@@ -59,12 +60,6 @@ make_fragment_shader(struct st_context *st)
GLcontext *ctx = st->ctx;
struct st_fragment_program *stfp;
struct gl_program *p;
- GLuint interpMode[16];
- GLuint i;
-
- /* XXX temporary */
- for (i = 0; i < 16; i++)
- interpMode[i] = TGSI_INTERPOLATE_LINEAR;
p = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
if (!p)
@@ -297,13 +292,11 @@ draw_quad(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z,
static void
draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
- GLsizei width, GLsizei height, GLenum format, GLenum type,
- const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels)
+ GLsizei width, GLsizei height,
+ struct pipe_mipmap_tree *mt)
{
const GLuint unit = 0;
struct pipe_context *pipe = ctx->st->pipe;
- struct pipe_mipmap_tree *mt;
GLfloat x0, y0, x1, y1;
GLuint maxWidth, maxHeight;
@@ -377,8 +370,6 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
/* mipmap tree state: */
{
- mt = make_mipmap_tree(ctx->st, width, height, format, type,
- unpack, pixels);
pipe->set_texture_state(pipe, unit, mt);
}
@@ -401,8 +392,6 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
pipe->set_texture_state(pipe, unit, ctx->st->state.texture[unit]);
pipe->bind_sampler_state(pipe, unit, ctx->st->state.sampler[unit]->data);
pipe->set_viewport_state(pipe, &ctx->st->state.viewport);
-
- free_mipmap_tree(pipe, mt);
}
@@ -547,8 +536,12 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
any_pixel_transfer_ops(st) ||
!compatible_formats(format, type, ps->format)) {
/* textured quad */
- draw_textured_quad(ctx, x, y, ctx->Current.RasterPos[2], width, height,
- format, type, unpack, pixels);
+ struct pipe_mipmap_tree *mt
+ = make_mipmap_tree(ctx->st, width, height, format, type,
+ unpack, pixels);
+ draw_textured_quad(ctx, x, y, ctx->Current.RasterPos[2],
+ width, height, mt);
+ free_mipmap_tree(st->pipe, mt);
}
else {
/* blit */