diff options
author | Brian <[email protected]> | 2007-12-15 16:44:29 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-12-15 16:44:29 -0700 |
commit | 263e8f057290961c9dd603ffa69f25a7a253301a (patch) | |
tree | 3798e5a3ddf1012fb8ab5fa1f6355a4a801d4032 /src/mesa/pipe/i915simple | |
parent | bccc4c5c0116987041dec2327ddb43eff1bcfadf (diff) |
Use tile functions in new p_tile.[ch]
This removes quite a bit of code duplicated in the drivers.
Diffstat (limited to 'src/mesa/pipe/i915simple')
-rw-r--r-- | src/mesa/pipe/i915simple/i915_surface.c | 92 |
1 files changed, 5 insertions, 87 deletions
diff --git a/src/mesa/pipe/i915simple/i915_surface.c b/src/mesa/pipe/i915simple/i915_surface.c index d4c02c53595..34064612a72 100644 --- a/src/mesa/pipe/i915simple/i915_surface.c +++ b/src/mesa/pipe/i915simple/i915_surface.c @@ -33,89 +33,7 @@ #include "pipe/p_util.h" #include "pipe/p_inlines.h" #include "pipe/p_winsys.h" - -#include "pipe/softpipe/sp_rgba_tile.h" /* XXX TEMPORARY */ - - -#define CLIP_TILE \ - do { \ - if (x >= ps->width) \ - return; \ - if (y >= ps->height) \ - return; \ - if (x + w > ps->width) \ - w = ps->width - x; \ - if (y + h > ps->height) \ - h = ps->height -y; \ - } while(0) - - -/* - * XXX note: same as code in sp_surface.c - */ -static void -i915_get_tile(struct pipe_context *pipe, - struct pipe_surface *ps, - uint x, uint y, uint w, uint h, - void *p, int dst_stride) -{ - const uint cpp = ps->cpp; - const uint w0 = w; - const ubyte *pSrc; - ubyte *pDest; - uint i; - - assert(ps->map); - - CLIP_TILE; - - if (dst_stride == 0) { - dst_stride = w0 * cpp; - } - - pSrc = ps->map + (y * ps->pitch + x) * cpp; - pDest = (ubyte *) p; - - for (i = 0; i < h; i++) { - memcpy(pDest, pSrc, w0 * cpp); - pDest += dst_stride; - pSrc += ps->pitch * cpp; - } -} - - -/* - * XXX note: same as code in sp_surface.c - */ -static void -i915_put_tile(struct pipe_context *pipe, - struct pipe_surface *ps, - uint x, uint y, uint w, uint h, - const void *p, int src_stride) -{ - const uint cpp = ps->cpp; - const uint w0 = w; - const ubyte *pSrc; - ubyte *pDest; - uint i; - - assert(ps->map); - - CLIP_TILE; - - if (src_stride == 0) { - src_stride = w0 * cpp; - } - - pSrc = (const ubyte *) p; - pDest = ps->map + (y * ps->pitch + x) * cpp; - - for (i = 0; i < h; i++) { - memcpy(pDest, pSrc, w0 * cpp); - pDest += ps->pitch * cpp; - pSrc += src_stride; - } -} +#include "pipe/util/p_tile.h" /* @@ -323,10 +241,10 @@ void i915_init_surface_functions(struct i915_context *i915) { i915->pipe.get_tex_surface = i915_get_tex_surface; - i915->pipe.get_tile = i915_get_tile; - i915->pipe.put_tile = i915_put_tile; - i915->pipe.get_tile_rgba = softpipe_get_tile_rgba; - i915->pipe.put_tile_rgba = softpipe_put_tile_rgba; + i915->pipe.get_tile = pipe_get_tile_raw; + i915->pipe.put_tile = pipe_put_tile_raw; + i915->pipe.get_tile_rgba = pipe_get_tile_rgba; + i915->pipe.put_tile_rgba = pipe_put_tile_rgba; i915->pipe.surface_data = i915_surface_data; i915->pipe.surface_copy = i915_surface_copy; |