summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cairo-gl-composite.c26
-rw-r--r--src/cairo-gl-private.h2
2 files changed, 10 insertions, 18 deletions
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index 6eb8f495..4b8fcdc3 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -188,24 +188,6 @@ _cairo_gl_create_gradient_texture (cairo_gl_surface_t *dst,
glBindBufferARB (GL_PIXEL_UNPACK_BUFFER_ARB, 0);
- glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- switch (pattern->base.extend) {
- case CAIRO_EXTEND_NONE:
- glTexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
- break;
- case CAIRO_EXTEND_PAD:
- glTexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- break;
- case CAIRO_EXTEND_REPEAT:
- glTexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- break;
- case CAIRO_EXTEND_REFLECT:
- glTexParameteri (GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
- break;
- }
-
_cairo_gl_context_release (ctx);
return CAIRO_STATUS_SUCCESS;
}
@@ -336,6 +318,8 @@ _cairo_gl_gradient_operand_init (cairo_gl_operand_t *operand,
operand->linear.segment_x = x1 - x0;
operand->linear.segment_y = y1 - y0;
+ operand->linear.extend = pattern->extend;
+
operand->type = CAIRO_GL_OPERAND_LINEAR_GRADIENT;
return CAIRO_STATUS_SUCCESS;
} else {
@@ -370,6 +354,8 @@ _cairo_gl_gradient_operand_init (cairo_gl_operand_t *operand,
operand->radial.radius_0 = r0;
operand->radial.radius_1 = r1;
+ operand->radial.extend = pattern->extend;
+
operand->type = CAIRO_GL_OPERAND_RADIAL_GRADIENT;
return CAIRO_STATUS_SUCCESS;
}
@@ -779,11 +765,15 @@ _cairo_gl_context_setup_operand (cairo_gl_context_t *ctx,
case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
glActiveTexture (GL_TEXTURE0 + tex_unit);
glBindTexture (GL_TEXTURE_1D, operand->linear.tex);
+ _cairo_gl_texture_set_extend (ctx, GL_TEXTURE_1D, operand->linear.extend);
+ _cairo_gl_texture_set_filter (ctx, GL_TEXTURE_1D, CAIRO_FILTER_BILINEAR);
glEnable (GL_TEXTURE_1D);
break;
case CAIRO_GL_OPERAND_RADIAL_GRADIENT:
glActiveTexture (GL_TEXTURE0 + tex_unit);
glBindTexture (GL_TEXTURE_1D, operand->radial.tex);
+ _cairo_gl_texture_set_extend (ctx, GL_TEXTURE_1D, operand->radial.extend);
+ _cairo_gl_texture_set_filter (ctx, GL_TEXTURE_1D, CAIRO_FILTER_BILINEAR);
glEnable (GL_TEXTURE_1D);
break;
}
diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h
index 3554c67a..0ec85b3c 100644
--- a/src/cairo-gl-private.h
+++ b/src/cairo-gl-private.h
@@ -148,6 +148,7 @@ typedef struct cairo_gl_operand {
cairo_matrix_t m;
float segment_x;
float segment_y;
+ cairo_extend_t extend;
} linear;
struct {
GLuint tex;
@@ -156,6 +157,7 @@ typedef struct cairo_gl_operand {
float circle_1_y;
float radius_0;
float radius_1;
+ cairo_extend_t extend;
} radial;
};
unsigned int vertex_offset;