Mesa (master): util/blitter: allow NULL clear color
Marek Olšák
mareko at kemper.freedesktop.org
Sun May 23 17:02:17 UTC 2010
Module: Mesa
Branch: master
Commit: fa552261ea1795503d051864af6cdf05cb7197ae
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa552261ea1795503d051864af6cdf05cb7197ae
Author: Marek Olšák <maraeo at gmail.com>
Date: Sun May 23 19:00:56 2010 +0200
util/blitter: allow NULL clear color
---
src/gallium/auxiliary/util/u_blitter.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index e0bd891..c2d1af3 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -371,11 +371,20 @@ static void blitter_set_clear_color(struct blitter_context_priv *ctx,
{
int i;
- for (i = 0; i < 4; i++) {
- ctx->vertices[i][1][0] = rgba[0];
- ctx->vertices[i][1][1] = rgba[1];
- ctx->vertices[i][1][2] = rgba[2];
- ctx->vertices[i][1][3] = rgba[3];
+ if (rgba) {
+ for (i = 0; i < 4; i++) {
+ ctx->vertices[i][1][0] = rgba[0];
+ ctx->vertices[i][1][1] = rgba[1];
+ ctx->vertices[i][1][2] = rgba[2];
+ ctx->vertices[i][1][3] = rgba[3];
+ }
+ } else {
+ for (i = 0; i < 4; i++) {
+ ctx->vertices[i][1][0] = 0;
+ ctx->vertices[i][1][1] = 0;
+ ctx->vertices[i][1][2] = 0;
+ ctx->vertices[i][1][3] = 0;
+ }
}
}
More information about the mesa-commit
mailing list