From d94fbb4a488986185836464ea28629f8d519f6f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 21 Aug 2009 08:19:00 +0100 Subject: [PATCH] llvmpipe: Start hiding llvmpipe_cached_tile. --- src/gallium/drivers/llvmpipe/lp_quad_blend.c | 5 ++--- src/gallium/drivers/llvmpipe/lp_tile_cache.c | 5 +++-- src/gallium/drivers/llvmpipe/lp_tile_cache.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_quad_blend.c b/src/gallium/drivers/llvmpipe/lp_quad_blend.c index 47b3cd9..ba12322 100644 --- a/src/gallium/drivers/llvmpipe/lp_quad_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_quad_blend.c @@ -66,16 +66,15 @@ blend_run(struct quad_stage *qs, unsigned y0 = quads[0]->input.y0; uint8_t ALIGN16_ATTRIB src[NUM_CHANNELS][TILE_VECTOR_HEIGHT*TILE_VECTOR_WIDTH]; uint8_t ALIGN16_ATTRIB mask[16]; + uint8_t *tile = lp_get_cached_tile(llvmpipe->cbuf_cache[cbuf], x0, y0); uint8_t *dst; - struct llvmpipe_cached_tile *tile - = lp_get_cached_tile(llvmpipe->cbuf_cache[cbuf], x0, y0); assert(nr * QUAD_SIZE == TILE_VECTOR_HEIGHT * TILE_VECTOR_WIDTH); assert(x0 % TILE_VECTOR_WIDTH == 0); assert(y0 % TILE_VECTOR_HEIGHT == 0); - dst = &TILE_PIXEL(tile->data.color, x0 & (TILE_SIZE-1), y0 & (TILE_SIZE-1), 0); + dst = &TILE_PIXEL(tile, x0 & (TILE_SIZE-1), y0 & (TILE_SIZE-1), 0); for (q = 0; q < nr; ++q) { struct quad_header *quad = quads[q]; diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c index c280cfe..2aa3d09 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c @@ -330,7 +330,7 @@ lp_flush_tile_cache(struct llvmpipe_tile_cache *tc) * Get a tile from the cache. * \param x, y position of tile, in pixels */ -struct llvmpipe_cached_tile * +void * lp_find_cached_tile(struct llvmpipe_tile_cache *tc, union tile_address addr ) { @@ -368,7 +368,8 @@ lp_find_cached_tile(struct llvmpipe_tile_cache *tc, } tc->last_tile = tile; - return tile; + + return tile->data.color; } diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.h b/src/gallium/drivers/llvmpipe/lp_tile_cache.h index 147a60b..f0c3fee 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_cache.h +++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.h @@ -127,7 +127,7 @@ extern void lp_tile_cache_clear(struct llvmpipe_tile_cache *tc, const float *rgba, uint clearValue); -extern struct llvmpipe_cached_tile * +extern void * lp_find_cached_tile(struct llvmpipe_tile_cache *tc, union tile_address addr ); @@ -152,14 +152,14 @@ tile_address( unsigned x, /* Quickly retrieve tile if it matches last lookup. */ -static INLINE struct llvmpipe_cached_tile * +static INLINE void * lp_get_cached_tile(struct llvmpipe_tile_cache *tc, int x, int y ) { union tile_address addr = tile_address( x, y, 0, 0, 0 ); if (tc->last_tile->addr.value == addr.value) - return tc->last_tile; + return &tc->last_tile->data.color; return lp_find_cached_tile( tc, addr ); } -- 2.7.4