diff options
author | Brian Paul <[email protected]> | 2010-05-03 17:08:17 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-05-03 17:08:17 -0600 |
commit | 1fc5a318a64b10567ed6990eb04b2dc3ecb2b347 (patch) | |
tree | f03aa1377fc76b1af358c7f5b246de554cc3260e /src/gallium/auxiliary/util/u_surface.c | |
parent | d8306c9caf3190f2bca6b83c653cd4711c25f98a (diff) |
gallium: move framebuffer utility functions into a new file
Diffstat (limited to 'src/gallium/auxiliary/util/u_surface.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_surface.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index 42440d0d673..35a9b484fc6 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -114,74 +114,3 @@ util_destroy_rgba_surface(struct pipe_resource *texture, pipe_surface_reference(&surface, NULL); pipe_resource_reference(&texture, NULL); } - - - -/** - * Compare pipe_framebuffer_state objects. - * \return TRUE if same, FALSE if different - */ -boolean -util_framebuffer_state_equal(const struct pipe_framebuffer_state *dst, - const struct pipe_framebuffer_state *src) -{ - unsigned i; - - if (dst->width != src->width || - dst->height != src->height) - return FALSE; - - for (i = 0; i < Elements(src->cbufs); i++) { - if (dst->cbufs[i] != src->cbufs[i]) { - return FALSE; - } - } - - if (dst->nr_cbufs != src->nr_cbufs) { - return FALSE; - } - - if (dst->zsbuf != src->zsbuf) { - return FALSE; - } - - return TRUE; -} - - -/** - * Copy framebuffer state from src to dst, updating refcounts. - */ -void -util_copy_framebuffer_state(struct pipe_framebuffer_state *dst, - const struct pipe_framebuffer_state *src) -{ - unsigned i; - - dst->width = src->width; - dst->height = src->height; - - for (i = 0; i < Elements(src->cbufs); i++) { - pipe_surface_reference(&dst->cbufs[i], src->cbufs[i]); - } - - dst->nr_cbufs = src->nr_cbufs; - - pipe_surface_reference(&dst->zsbuf, src->zsbuf); -} - - -void -util_unreference_framebuffer_state(struct pipe_framebuffer_state *fb) -{ - unsigned i; - - for (i = 0; i < fb->nr_cbufs; i++) { - pipe_surface_reference(&fb->cbufs[i], NULL); - } - - pipe_surface_reference(&fb->zsbuf, NULL); - - fb->width = fb->height = 0; - fb->nr_cbufs = 0; -} |