summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_clear.h
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2009-10-17 21:32:56 -0700
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-10-17 21:32:56 -0700
commitbb567357bc1366df7115e0daa68c2470e3bf6ba6 (patch)
tree067805d996a91f632dcd083def6032e9c2ad7736 /src/gallium/auxiliary/util/u_clear.h
parentbfd877e4705002d97ee8dba6fe0c1f8676582ab3 (diff)
gallium: Permit surface_copy and surface_fill to be NULL.
Uf. Lots of files touched. Would people with working vega, xorg, dri1, etc. please make sure you are not broken, and fix yourself up if you are. There were only two or three places where the code did not have painful fallbacks, so I would advise st maintainers to find less painful workarounds, or consider overhauling util_surface_copy and util_surface_fill. Per ymanton, darktama, and Dr_Jakob's suggestions, clear has been left as-is. I will not add PIPE_CAP_BLITTER unless it is deemed necessary.
Diffstat (limited to 'src/gallium/auxiliary/util/u_clear.h')
-rw-r--r--src/gallium/auxiliary/util/u_clear.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/util/u_clear.h b/src/gallium/auxiliary/util/u_clear.h
index 7c16b32cf9..1e65a035ae 100644
--- a/src/gallium/auxiliary/util/u_clear.h
+++ b/src/gallium/auxiliary/util/u_clear.h
@@ -32,6 +32,7 @@
#include "pipe/p_context.h"
#include "pipe/p_state.h"
#include "util/u_pack_color.h"
+#include "util/u_rect.h"
/**
@@ -48,13 +49,22 @@ util_clear(struct pipe_context *pipe,
unsigned color;
util_pack_color(rgba, ps->format, &color);
- pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
+ if (pipe->surface_fill) {
+ pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
+ } else {
+ util_surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
+ }
}
if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
struct pipe_surface *ps = framebuffer->zsbuf;
- pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height,
- util_pack_z_stencil(ps->format, depth, stencil));
+ if (pipe->surface_fill) {
+ pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height,
+ util_pack_z_stencil(ps->format, depth, stencil));
+ } else {
+ util_surface_fill(pipe, ps, 0, 0, ps->width, ps->height,
+ util_pack_z_stencil(ps->format, depth, stencil));
+ }
}
}