diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-08-13 16:07:11 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-08-13 16:23:44 +0100 |
commit | 40a86b20478024ca7c55400019c536cb5ff631d1 (patch) | |
tree | 624d3f33b07dfba4328b0c7746af5f58fd496292 /src/mesa/pipe/i915simple/i915_surface.c | |
parent | d46779103b38aeab61701759ed7a0b30cc71c0ef (diff) |
Start breaking the #include dependencies between pipe drivers and mesa.
Pipe drivers shouldn't really know much about mesa and certainly shouldn't
be #including files from src/mesa/main and the like.
I've also (in i915simple especially) moved over from GL types to
more conventional int/unsigned usage. This probably isn't really the
ultimate desired set of types to use - possibly C99 would be better. It
may even be that a subset of the GL types is preferable.
Diffstat (limited to 'src/mesa/pipe/i915simple/i915_surface.c')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_surface.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mesa/pipe/i915simple/i915_surface.c b/src/mesa/pipe/i915simple/i915_surface.c index cc0a87012a..c094cf9ec4 100644 --- a/src/mesa/pipe/i915simple/i915_surface.c +++ b/src/mesa/pipe/i915simple/i915_surface.c @@ -28,8 +28,8 @@ #include "i915_context.h" #include "i915_state.h" #include "pipe/p_defines.h" -#include "main/imports.h" -#include "main/macros.h" +#include "pipe/p_util.h" +//#include "main/imports.h" struct i915_surface @@ -45,13 +45,13 @@ struct i915_surface */ static void i915_get_tile(struct pipe_surface *ps, - GLuint x, GLuint y, GLuint w, GLuint h, GLfloat *p) + unsigned x, unsigned y, unsigned w, unsigned h, float *p) { - const GLuint *src - = ((const GLuint *) (ps->region->map + ps->offset)) + const unsigned *src + = ((const unsigned *) (ps->region->map + ps->offset)) + y * ps->region->pitch + x; - GLuint i, j; - GLuint w0 = w; + unsigned i, j; + unsigned w0 = w; assert(ps->format == PIPE_FORMAT_U_A8_R8_G8_B8); @@ -66,9 +66,9 @@ i915_get_tile(struct pipe_surface *ps, h = ps->height -y; #endif for (i = 0; i < h; i++) { - GLfloat *pRow = p; + float *pRow = p; for (j = 0; j < w; j++) { - const GLuint pixel = src[j]; + const unsigned pixel = src[j]; pRow[0] = UBYTE_TO_FLOAT((pixel >> 16) & 0xff); pRow[1] = UBYTE_TO_FLOAT((pixel >> 8) & 0xff); pRow[2] = UBYTE_TO_FLOAT((pixel >> 0) & 0xff); @@ -83,7 +83,7 @@ i915_get_tile(struct pipe_surface *ps, static void i915_put_tile(struct pipe_surface *ps, - GLuint x, GLuint y, GLuint w, GLuint h, const GLfloat *p) + unsigned x, unsigned y, unsigned w, unsigned h, const float *p) { /* any need to put tiles into i915 surfaces? */ assert(0); @@ -92,7 +92,7 @@ i915_put_tile(struct pipe_surface *ps, static struct pipe_surface * -i915_surface_alloc(struct pipe_context *pipe, GLuint format) +i915_surface_alloc(struct pipe_context *pipe, unsigned format) { struct i915_surface *surf = CALLOC_STRUCT(i915_surface); |