summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-09 22:11:21 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-09 23:24:18 +0000
commitb76865fa3deff2f44a1158914a124b9c81d67eca (patch)
tree9fe22c2c05f505720f64c06a4811cee80e6bc36a /src
parent981aae104a96b41db88cc381cc7592818f3e1298 (diff)
sna/gen2: Try to avoid creating a bo for solid colours
As we try to use the diffuse/specular and only resort to using a texture operation for convenience in the rare case of a solid mask. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/gen2_render.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 2566be38..8f6a1647 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1100,12 +1100,12 @@ gen2_composite_solid_init(struct sna *sna,
channel->height = 1;
channel->pict_format = PICT_a8r8g8b8;
- channel->bo = sna_render_get_solid(sna, color);
+ channel->bo = NULL;
channel->u.gen2.pixel = color;
channel->scale[0] = channel->scale[1] = 1;
channel->offset[0] = channel->offset[1] = 0;
- return channel->bo != NULL;
+ return TRUE;
}
#define xFixedToDouble(f) pixman_fixed_to_double(f)
@@ -1738,6 +1738,10 @@ gen2_render_composite(struct sna *sna,
tmp->op = PictOpOutReverse;
}
}
+
+ /* convert solid to a texture (pure convenience) */
+ if (tmp->mask.is_solid)
+ tmp->mask.bo = sna_render_get_solid(sna, tmp->mask.u.gen2.pixel);
}
tmp->floats_per_vertex = 2;