summaryrefslogtreecommitdiff
path: root/src/cairo-gl-operand.c
diff options
context:
space:
mode:
authornisanthmp <nisanth.mp@samsung.com>2015-12-18 11:30:06 +0530
committernisanthmp <nisanth.mp@samsung.com>2015-12-18 13:30:26 +0530
commit35254423f4ca6aa94f9f264b60fb09a5c58e8ae6 (patch)
tree236917b192af0fe3f35d316d8b82b7890f0f5d4f /src/cairo-gl-operand.c
parent629101d0a6e2af32727ca0b14acaceddb0897e6c (diff)
downloadcairo-35254423f4ca6aa94f9f264b60fb09a5c58e8ae6.tar.gz
cairo-35254423f4ca6aa94f9f264b60fb09a5c58e8ae6.tar.bz2
cairo-35254423f4ca6aa94f9f264b60fb09a5c58e8ae6.zip
Pattern/GL: Two Color Stops optimization for linear gradients.
Also 1) Updated shader cache lookup code to include 2 stops case. 2) 2 stop opt code now supports repeat and reflect patterns. 3) texel R,G and B values are now pre-multiplied by alpha. Change-Id: I053a074660635fc362a8ae37f2782009ef08f125 Signed-off-by: nisanthmp <nisanth.mp@samsung.com>
Diffstat (limited to 'src/cairo-gl-operand.c')
-rw-r--r--src/cairo-gl-operand.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
index 443d06a5f..575096a84 100644
--- a/src/cairo-gl-operand.c
+++ b/src/cairo-gl-operand.c
@@ -65,7 +65,7 @@ _cairo_gl_create_gradient_texture (cairo_gl_surface_t *dst,
if (unlikely (status))
return status;
- status = _cairo_gl_gradient_create (ctx, pattern->n_stops, pattern->stops, gradient, pattern->base.type);
+ status = _cairo_gl_gradient_create (ctx, pattern->n_stops, pattern->stops, gradient);
return _cairo_gl_context_release (ctx, status);
}
@@ -1220,6 +1220,8 @@ _cairo_gl_operand_bind_to_shader (cairo_gl_context_t *ctx,
_cairo_gl_shader_bind_float (ctx,
ctx->current_shader->radius_0_location[tex_unit],
operand->gradient.radius_0);
+ /* fall through */
+ case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
if (operand->gradient.gradient->n_stops == 2) {
_cairo_gl_shader_bind_vec4 (ctx,
ctx->current_shader->color_1_location[tex_unit],
@@ -1243,7 +1245,6 @@ _cairo_gl_operand_bind_to_shader (cairo_gl_context_t *ctx,
operand->gradient.gradient->stops[1].offset);
}
/* fall through */
- case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
case CAIRO_GL_OPERAND_TEXTURE:
case CAIRO_GL_OPERAND_GAUSSIAN:
/*