summaryrefslogtreecommitdiff
path: root/src/cairo-gl-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-07-22 00:01:22 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-07-22 00:01:22 +0100
commitf2f42ec70a626a69f4b29f55f9d1818942bb0b19 (patch)
tree5511a65438d692775a96fb6f6625aa6a67fa4a08 /src/cairo-gl-surface.c
parent9e420f5d0669ec12eaaf7faf4e55642c10b95fb3 (diff)
[gl] Apply pixel sample bias for spans
Diffstat (limited to 'src/cairo-gl-surface.c')
-rw-r--r--src/cairo-gl-surface.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 7ce27a0b..b547e7fc 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -45,6 +45,8 @@ slim_hidden_proto (cairo_gl_surface_create);
#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
+#define BIAS .375
+
static inline float
int_as_float (uint32_t val)
{
@@ -1611,14 +1613,14 @@ _cairo_gl_emit_span_vertex (cairo_gl_surface_span_renderer_t *renderer,
src_attributes = &renderer->setup.src.operand.texture.attributes;
- vertices[v++] = dst_x;
- vertices[v++] = dst_y;
+ vertices[v++] = dst_x + BIAS;
+ vertices[v++] = dst_y + BIAS;
vertices[v++] = int_as_float (alpha << 24);
if (renderer->setup.src.type == OPERAND_TEXTURE) {
double s, t;
- s = dst_x;
- t = dst_y;
+ s = dst_x + BIAS;
+ t = dst_y + BIAS;
cairo_matrix_transform_point (&src_attributes->matrix, &s, &t);
vertices[v++] = s;
vertices[v++] = t;