[cairo-commit] src/cairo-gl-composite.c src/cairo-gl-device.c src/cairo-gl-glyphs.c src/cairo-gl-gradient.c src/cairo-gl-info.c src/cairo-gl-msaa-compositor.c src/cairo-gl-operand.c src/cairo-gl-shaders.c src/cairo-gl-spans-compositor.c src/cairo-gl-surface.c src/cairo-gl-surface-legacy.c src/cairo-gl-traps-compositor.c src/cairo-glx-context.c
Bryce Harrington
bryce at kemper.freedesktop.org
Tue May 29 19:17:02 UTC 2018
src/cairo-gl-composite.c | 176 ++++++++++++++++-----------------
src/cairo-gl-device.c | 42 +++----
src/cairo-gl-glyphs.c | 46 ++++----
src/cairo-gl-gradient.c | 44 ++++----
src/cairo-gl-info.c | 2
src/cairo-gl-msaa-compositor.c | 24 ++--
src/cairo-gl-operand.c | 110 ++++++++++----------
src/cairo-gl-shaders.c | 168 +++++++++++++++----------------
src/cairo-gl-spans-compositor.c | 54 +++++-----
src/cairo-gl-surface-legacy.c | 213 +++++++++++++++++++---------------------
src/cairo-gl-surface.c | 160 +++++++++++++++---------------
src/cairo-gl-traps-compositor.c | 20 +--
src/cairo-glx-context.c | 2
13 files changed, 530 insertions(+), 531 deletions(-)
New commits:
commit 85fe4deee4bb01a211924d92263540e93cd9e5db
Author: Bryce Harrington <bryce at bryceharrington.org>
Date: Tue May 29 12:15:47 2018 -0700
gl: Whitespace cleanup
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index ecf03a559..8f05f7718 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -141,7 +141,7 @@ FAIL:
cairo_int_status_t
_cairo_gl_composite_set_source (cairo_gl_composite_t *setup,
- const cairo_pattern_t *pattern,
+ const cairo_pattern_t *pattern,
const cairo_rectangle_int_t *sample,
const cairo_rectangle_int_t *extents,
cairo_bool_t use_texgen)
@@ -181,7 +181,7 @@ _cairo_gl_composite_set_mask (cairo_gl_composite_t *setup,
{
_cairo_gl_operand_destroy (&setup->mask);
if (pattern == NULL)
- return CAIRO_STATUS_SUCCESS;
+ return CAIRO_STATUS_SUCCESS;
return _cairo_gl_operand_init (&setup->mask, pattern, setup->dst,
sample, extents, use_texgen);
@@ -214,7 +214,7 @@ _cairo_gl_composite_set_multisample (cairo_gl_composite_t *setup)
void
_cairo_gl_composite_set_clip_region (cairo_gl_composite_t *setup,
- cairo_region_t *clip_region)
+ cairo_region_t *clip_region)
{
setup->clip_region = clip_region;
}
@@ -238,8 +238,8 @@ _cairo_gl_composite_bind_to_shader (cairo_gl_context_t *ctx,
static void
_cairo_gl_texture_set_filter (cairo_gl_context_t *ctx,
- GLuint target,
- cairo_filter_t filter)
+ GLuint target,
+ cairo_filter_t filter)
{
switch (filter) {
case CAIRO_FILTER_FAST:
@@ -261,12 +261,12 @@ _cairo_gl_texture_set_filter (cairo_gl_context_t *ctx,
static void
_cairo_gl_texture_set_extend (cairo_gl_context_t *ctx,
- GLuint target,
- cairo_extend_t extend)
+ GLuint target,
+ cairo_extend_t extend)
{
GLint wrap_mode;
assert (! _cairo_gl_device_requires_power_of_two_textures (&ctx->base) ||
- (extend != CAIRO_EXTEND_REPEAT && extend != CAIRO_EXTEND_REFLECT));
+ (extend != CAIRO_EXTEND_REPEAT && extend != CAIRO_EXTEND_REFLECT));
switch (extend) {
case CAIRO_EXTEND_NONE:
@@ -304,10 +304,10 @@ _cairo_gl_texture_set_extend (cairo_gl_context_t *ctx,
static void
_cairo_gl_context_setup_operand (cairo_gl_context_t *ctx,
- cairo_gl_tex_t tex_unit,
- cairo_gl_operand_t *operand,
- unsigned int vertex_offset,
- cairo_bool_t vertex_size_changed)
+ cairo_gl_tex_t tex_unit,
+ cairo_gl_operand_t *operand,
+ unsigned int vertex_offset,
+ cairo_bool_t vertex_size_changed)
{
cairo_gl_dispatch_t *dispatch = &ctx->dispatch;
cairo_bool_t needs_setup;
@@ -316,36 +316,36 @@ _cairo_gl_context_setup_operand (cairo_gl_context_t *ctx,
* to no shaders (or back) */
needs_setup = vertex_size_changed;
needs_setup |= _cairo_gl_operand_needs_setup (&ctx->operands[tex_unit],
- operand,
- vertex_offset);
+ operand,
+ vertex_offset);
if (needs_setup) {
- _cairo_gl_composite_flush (ctx);
- _cairo_gl_context_destroy_operand (ctx, tex_unit);
+ _cairo_gl_composite_flush (ctx);
+ _cairo_gl_context_destroy_operand (ctx, tex_unit);
}
memcpy (&ctx->operands[tex_unit], operand, sizeof (cairo_gl_operand_t));
ctx->operands[tex_unit].vertex_offset = vertex_offset;
if (! needs_setup)
- return;
+ return;
switch (operand->type) {
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_OPERAND_NONE:
- break;
- /* fall through */
+ break;
+ /* fall through */
case CAIRO_GL_OPERAND_CONSTANT:
- break;
+ break;
case CAIRO_GL_OPERAND_TEXTURE:
- glActiveTexture (GL_TEXTURE0 + tex_unit);
- glBindTexture (ctx->tex_target, operand->texture.tex);
- _cairo_gl_texture_set_extend (ctx, ctx->tex_target,
- operand->texture.attributes.extend);
- _cairo_gl_texture_set_filter (ctx, ctx->tex_target,
- operand->texture.attributes.filter);
+ glActiveTexture (GL_TEXTURE0 + tex_unit);
+ glBindTexture (ctx->tex_target, operand->texture.tex);
+ _cairo_gl_texture_set_extend (ctx, ctx->tex_target,
+ operand->texture.attributes.extend);
+ _cairo_gl_texture_set_filter (ctx, ctx->tex_target,
+ operand->texture.attributes.filter);
if (! operand->texture.texgen) {
dispatch->VertexAttribPointer (CAIRO_GL_TEXCOORD0_ATTRIB_INDEX + tex_unit, 2,
@@ -353,15 +353,15 @@ _cairo_gl_context_setup_operand (cairo_gl_context_t *ctx,
ctx->vb + vertex_offset);
dispatch->EnableVertexAttribArray (CAIRO_GL_TEXCOORD0_ATTRIB_INDEX + tex_unit);
}
- break;
+ break;
case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_A0:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_NONE:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_EXT:
- glActiveTexture (GL_TEXTURE0 + tex_unit);
- glBindTexture (ctx->tex_target, operand->gradient.gradient->tex);
- _cairo_gl_texture_set_extend (ctx, ctx->tex_target, operand->gradient.extend);
- _cairo_gl_texture_set_filter (ctx, ctx->tex_target, CAIRO_FILTER_BILINEAR);
+ glActiveTexture (GL_TEXTURE0 + tex_unit);
+ glBindTexture (ctx->tex_target, operand->gradient.gradient->tex);
+ _cairo_gl_texture_set_extend (ctx, ctx->tex_target, operand->gradient.extend);
+ _cairo_gl_texture_set_filter (ctx, ctx->tex_target, CAIRO_FILTER_BILINEAR);
if (! operand->gradient.texgen) {
dispatch->VertexAttribPointer (CAIRO_GL_TEXCOORD0_ATTRIB_INDEX + tex_unit, 2,
@@ -396,7 +396,7 @@ _cairo_gl_context_setup_spans (cairo_gl_context_t *ctx,
void
_cairo_gl_context_destroy_operand (cairo_gl_context_t *ctx,
- cairo_gl_tex_t tex_unit)
+ cairo_gl_tex_t tex_unit)
{
cairo_gl_dispatch_t *dispatch = &ctx->dispatch;
@@ -406,21 +406,21 @@ _cairo_gl_context_destroy_operand (cairo_gl_context_t *ctx,
switch (ctx->operands[tex_unit].type) {
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_OPERAND_NONE:
- break;
- /* fall through */
+ break;
+ /* fall through */
case CAIRO_GL_OPERAND_CONSTANT:
- break;
+ break;
case CAIRO_GL_OPERAND_TEXTURE:
- dispatch->DisableVertexAttribArray (CAIRO_GL_TEXCOORD0_ATTRIB_INDEX + tex_unit);
- break;
+ dispatch->DisableVertexAttribArray (CAIRO_GL_TEXCOORD0_ATTRIB_INDEX + tex_unit);
+ break;
case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_A0:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_NONE:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_EXT:
- dispatch->DisableVertexAttribArray (CAIRO_GL_TEXCOORD0_ATTRIB_INDEX + tex_unit);
- break;
+ dispatch->DisableVertexAttribArray (CAIRO_GL_TEXCOORD0_ATTRIB_INDEX + tex_unit);
+ break;
}
memset (&ctx->operands[tex_unit], 0, sizeof (cairo_gl_operand_t));
@@ -428,7 +428,7 @@ _cairo_gl_context_destroy_operand (cairo_gl_context_t *ctx,
static void
_cairo_gl_set_operator (cairo_gl_context_t *ctx,
- cairo_operator_t op,
+ cairo_operator_t op,
cairo_bool_t component_alpha)
{
struct {
@@ -456,7 +456,7 @@ _cairo_gl_set_operator (cairo_gl_context_t *ctx,
assert (op < ARRAY_LENGTH (blend_factors));
/* different dst and component_alpha changes cause flushes elsewhere */
if (ctx->current_operator != op)
- _cairo_gl_composite_flush (ctx);
+ _cairo_gl_composite_flush (ctx);
ctx->current_operator = op;
src_factor = blend_factors[op].src;
@@ -481,17 +481,17 @@ _cairo_gl_set_operator (cairo_gl_context_t *ctx,
}
if (ctx->current_target->base.content == CAIRO_CONTENT_ALPHA) {
- glBlendFuncSeparate (GL_ZERO, GL_ZERO, src_factor, dst_factor);
+ glBlendFuncSeparate (GL_ZERO, GL_ZERO, src_factor, dst_factor);
} else if (ctx->current_target->base.content == CAIRO_CONTENT_COLOR) {
- glBlendFuncSeparate (src_factor, dst_factor, GL_ONE, GL_ONE);
+ glBlendFuncSeparate (src_factor, dst_factor, GL_ONE, GL_ONE);
} else {
- glBlendFunc (src_factor, dst_factor);
+ glBlendFunc (src_factor, dst_factor);
}
}
static cairo_status_t
_cairo_gl_composite_begin_component_alpha (cairo_gl_context_t *ctx,
- cairo_gl_composite_t *setup)
+ cairo_gl_composite_t *setup)
{
cairo_gl_shader_t *pre_shader = NULL;
cairo_status_t status;
@@ -517,7 +517,7 @@ _cairo_gl_composite_begin_component_alpha (cairo_gl_context_t *ctx,
* mask IN clip ? 0 : dest
*/
if (setup->op == CAIRO_OPERATOR_CLEAR) {
- _cairo_gl_solid_operand_init (&setup->src, CAIRO_COLOR_WHITE);
+ _cairo_gl_solid_operand_init (&setup->src, CAIRO_COLOR_WHITE);
setup->op = CAIRO_OPERATOR_DEST_OUT;
}
@@ -574,17 +574,17 @@ _cairo_gl_composite_begin_component_alpha (cairo_gl_context_t *ctx,
if (setup->op == CAIRO_OPERATOR_OVER) {
setup->op = CAIRO_OPERATOR_ADD;
status = _cairo_gl_get_shader_by_type (ctx,
- &setup->src,
- &setup->mask,
+ &setup->src,
+ &setup->mask,
setup->spans,
- CAIRO_GL_SHADER_IN_CA_SOURCE_ALPHA,
- &pre_shader);
- if (unlikely (status))
- return status;
+ CAIRO_GL_SHADER_IN_CA_SOURCE_ALPHA,
+ &pre_shader);
+ if (unlikely (status))
+ return status;
}
if (ctx->pre_shader != pre_shader)
- _cairo_gl_composite_flush (ctx);
+ _cairo_gl_composite_flush (ctx);
ctx->pre_shader = pre_shader;
return CAIRO_STATUS_SUCCESS;
@@ -758,7 +758,7 @@ _cairo_gl_composite_setup_clipping (cairo_gl_composite_t *setup,
if (setup->clip)
return _cairo_gl_composite_setup_painted_clipping (setup, ctx,
- vertex_size);
+ vertex_size);
disable_all_clipping:
_disable_stencil_buffer ();
glDisable (GL_SCISSOR_TEST);
@@ -798,13 +798,13 @@ _cairo_gl_set_operands_and_operator (cairo_gl_composite_t *setup,
component_alpha ?
CAIRO_GL_SHADER_IN_CA_SOURCE :
CAIRO_GL_SHADER_IN_NORMAL,
- &shader);
+ &shader);
if (unlikely (status)) {
ctx->pre_shader = NULL;
return status;
}
if (ctx->current_shader != shader)
- _cairo_gl_composite_flush (ctx);
+ _cairo_gl_composite_flush (ctx);
status = CAIRO_STATUS_SUCCESS;
@@ -866,7 +866,7 @@ _cairo_gl_composite_begin (cairo_gl_composite_t *setup,
FAIL:
if (unlikely (status))
- status = _cairo_gl_context_release (ctx, status);
+ status = _cairo_gl_context_release (ctx, status);
return status;
}
@@ -897,17 +897,17 @@ _cairo_gl_composite_draw_triangles (cairo_gl_context_t *ctx,
unsigned int count)
{
if (! ctx->pre_shader) {
- glDrawArrays (GL_TRIANGLES, 0, count);
+ glDrawArrays (GL_TRIANGLES, 0, count);
} else {
- cairo_gl_shader_t *prev_shader = ctx->current_shader;
+ cairo_gl_shader_t *prev_shader = ctx->current_shader;
- _cairo_gl_set_shader (ctx, ctx->pre_shader);
- _cairo_gl_set_operator (ctx, CAIRO_OPERATOR_DEST_OUT, TRUE);
- glDrawArrays (GL_TRIANGLES, 0, count);
+ _cairo_gl_set_shader (ctx, ctx->pre_shader);
+ _cairo_gl_set_operator (ctx, CAIRO_OPERATOR_DEST_OUT, TRUE);
+ glDrawArrays (GL_TRIANGLES, 0, count);
- _cairo_gl_set_shader (ctx, prev_shader);
- _cairo_gl_set_operator (ctx, CAIRO_OPERATOR_ADD, TRUE);
- glDrawArrays (GL_TRIANGLES, 0, count);
+ _cairo_gl_set_shader (ctx, prev_shader);
+ _cairo_gl_set_operator (ctx, CAIRO_OPERATOR_ADD, TRUE);
+ glDrawArrays (GL_TRIANGLES, 0, count);
}
}
@@ -946,7 +946,7 @@ _cairo_gl_composite_flush (cairo_gl_context_t *ctx)
int i;
if (_cairo_gl_context_is_flushed (ctx))
- return;
+ return;
count = ctx->vb_offset / ctx->vertex_size;
_cairo_gl_composite_unmap_vertex_buffer (ctx);
@@ -1028,8 +1028,8 @@ _cairo_gl_composite_emit_point (cairo_gl_context_t *ctx,
static void
_cairo_gl_composite_emit_rect (cairo_gl_context_t *ctx,
- GLfloat x1, GLfloat y1,
- GLfloat x2, GLfloat y2)
+ GLfloat x1, GLfloat y1,
+ GLfloat x2, GLfloat y2)
{
_cairo_gl_composite_prepare_buffer (ctx, 6,
CAIRO_GL_PRIMITIVE_TYPE_TRIANGLES);
@@ -1059,9 +1059,9 @@ _cairo_gl_context_emit_rect (cairo_gl_context_t *ctx,
static void
_cairo_gl_composite_emit_span (cairo_gl_context_t *ctx,
- GLfloat x1, GLfloat y1,
- GLfloat x2, GLfloat y2,
- uint8_t alpha)
+ GLfloat x1, GLfloat y1,
+ GLfloat x2, GLfloat y2,
+ uint8_t alpha)
{
_cairo_gl_composite_prepare_buffer (ctx, 6,
CAIRO_GL_PRIMITIVE_TYPE_TRIANGLES);
@@ -1135,7 +1135,7 @@ _cairo_gl_context_choose_emit_span (cairo_gl_context_t *ctx)
switch (ctx->operands[CAIRO_GL_TEX_SOURCE].type) {
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_OPERAND_NONE:
case CAIRO_GL_OPERAND_CONSTANT:
break;
@@ -1176,10 +1176,10 @@ _cairo_gl_composite_emit_glyph_vertex (cairo_gl_context_t *ctx,
static void
_cairo_gl_composite_emit_glyph (cairo_gl_context_t *ctx,
- GLfloat x1, GLfloat y1,
- GLfloat x2, GLfloat y2,
- GLfloat glyph_x1, GLfloat glyph_y1,
- GLfloat glyph_x2, GLfloat glyph_y2)
+ GLfloat x1, GLfloat y1,
+ GLfloat x2, GLfloat y2,
+ GLfloat glyph_x1, GLfloat glyph_y1,
+ GLfloat glyph_x2, GLfloat glyph_y2)
{
_cairo_gl_composite_prepare_buffer (ctx, 6,
CAIRO_GL_PRIMITIVE_TYPE_TRIANGLES);
@@ -1227,7 +1227,7 @@ _cairo_gl_context_choose_emit_glyph (cairo_gl_context_t *ctx)
switch (ctx->operands[CAIRO_GL_TEX_SOURCE].type) {
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_OPERAND_NONE:
case CAIRO_GL_OPERAND_CONSTANT:
return _cairo_gl_composite_emit_solid_glyph;
@@ -1254,13 +1254,13 @@ _cairo_gl_composite_set_operator (cairo_gl_composite_t *setup,
cairo_bool_t assume_component_alpha)
{
if (assume_component_alpha) {
- if (op != CAIRO_OPERATOR_CLEAR &&
- op != CAIRO_OPERATOR_OVER &&
- op != CAIRO_OPERATOR_ADD)
- return UNSUPPORTED ("unsupported component alpha operator");
+ if (op != CAIRO_OPERATOR_CLEAR &&
+ op != CAIRO_OPERATOR_OVER &&
+ op != CAIRO_OPERATOR_ADD)
+ return UNSUPPORTED ("unsupported component alpha operator");
} else {
- if (! _cairo_gl_operator_is_supported (op))
- return UNSUPPORTED ("unsupported operator");
+ if (! _cairo_gl_operator_is_supported (op))
+ return UNSUPPORTED ("unsupported operator");
}
setup->op = op;
@@ -1269,9 +1269,9 @@ _cairo_gl_composite_set_operator (cairo_gl_composite_t *setup,
cairo_status_t
_cairo_gl_composite_init (cairo_gl_composite_t *setup,
- cairo_operator_t op,
- cairo_gl_surface_t *dst,
- cairo_bool_t assume_component_alpha)
+ cairo_operator_t op,
+ cairo_gl_surface_t *dst,
+ cairo_bool_t assume_component_alpha)
{
cairo_status_t status;
diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c
index ec919d043..258b4c50d 100644
--- a/src/cairo-gl-device.c
+++ b/src/cairo-gl-device.c
@@ -71,7 +71,7 @@ _gl_flush (void *device)
status = _cairo_gl_context_acquire (device, &ctx);
if (unlikely (status))
- return status;
+ return status;
_cairo_gl_composite_flush (ctx);
@@ -79,8 +79,8 @@ _gl_flush (void *device)
_cairo_gl_context_destroy_operand (ctx, CAIRO_GL_TEX_MASK);
if (ctx->clip_region) {
- cairo_region_destroy (ctx->clip_region);
- ctx->clip_region = NULL;
+ cairo_region_destroy (ctx->clip_region);
+ ctx->clip_region = NULL;
}
ctx->current_target = NULL;
@@ -295,15 +295,15 @@ _cairo_gl_context_init (cairo_gl_context_t *ctx)
status = _cairo_gl_context_init_shaders (ctx);
if (unlikely (status))
- return status;
+ return status;
status = _cairo_cache_init (&ctx->gradients,
- _cairo_gl_gradient_equal,
- NULL,
- (cairo_destroy_func_t) _cairo_gl_gradient_destroy,
- CAIRO_GL_GRADIENT_CACHE_SIZE);
+ _cairo_gl_gradient_equal,
+ NULL,
+ (cairo_destroy_func_t) _cairo_gl_gradient_destroy,
+ CAIRO_GL_GRADIENT_CACHE_SIZE);
if (unlikely (status))
- return status;
+ return status;
ctx->vbo_size = _cairo_gl_get_vbo_size();
@@ -334,16 +334,16 @@ _cairo_gl_context_init (cairo_gl_context_t *ctx)
void
_cairo_gl_context_activate (cairo_gl_context_t *ctx,
- cairo_gl_tex_t tex_unit)
+ cairo_gl_tex_t tex_unit)
{
if (ctx->max_textures <= (GLint) tex_unit) {
- if (tex_unit < 2) {
- _cairo_gl_composite_flush (ctx);
- _cairo_gl_context_destroy_operand (ctx, ctx->max_textures - 1);
- }
- glActiveTexture (ctx->max_textures - 1);
+ if (tex_unit < 2) {
+ _cairo_gl_composite_flush (ctx);
+ _cairo_gl_context_destroy_operand (ctx, ctx->max_textures - 1);
+ }
+ glActiveTexture (ctx->max_textures - 1);
} else {
- glActiveTexture (GL_TEXTURE0 + tex_unit);
+ glActiveTexture (GL_TEXTURE0 + tex_unit);
}
}
@@ -393,13 +393,13 @@ _cairo_gl_ensure_msaa_gles_framebuffer (cairo_gl_context_t *ctx,
void
_cairo_gl_ensure_framebuffer (cairo_gl_context_t *ctx,
- cairo_gl_surface_t *surface)
+ cairo_gl_surface_t *surface)
{
GLenum status;
cairo_gl_dispatch_t *dispatch = &ctx->dispatch;
if (likely (surface->fb))
- return;
+ return;
/* Create a framebuffer object wrapping the texture so that we can render
* to it.
@@ -512,7 +512,7 @@ _cairo_gl_ensure_msaa_depth_stencil_buffer (cairo_gl_context_t *ctx,
dispatch->GenRenderbuffers (1, &surface->msaa_depth_stencil);
dispatch->BindRenderbuffer (GL_RENDERBUFFER,
- surface->msaa_depth_stencil);
+ surface->msaa_depth_stencil);
dispatch->RenderbufferStorageMultisample (GL_RENDERBUFFER,
ctx->num_samples,
@@ -785,8 +785,8 @@ _cairo_gl_context_bind_framebuffer (cairo_gl_context_t *ctx,
void
_cairo_gl_context_set_destination (cairo_gl_context_t *ctx,
- cairo_gl_surface_t *surface,
- cairo_bool_t multisampling)
+ cairo_gl_surface_t *surface,
+ cairo_bool_t multisampling)
{
cairo_bool_t changing_surface, changing_sampling;
diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c
index 8a1a548d9..5923af441 100644
--- a/src/cairo-gl-glyphs.c
+++ b/src/cairo-gl-glyphs.c
@@ -120,10 +120,10 @@ _cairo_gl_glyph_cache_add_glyph (cairo_gl_context_t *ctx,
/* search for an unlocked slot */
if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
status = _cairo_rtree_evict_random (&cache->rtree,
- width, height, &node);
+ width, height, &node);
if (status == CAIRO_INT_STATUS_SUCCESS) {
status = _cairo_rtree_node_insert (&cache->rtree,
- node, width, height, &node);
+ node, width, height, &node);
}
}
if (status)
@@ -132,9 +132,9 @@ _cairo_gl_glyph_cache_add_glyph (cairo_gl_context_t *ctx,
/* XXX: Make sure we use the mask texture. This should work automagically somehow */
glActiveTexture (GL_TEXTURE1);
status = _cairo_gl_surface_draw_image (cache->surface, glyph_surface,
- 0, 0,
- glyph_surface->width, glyph_surface->height,
- node->x, node->y, FALSE);
+ 0, 0,
+ glyph_surface->width, glyph_surface->height,
+ node->x, node->y, FALSE);
if (unlikely (status))
return status;
@@ -174,7 +174,7 @@ _cairo_gl_glyph_cache_lock (cairo_gl_glyph_cache_t *cache,
static cairo_status_t
cairo_gl_context_get_glyph_cache (cairo_gl_context_t *ctx,
cairo_format_t format,
- cairo_gl_glyph_cache_t **cache_out)
+ cairo_gl_glyph_cache_t **cache_out)
{
cairo_gl_glyph_cache_t *cache;
cairo_content_t content;
@@ -185,12 +185,12 @@ cairo_gl_context_get_glyph_cache (cairo_gl_context_t *ctx,
case CAIRO_FORMAT_ARGB32:
case CAIRO_FORMAT_RGB24:
cache = &ctx->glyph_cache[0];
- content = CAIRO_CONTENT_COLOR_ALPHA;
+ content = CAIRO_CONTENT_COLOR_ALPHA;
break;
case CAIRO_FORMAT_A8:
case CAIRO_FORMAT_A1:
cache = &ctx->glyph_cache[1];
- content = CAIRO_CONTENT_ALPHA;
+ content = CAIRO_CONTENT_ALPHA;
break;
default:
case CAIRO_FORMAT_INVALID:
@@ -202,9 +202,9 @@ cairo_gl_context_get_glyph_cache (cairo_gl_context_t *ctx,
cairo_surface_t *surface;
surface = _cairo_gl_surface_create_scratch_for_caching (ctx,
- content,
- GLYPH_CACHE_WIDTH,
- GLYPH_CACHE_HEIGHT);
+ content,
+ GLYPH_CACHE_WIDTH,
+ GLYPH_CACHE_HEIGHT);
if (unlikely (surface->status))
return surface->status;
@@ -281,9 +281,9 @@ render_glyphs (cairo_gl_surface_t *dst,
if (scaled_glyph->surface->format != last_format) {
status = cairo_gl_context_get_glyph_cache (ctx,
scaled_glyph->surface->format,
- &cache);
- if (unlikely (status))
- goto FINISH;
+ &cache);
+ if (unlikely (status))
+ goto FINISH;
last_format = scaled_glyph->surface->format;
@@ -291,8 +291,8 @@ render_glyphs (cairo_gl_surface_t *dst,
*has_component_alpha |= cache->surface->operand.texture.attributes.has_component_alpha;
/* XXX Shoot me. */
- status = _cairo_gl_composite_begin (&setup, &ctx);
- status = _cairo_gl_context_release (ctx, status);
+ status = _cairo_gl_composite_begin (&setup, &ctx);
+ status = _cairo_gl_context_release (ctx, status);
if (unlikely (status))
goto FINISH;
@@ -363,11 +363,11 @@ render_glyphs_via_mask (cairo_gl_surface_t *dst,
/* XXX: For non-CA, this should be CAIRO_CONTENT_ALPHA to save memory */
mask = cairo_gl_surface_create (dst->base.device,
- CAIRO_CONTENT_COLOR_ALPHA,
- info->extents.width,
- info->extents.height);
+ CAIRO_CONTENT_COLOR_ALPHA,
+ info->extents.width,
+ info->extents.height);
if (unlikely (mask->status))
- return mask->status;
+ return mask->status;
status = render_glyphs ((cairo_gl_surface_t *) mask,
info->extents.x, info->extents.y,
@@ -385,11 +385,11 @@ render_glyphs_via_mask (cairo_gl_surface_t *dst,
mask_pattern.base.extend = CAIRO_EXTEND_NONE;
cairo_matrix_init_translate (&mask_pattern.base.matrix,
- dst_x-info->extents.x, dst_y-info->extents.y);
+ dst_x-info->extents.x, dst_y-info->extents.y);
_cairo_pattern_init_for_surface (&source_pattern, source);
cairo_matrix_init_translate (&source_pattern.base.matrix,
- dst_x-info->extents.x, dst_y-info->extents.y);
+ dst_x-info->extents.x, dst_y-info->extents.y);
clip = _cairo_clip_copy (clip);
clip_extents.x = info->extents.x - dst_x;
@@ -399,7 +399,7 @@ render_glyphs_via_mask (cairo_gl_surface_t *dst,
clip = _cairo_clip_intersect_rectangle (clip, &clip_extents);
status = _cairo_surface_mask (&dst->base, op,
- &source_pattern.base,
+ &source_pattern.base,
&mask_pattern.base,
clip);
diff --git a/src/cairo-gl-gradient.c b/src/cairo-gl-gradient.c
index 28fd7c293..6107bea1e 100644
--- a/src/cairo-gl-gradient.c
+++ b/src/cairo-gl-gradient.c
@@ -47,7 +47,7 @@
static int
_cairo_gl_gradient_sample_width (unsigned int n_stops,
- const cairo_gradient_stop_t *stops)
+ const cairo_gradient_stop_t *stops)
{
unsigned int n;
int width;
@@ -106,10 +106,10 @@ static uint32_t color_stop_to_pixel(const cairo_gradient_stop_t *stop)
static cairo_status_t
_cairo_gl_gradient_render (const cairo_gl_context_t *ctx,
- unsigned int n_stops,
- const cairo_gradient_stop_t *stops,
- void *bytes,
- int width)
+ unsigned int n_stops,
+ const cairo_gradient_stop_t *stops,
+ void *bytes,
+ int width)
{
pixman_image_t *gradient, *image;
pixman_gradient_stop_t pixman_stops_stack[32];
@@ -169,11 +169,11 @@ _cairo_gl_gradient_render (const cairo_gl_context_t *ctx,
}
pixman_image_composite32 (PIXMAN_OP_SRC,
- gradient, NULL, image,
- 0, 0,
- 0, 0,
- 0, 0,
- width, 1);
+ gradient, NULL, image,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ width, 1);
pixman_image_unref (gradient);
pixman_image_unref (image);
@@ -190,18 +190,18 @@ _cairo_gl_gradient_render (const cairo_gl_context_t *ctx,
static unsigned long
_cairo_gl_gradient_hash (unsigned int n_stops,
- const cairo_gradient_stop_t *stops)
+ const cairo_gradient_stop_t *stops)
{
return _cairo_hash_bytes (n_stops,
- stops,
- sizeof (cairo_gradient_stop_t) * n_stops);
+ stops,
+ sizeof (cairo_gradient_stop_t) * n_stops);
}
static cairo_gl_gradient_t *
_cairo_gl_gradient_lookup (cairo_gl_context_t *ctx,
- unsigned long hash,
- unsigned int n_stops,
- const cairo_gradient_stop_t *stops)
+ unsigned long hash,
+ unsigned int n_stops,
+ const cairo_gradient_stop_t *stops)
{
cairo_gl_gradient_t lookup;
@@ -219,16 +219,16 @@ _cairo_gl_gradient_equal (const void *key_a, const void *key_b)
const cairo_gl_gradient_t *b = key_b;
if (a->n_stops != b->n_stops)
- return FALSE;
+ return FALSE;
return memcmp (a->stops, b->stops, a->n_stops * sizeof (cairo_gradient_stop_t)) == 0;
}
cairo_int_status_t
_cairo_gl_gradient_create (cairo_gl_context_t *ctx,
- unsigned int n_stops,
- const cairo_gradient_stop_t *stops,
- cairo_gl_gradient_t **gradient_out)
+ unsigned int n_stops,
+ const cairo_gradient_stop_t *stops,
+ cairo_gl_gradient_t **gradient_out)
{
unsigned long hash;
cairo_gl_gradient_t *gradient;
@@ -331,8 +331,8 @@ _cairo_gl_gradient_destroy (cairo_gl_gradient_t *gradient)
if (_cairo_gl_context_acquire (gradient->device, &ctx) == CAIRO_STATUS_SUCCESS) {
/* The gradient my still be active in the last operation, so flush */
_cairo_gl_composite_flush (ctx);
- glDeleteTextures (1, &gradient->tex);
- ignore = _cairo_gl_context_release (ctx, CAIRO_STATUS_SUCCESS);
+ glDeleteTextures (1, &gradient->tex);
+ ignore = _cairo_gl_context_release (ctx, CAIRO_STATUS_SUCCESS);
}
free (gradient);
diff --git a/src/cairo-gl-info.c b/src/cairo-gl-info.c
index 032e2568e..26b7b4551 100644
--- a/src/cairo-gl-info.c
+++ b/src/cairo-gl-info.c
@@ -82,7 +82,7 @@ _cairo_gl_get_vbo_size (void)
const char *env = getenv ("CAIRO_GL_VBO_SIZE");
if (env == NULL) {
- vbo_size = CAIRO_GL_VBO_SIZE_DEFAULT;
+ vbo_size = CAIRO_GL_VBO_SIZE_DEFAULT;
} else {
errno = 0;
vbo_size = strtol (env, NULL, 10);
diff --git a/src/cairo-gl-msaa-compositor.c b/src/cairo-gl-msaa-compositor.c
index 00150df0c..7a83dd219 100644
--- a/src/cairo-gl-msaa-compositor.c
+++ b/src/cairo-gl-msaa-compositor.c
@@ -224,8 +224,8 @@ _should_use_unbounded_surface (cairo_composite_rectangles_t *composite)
/* This isn't just an optimization. It also detects when painting is used
to paint back the unbounded surface, preventing infinite recursion. */
return ! (source->x <= 0 && source->y <= 0 &&
- source->height + source->y >= dst->height &&
- source->width + source->x >= dst->width);
+ source->height + source->y >= dst->height &&
+ source->width + source->x >= dst->width);
}
static cairo_surface_t*
@@ -237,10 +237,10 @@ _prepare_unbounded_surface (cairo_gl_surface_t *dst)
dst->width,
dst->height);
if (surface == NULL)
- return NULL;
+ return NULL;
if (unlikely (surface->status)) {
- cairo_surface_destroy (surface);
- return NULL;
+ cairo_surface_destroy (surface);
+ return NULL;
}
return surface;
}
@@ -361,13 +361,13 @@ _cairo_gl_msaa_compositor_mask_source_operator (const cairo_compositor_t *compos
else
status = _draw_traps (ctx, &setup, &traps);
if (unlikely (status))
- goto finish;
+ goto finish;
/* Now draw the second pass. */
status = _cairo_gl_composite_set_operator (&setup, CAIRO_OPERATOR_ADD,
FALSE /* assume_component_alpha */);
if (unlikely (status))
- goto finish;
+ goto finish;
status = _cairo_gl_composite_set_source (&setup,
&composite->source_pattern.base,
&composite->source_sample_area,
@@ -376,7 +376,7 @@ _cairo_gl_msaa_compositor_mask_source_operator (const cairo_compositor_t *compos
if (unlikely (status))
goto finish;
status = _cairo_gl_composite_set_mask (&setup,
- &composite->mask_pattern.base,
+ &composite->mask_pattern.base,
&composite->source_sample_area,
&composite->bounded,
FALSE);
@@ -553,9 +553,9 @@ _stroke_shaper_add_quad (void *closure,
}
static cairo_int_status_t
-_prevent_overlapping_strokes (cairo_gl_context_t *ctx,
- cairo_gl_composite_t *setup,
- cairo_composite_rectangles_t *composite,
+_prevent_overlapping_strokes (cairo_gl_context_t *ctx,
+ cairo_gl_composite_t *setup,
+ cairo_composite_rectangles_t *composite,
const cairo_path_fixed_t *path,
const cairo_stroke_style_t *style,
const cairo_matrix_t *ctm)
@@ -832,7 +832,7 @@ _cairo_gl_msaa_compositor_fill (const cairo_compositor_t *compositor,
else
status = _draw_traps (ctx, &setup, &traps);
if (unlikely (status))
- goto cleanup_setup;
+ goto cleanup_setup;
cleanup_setup:
_cairo_gl_composite_fini (&setup);
diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
index 8626329e0..a754bde2f 100644
--- a/src/cairo-gl-operand.c
+++ b/src/cairo-gl-operand.c
@@ -55,7 +55,7 @@
static cairo_int_status_t
_cairo_gl_create_gradient_texture (cairo_gl_surface_t *dst,
const cairo_gradient_pattern_t *pattern,
- cairo_gl_gradient_t **gradient)
+ cairo_gl_gradient_t **gradient)
{
cairo_gl_context_t *ctx;
cairo_status_t status;
@@ -130,7 +130,7 @@ _cairo_gl_subsurface_clone_operand_init (cairo_gl_operand_t *operand,
status = _cairo_gl_surface_resolve_multisampling (surface);
if (unlikely (status))
- return status;
+ return status;
attributes = &operand->texture.attributes;
@@ -336,7 +336,7 @@ fail:
void
_cairo_gl_solid_operand_init (cairo_gl_operand_t *operand,
- const cairo_color_t *color)
+ const cairo_color_t *color)
{
operand->type = CAIRO_GL_OPERAND_CONSTANT;
operand->constant.color[0] = color->red * color->alpha;
@@ -373,7 +373,7 @@ _cairo_gl_operand_translate (cairo_gl_operand_t *operand,
static cairo_status_t
_cairo_gl_gradient_operand_init (cairo_gl_operand_t *operand,
- const cairo_pattern_t *pattern,
+ const cairo_pattern_t *pattern,
cairo_gl_surface_t *dst,
cairo_bool_t use_texgen)
{
@@ -482,9 +482,9 @@ _cairo_gl_operand_copy (cairo_gl_operand_t *dst,
break;
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_OPERAND_NONE:
- break;
+ break;
}
}
@@ -505,9 +505,9 @@ _cairo_gl_operand_destroy (cairo_gl_operand_t *operand)
break;
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_OPERAND_NONE:
- break;
+ break;
}
operand->type = CAIRO_GL_OPERAND_NONE;
@@ -515,8 +515,8 @@ _cairo_gl_operand_destroy (cairo_gl_operand_t *operand)
cairo_int_status_t
_cairo_gl_operand_init (cairo_gl_operand_t *operand,
- const cairo_pattern_t *pattern,
- cairo_gl_surface_t *dst,
+ const cairo_pattern_t *pattern,
+ cairo_gl_surface_t *dst,
const cairo_rectangle_int_t *sample,
const cairo_rectangle_int_t *extents,
cairo_bool_t use_texgen)
@@ -614,25 +614,25 @@ _cairo_gl_operand_get_extend (cairo_gl_operand_t *operand)
void
_cairo_gl_operand_bind_to_shader (cairo_gl_context_t *ctx,
- cairo_gl_operand_t *operand,
- cairo_gl_tex_t tex_unit)
+ cairo_gl_operand_t *operand,
+ cairo_gl_tex_t tex_unit)
{
const cairo_matrix_t *texgen = NULL;
switch (operand->type) {
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_OPERAND_NONE:
return;
case CAIRO_GL_OPERAND_CONSTANT:
_cairo_gl_shader_bind_vec4 (ctx,
- ctx->current_shader->constant_location[tex_unit],
- operand->constant.color[0],
- operand->constant.color[1],
- operand->constant.color[2],
- operand->constant.color[3]);
+ ctx->current_shader->constant_location[tex_unit],
+ operand->constant.color[0],
+ operand->constant.color[1],
+ operand->constant.color[2],
+ operand->constant.color[3]);
return;
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_NONE:
@@ -650,7 +650,7 @@ _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 */
+ /* fall through */
case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
case CAIRO_GL_OPERAND_TEXTURE:
/*
@@ -696,37 +696,37 @@ _cairo_gl_operand_bind_to_shader (cairo_gl_context_t *ctx,
cairo_bool_t
_cairo_gl_operand_needs_setup (cairo_gl_operand_t *dest,
- cairo_gl_operand_t *source,
- unsigned int vertex_offset)
+ cairo_gl_operand_t *source,
+ unsigned int vertex_offset)
{
if (dest->type != source->type)
- return TRUE;
+ return TRUE;
if (dest->vertex_offset != vertex_offset)
- return TRUE;
+ return TRUE;
switch (source->type) {
case CAIRO_GL_OPERAND_NONE:
- return FALSE;
+ return FALSE;
case CAIRO_GL_OPERAND_CONSTANT:
- return dest->constant.color[0] != source->constant.color[0] ||
- dest->constant.color[1] != source->constant.color[1] ||
- dest->constant.color[2] != source->constant.color[2] ||
- dest->constant.color[3] != source->constant.color[3];
+ return dest->constant.color[0] != source->constant.color[0] ||
+ dest->constant.color[1] != source->constant.color[1] ||
+ dest->constant.color[2] != source->constant.color[2] ||
+ dest->constant.color[3] != source->constant.color[3];
case CAIRO_GL_OPERAND_TEXTURE:
- return dest->texture.surface != source->texture.surface ||
- dest->texture.attributes.extend != source->texture.attributes.extend ||
- dest->texture.attributes.filter != source->texture.attributes.filter ||
- dest->texture.attributes.has_component_alpha != source->texture.attributes.has_component_alpha;
+ return dest->texture.surface != source->texture.surface ||
+ dest->texture.attributes.extend != source->texture.attributes.extend ||
+ dest->texture.attributes.filter != source->texture.attributes.filter ||
+ dest->texture.attributes.has_component_alpha != source->texture.attributes.has_component_alpha;
case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_A0:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_NONE:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_EXT:
- /* XXX: improve this */
- return TRUE;
+ /* XXX: improve this */
+ return TRUE;
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
- break;
+ ASSERT_NOT_REACHED;
+ break;
}
return TRUE;
}
@@ -737,33 +737,33 @@ _cairo_gl_operand_get_vertex_size (const cairo_gl_operand_t *operand)
switch (operand->type) {
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_OPERAND_NONE:
case CAIRO_GL_OPERAND_CONSTANT:
- return 0;
+ return 0;
case CAIRO_GL_OPERAND_TEXTURE:
- return operand->texture.texgen ? 0 : 2 * sizeof (GLfloat);
+ return operand->texture.texgen ? 0 : 2 * sizeof (GLfloat);
case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_A0:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_NONE:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_EXT:
- return operand->gradient.texgen ? 0 : 2 * sizeof (GLfloat);
+ return operand->gradient.texgen ? 0 : 2 * sizeof (GLfloat);
}
}
void
_cairo_gl_operand_emit (cairo_gl_operand_t *operand,
- GLfloat ** vb,
- GLfloat x,
- GLfloat y)
+ GLfloat ** vb,
+ GLfloat x,
+ GLfloat y)
{
switch (operand->type) {
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_OPERAND_NONE:
case CAIRO_GL_OPERAND_CONSTANT:
- break;
+ break;
case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_A0:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_NONE:
@@ -776,18 +776,18 @@ _cairo_gl_operand_emit (cairo_gl_operand_t *operand,
*(*vb)++ = s;
*(*vb)++ = t;
- }
+ }
break;
case CAIRO_GL_OPERAND_TEXTURE:
if (! operand->texture.texgen) {
- cairo_surface_attributes_t *src_attributes = &operand->texture.attributes;
- double s = x;
- double t = y;
-
- cairo_matrix_transform_point (&src_attributes->matrix, &s, &t);
- *(*vb)++ = s;
- *(*vb)++ = t;
- }
- break;
+ cairo_surface_attributes_t *src_attributes = &operand->texture.attributes;
+ double s = x;
+ double t = y;
+
+ cairo_matrix_transform_point (&src_attributes->matrix, &s, &t);
+ *(*vb)++ = s;
+ *(*vb)++ = t;
+ }
+ break;
}
}
diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c
index 12c83b9ff..c43cf3b18 100644
--- a/src/cairo-gl-shaders.c
+++ b/src/cairo-gl-shaders.c
@@ -132,7 +132,7 @@ _cairo_gl_shader_cache_destroy (void *data)
_cairo_gl_shader_fini (entry->ctx, &entry->shader);
if (entry->ctx->current_shader == &entry->shader)
- entry->ctx->current_shader = NULL;
+ entry->ctx->current_shader = NULL;
free (entry);
}
@@ -171,12 +171,12 @@ _cairo_gl_context_init_shaders (cairo_gl_context_t *ctx)
memset (ctx->vertex_shaders, 0, sizeof (ctx->vertex_shaders));
status = _cairo_cache_init (&ctx->shaders,
- ctx->gl_flavor == CAIRO_GL_FLAVOR_DESKTOP ?
+ ctx->gl_flavor == CAIRO_GL_FLAVOR_DESKTOP ?
_cairo_gl_shader_cache_equal_desktop :
_cairo_gl_shader_cache_equal_gles2,
- NULL,
- _cairo_gl_shader_cache_destroy,
- CAIRO_GL_MAX_SHADERS_PER_CONTEXT);
+ NULL,
+ _cairo_gl_shader_cache_destroy,
+ CAIRO_GL_MAX_SHADERS_PER_CONTEXT);
if (unlikely (status))
return status;
@@ -225,68 +225,68 @@ cairo_gl_operand_get_var_type (cairo_gl_operand_t *operand)
switch (operand->type) {
default:
case CAIRO_GL_OPERAND_COUNT:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_OPERAND_NONE:
case CAIRO_GL_OPERAND_CONSTANT:
- return CAIRO_GL_VAR_NONE;
+ return CAIRO_GL_VAR_NONE;
case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_A0:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_NONE:
case CAIRO_GL_OPERAND_RADIAL_GRADIENT_EXT:
- return operand->gradient.texgen ? CAIRO_GL_VAR_TEXGEN : CAIRO_GL_VAR_TEXCOORDS;
+ return operand->gradient.texgen ? CAIRO_GL_VAR_TEXGEN : CAIRO_GL_VAR_TEXCOORDS;
case CAIRO_GL_OPERAND_TEXTURE:
- return operand->texture.texgen ? CAIRO_GL_VAR_TEXGEN : CAIRO_GL_VAR_TEXCOORDS;
+ return operand->texture.texgen ? CAIRO_GL_VAR_TEXGEN : CAIRO_GL_VAR_TEXCOORDS;
}
}
static void
cairo_gl_shader_emit_variable (cairo_output_stream_t *stream,
- cairo_gl_var_type_t type,
- cairo_gl_tex_t name)
+ cairo_gl_var_type_t type,
+ cairo_gl_tex_t name)
{
switch (type) {
default:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_VAR_NONE:
- break;
+ break;
case CAIRO_GL_VAR_TEXCOORDS:
- _cairo_output_stream_printf (stream,
+ _cairo_output_stream_printf (stream,
"attribute vec4 MultiTexCoord%d;\n"
- "varying vec2 %s_texcoords;\n",
- name,
- operand_names[name]);
- break;
+ "varying vec2 %s_texcoords;\n",
+ name,
+ operand_names[name]);
+ break;
case CAIRO_GL_VAR_TEXGEN:
- _cairo_output_stream_printf (stream,
+ _cairo_output_stream_printf (stream,
"uniform mat3 %s_texgen;\n"
- "varying vec2 %s_texcoords;\n",
- operand_names[name],
- operand_names[name]);
- break;
+ "varying vec2 %s_texcoords;\n",
+ operand_names[name],
+ operand_names[name]);
+ break;
}
}
static void
cairo_gl_shader_emit_vertex (cairo_output_stream_t *stream,
- cairo_gl_var_type_t type,
- cairo_gl_tex_t name)
+ cairo_gl_var_type_t type,
+ cairo_gl_tex_t name)
{
switch (type) {
default:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_VAR_NONE:
- break;
+ break;
case CAIRO_GL_VAR_TEXCOORDS:
- _cairo_output_stream_printf (stream,
- " %s_texcoords = MultiTexCoord%d.xy;\n",
- operand_names[name], name);
- break;
+ _cairo_output_stream_printf (stream,
+ " %s_texcoords = MultiTexCoord%d.xy;\n",
+ operand_names[name], name);
+ break;
case CAIRO_GL_VAR_TEXGEN:
- _cairo_output_stream_printf (stream,
+ _cairo_output_stream_printf (stream,
" %s_texcoords = (%s_texgen * Vertex.xyw).xy;\n",
- operand_names[name], operand_names[name]);
- break;
+ operand_names[name], operand_names[name]);
+ break;
}
}
@@ -304,9 +304,9 @@ cairo_gl_shader_def_coverage (cairo_output_stream_t *stream)
static cairo_status_t
cairo_gl_shader_get_vertex_source (cairo_gl_var_type_t src,
- cairo_gl_var_type_t mask,
+ cairo_gl_var_type_t mask,
cairo_bool_t use_coverage,
- cairo_gl_var_type_t dest,
+ cairo_gl_var_type_t dest,
char **out)
{
cairo_output_stream_t *stream = _cairo_memory_stream_create ();
@@ -361,9 +361,9 @@ _cairo_gl_shader_needs_border_fade (cairo_gl_operand_t *operand)
static void
cairo_gl_shader_emit_color (cairo_output_stream_t *stream,
- cairo_gl_context_t *ctx,
- cairo_gl_operand_t *op,
- cairo_gl_tex_t name)
+ cairo_gl_context_t *ctx,
+ cairo_gl_operand_t *op,
+ cairo_gl_tex_t name)
{
const char *namestr = operand_names[name];
const char *rectstr = (ctx->tex_target == GL_TEXTURE_RECTANGLE ? "Rect" : "");
@@ -371,25 +371,25 @@ cairo_gl_shader_emit_color (cairo_output_stream_t *stream,
switch (op->type) {
case CAIRO_GL_OPERAND_COUNT:
default:
- ASSERT_NOT_REACHED;
- break;
+ ASSERT_NOT_REACHED;
+ break;
case CAIRO_GL_OPERAND_NONE:
- _cairo_output_stream_printf (stream,
- "vec4 get_%s()\n"
- "{\n"
- " return vec4 (0, 0, 0, 1);\n"
- "}\n",
- namestr);
- break;
+ _cairo_output_stream_printf (stream,
+ "vec4 get_%s()\n"
+ "{\n"
+ " return vec4 (0, 0, 0, 1);\n"
+ "}\n",
+ namestr);
+ break;
case CAIRO_GL_OPERAND_CONSTANT:
- _cairo_output_stream_printf (stream,
- "uniform vec4 %s_constant;\n"
- "vec4 get_%s()\n"
- "{\n"
- " return %s_constant;\n"
- "}\n",
- namestr, namestr, namestr);
- break;
+ _cairo_output_stream_printf (stream,
+ "uniform vec4 %s_constant;\n"
+ "vec4 get_%s()\n"
+ "{\n"
+ " return %s_constant;\n"
+ "}\n",
+ namestr, namestr, namestr);
+ break;
case CAIRO_GL_OPERAND_TEXTURE:
_cairo_output_stream_printf (stream,
"uniform sampler2D%s %s_sampler;\n"
@@ -416,7 +416,7 @@ cairo_gl_shader_emit_color (cairo_output_stream_t *stream,
"}\n",
rectstr, namestr, namestr, namestr);
}
- break;
+ break;
case CAIRO_GL_OPERAND_LINEAR_GRADIENT:
_cairo_output_stream_printf (stream,
"varying vec2 %s_texcoords;\n"
@@ -657,11 +657,11 @@ _cairo_gl_shader_emit_wrap (cairo_gl_context_t *ctx,
static cairo_status_t
cairo_gl_shader_get_fragment_source (cairo_gl_context_t *ctx,
- cairo_gl_shader_in_t in,
- cairo_gl_operand_t *src,
- cairo_gl_operand_t *mask,
+ cairo_gl_shader_in_t in,
+ cairo_gl_operand_t *src,
+ cairo_gl_operand_t *mask,
cairo_bool_t use_coverage,
- cairo_gl_operand_type_t dest_type,
+ cairo_gl_operand_type_t dest_type,
char **out)
{
cairo_output_stream_t *stream = _cairo_memory_stream_create ();
@@ -696,35 +696,35 @@ cairo_gl_shader_get_fragment_source (cairo_gl_context_t *ctx,
}
_cairo_output_stream_printf (stream,
- "void main()\n"
- "{\n");
+ "void main()\n"
+ "{\n");
switch (in) {
case CAIRO_GL_SHADER_IN_COUNT:
default:
- ASSERT_NOT_REACHED;
+ ASSERT_NOT_REACHED;
case CAIRO_GL_SHADER_IN_NORMAL:
- _cairo_output_stream_printf (stream,
- " gl_FragColor = get_source() * get_mask().a%s;\n",
+ _cairo_output_stream_printf (stream,
+ " gl_FragColor = get_source() * get_mask().a%s;\n",
coverage_str);
- break;
+ break;
case CAIRO_GL_SHADER_IN_CA_SOURCE:
- _cairo_output_stream_printf (stream,
- " gl_FragColor = get_source() * get_mask()%s;\n",
+ _cairo_output_stream_printf (stream,
+ " gl_FragColor = get_source() * get_mask()%s;\n",
coverage_str);
- break;
+ break;
case CAIRO_GL_SHADER_IN_CA_SOURCE_ALPHA:
- _cairo_output_stream_printf (stream,
- " gl_FragColor = get_source().a * get_mask()%s;\n",
+ _cairo_output_stream_printf (stream,
+ " gl_FragColor = get_source().a * get_mask()%s;\n",
coverage_str);
- break;
+ break;
}
_cairo_output_stream_write (stream,
- "}\n\0", 3);
+ "}\n\0", 3);
status = _cairo_memory_stream_destroy (stream, &source, &length);
if (unlikely (status))
- return status;
+ return status;
*out = (char *) source;
return CAIRO_STATUS_SUCCESS;
@@ -1000,7 +1000,7 @@ _cairo_gl_set_shader (cairo_gl_context_t *ctx,
cairo_gl_shader_t *shader)
{
if (ctx->current_shader == shader)
- return;
+ return;
if (shader)
ctx->dispatch.UseProgram (shader->program);
@@ -1012,11 +1012,11 @@ _cairo_gl_set_shader (cairo_gl_context_t *ctx,
cairo_status_t
_cairo_gl_get_shader_by_type (cairo_gl_context_t *ctx,
- cairo_gl_operand_t *source,
- cairo_gl_operand_t *mask,
+ cairo_gl_operand_t *source,
+ cairo_gl_operand_t *mask,
cairo_bool_t use_coverage,
- cairo_gl_shader_in_t in,
- cairo_gl_shader_t **shader)
+ cairo_gl_shader_in_t in,
+ cairo_gl_shader_t **shader)
{
cairo_shader_cache_entry_t lookup, *entry;
char *fs_source;
@@ -1045,8 +1045,8 @@ _cairo_gl_get_shader_by_type (cairo_gl_context_t *ctx,
entry = _cairo_cache_lookup (&ctx->shaders, &lookup.base);
if (entry) {
- assert (entry->shader.program);
- *shader = &entry->shader;
+ assert (entry->shader.program);
+ *shader = &entry->shader;
return CAIRO_STATUS_SUCCESS;
}
@@ -1062,8 +1062,8 @@ _cairo_gl_get_shader_by_type (cairo_gl_context_t *ctx,
entry = _cairo_malloc (sizeof (cairo_shader_cache_entry_t));
if (unlikely (entry == NULL)) {
- free (fs_source);
- return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ free (fs_source);
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
}
memcpy (entry, &lookup, sizeof (cairo_shader_cache_entry_t));
diff --git a/src/cairo-gl-spans-compositor.c b/src/cairo-gl-spans-compositor.c
index 46ddc9826..0a4538a04 100644
--- a/src/cairo-gl-spans-compositor.c
+++ b/src/cairo-gl-spans-compositor.c
@@ -139,27 +139,27 @@ _cairo_gl_unbounded_spans (void *abstract_renderer,
r->xmax, y + height,
0);
} else {
- if (spans[0].x != r->xmin) {
+ if (spans[0].x != r->xmin) {
emit (r->ctx,
r->xmin, y,
spans[0].x, y + height,
0);
- }
+ }
- do {
+ do {
emit (r->ctx,
spans[0].x, y,
spans[1].x, y + height,
r->opacity * spans[0].coverage);
- spans++;
- } while (--num_spans > 1);
+ spans++;
+ } while (--num_spans > 1);
- if (spans[0].x != r->xmax) {
+ if (spans[0].x != r->xmax) {
emit (r->ctx,
spans[0].x, y,
r->xmax, y + height,
0);
- }
+ }
}
r->ymin = y + height;
@@ -189,27 +189,27 @@ _cairo_gl_clipped_spans (void *abstract_renderer,
r->xmax, y + height,
0);
} else {
- if (spans[0].x != r->xmin) {
+ if (spans[0].x != r->xmin) {
emit (r->ctx,
r->xmin, y,
spans[0].x, y + height,
0);
- }
+ }
- do {
+ do {
emit (r->ctx,
spans[0].x, y,
spans[1].x, y + height,
r->opacity * spans[0].coverage);
- spans++;
- } while (--num_spans > 1);
+ spans++;
+ } while (--num_spans > 1);
- if (spans[0].x != r->xmax) {
+ if (spans[0].x != r->xmax) {
emit (r->ctx,
spans[0].x, y,
r->xmax, y + height,
0);
- }
+ }
}
r->ymin = y + height;
@@ -273,13 +273,13 @@ fill_boxes (void *_dst,
TRACE ((stderr, "%s\n", __FUNCTION__));
status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
_cairo_gl_composite_set_solid_source (&setup, color);
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
emit_aligned_boxes (ctx, boxes);
status = _cairo_gl_context_release (ctx, CAIRO_STATUS_SUCCESS);
@@ -341,14 +341,14 @@ static cairo_int_status_t copy_boxes (void *_dst,
status = _cairo_gl_composite_init (&setup, CAIRO_OPERATOR_SOURCE, _dst, FALSE);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
_cairo_gl_composite_set_source_operand (&setup, &src->operand);
_cairo_gl_operand_translate (&setup.src, -dx, -dy);
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
emit_aligned_boxes (ctx, boxes);
status = _cairo_gl_context_release (ctx, CAIRO_STATUS_SUCCESS);
@@ -396,7 +396,7 @@ composite_boxes (void *_dst,
status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
_cairo_gl_composite_set_source_operand (&setup,
src_operand);
@@ -408,7 +408,7 @@ composite_boxes (void *_dst,
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
emit_aligned_boxes (ctx, boxes);
status = _cairo_gl_context_release (ctx, CAIRO_STATUS_SUCCESS);
@@ -454,17 +454,17 @@ _cairo_gl_span_renderer_init (cairo_abstract_span_renderer_t *_r,
return CAIRO_INT_STATUS_UNSUPPORTED;
status = _cairo_gl_composite_init (&r->setup,
- op, (cairo_gl_surface_t *)composite->surface,
- FALSE);
+ op, (cairo_gl_surface_t *)composite->surface,
+ FALSE);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
status = _cairo_gl_composite_set_source (&r->setup, source,
&composite->source_sample_area,
&composite->unbounded,
TRUE);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
r->opacity = 1.0;
if (composite->mask_pattern.base.type == CAIRO_PATTERN_TYPE_SOLID) {
@@ -483,7 +483,7 @@ _cairo_gl_span_renderer_init (cairo_abstract_span_renderer_t *_r,
status = _cairo_gl_composite_begin (&r->setup, &r->ctx);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
r->emit = _cairo_gl_context_choose_emit_span (r->ctx);
if (composite->is_bounded) {
@@ -491,13 +491,13 @@ _cairo_gl_span_renderer_init (cairo_abstract_span_renderer_t *_r,
r->base.render_rows = _cairo_gl_bounded_opaque_spans;
else
r->base.render_rows = _cairo_gl_bounded_spans;
- r->base.finish = _cairo_gl_finish_bounded_spans;
+ r->base.finish = _cairo_gl_finish_bounded_spans;
} else {
if (needs_clip)
r->base.render_rows = _cairo_gl_clipped_spans;
else
r->base.render_rows = _cairo_gl_unbounded_spans;
- r->base.finish = _cairo_gl_finish_unbounded_spans;
+ r->base.finish = _cairo_gl_finish_unbounded_spans;
r->xmin = composite->unbounded.x;
r->xmax = composite->unbounded.x + composite->unbounded.width;
r->ymin = composite->unbounded.y;
diff --git a/src/cairo-gl-surface-legacy.c b/src/cairo-gl-surface-legacy.c
index 92b27c905..87dca2f03 100644
--- a/src/cairo-gl-surface-legacy.c
+++ b/src/cairo-gl-surface-legacy.c
@@ -101,7 +101,7 @@ _cairo_gl_surface_clone_similar (void *abstract_surface,
/* XXX: Use GLCopyTexImage2D to clone non-texture-surfaces */
if (src->device == surface->base.device &&
- _cairo_gl_surface_is_texture ((cairo_gl_surface_t *) src)) {
+ _cairo_gl_surface_is_texture ((cairo_gl_surface_t *) src)) {
status = _cairo_gl_surface_deferred_clear ((cairo_gl_surface_t *)src);
if (unlikely (status))
return status;
@@ -222,70 +222,70 @@ _cairo_gl_surface_composite (cairo_operator_t op,
return status;
if (op == CAIRO_OPERATOR_SOURCE &&
- mask == NULL &&
- src->type == CAIRO_PATTERN_TYPE_SURFACE &&
- _cairo_surface_is_image (((cairo_surface_pattern_t *) src)->surface) &&
- _cairo_matrix_is_integer_translation (&src->matrix, &dx, &dy)) {
- cairo_image_surface_t *image = (cairo_image_surface_t *)
- ((cairo_surface_pattern_t *) src)->surface;
- dx += src_x;
- dy += src_y;
- if (dx >= 0 &&
- dy >= 0 &&
- dx + width <= (unsigned int) image->width &&
- dy + height <= (unsigned int) image->height) {
- status = _cairo_gl_surface_draw_image (dst, image,
- dx, dy,
- width, height,
- dst_x, dst_y, TRUE);
- if (status != CAIRO_INT_STATUS_UNSUPPORTED)
- return status;
- }
+ mask == NULL &&
+ src->type == CAIRO_PATTERN_TYPE_SURFACE &&
+ _cairo_surface_is_image (((cairo_surface_pattern_t *) src)->surface) &&
+ _cairo_matrix_is_integer_translation (&src->matrix, &dx, &dy)) {
+ cairo_image_surface_t *image = (cairo_image_surface_t *)
+ ((cairo_surface_pattern_t *) src)->surface;
+ dx += src_x;
+ dy += src_y;
+ if (dx >= 0 &&
+ dy >= 0 &&
+ dx + width <= (unsigned int) image->width &&
+ dy + height <= (unsigned int) image->height) {
+ status = _cairo_gl_surface_draw_image (dst, image,
+ dx, dy,
+ width, height,
+ dst_x, dst_y, TRUE);
+ if (status != CAIRO_INT_STATUS_UNSUPPORTED)
+ return status;
+ }
}
status = _cairo_gl_composite_init (&setup, op, dst,
- mask && mask->has_component_alpha,
- &rect);
+ mask && mask->has_component_alpha,
+ &rect);
if (unlikely (status))
- goto CLEANUP;
+ goto CLEANUP;
status = _cairo_gl_composite_set_source (&setup, src,
- src_x, src_y,
- dst_x, dst_y,
- width, height);
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height);
if (unlikely (status))
- goto CLEANUP;
+ goto CLEANUP;
status = _cairo_gl_composite_set_mask (&setup, mask,
- mask_x, mask_y,
- dst_x, dst_y,
- width, height);
+ mask_x, mask_y,
+ dst_x, dst_y,
+ width, height);
if (unlikely (status))
- goto CLEANUP;
+ goto CLEANUP;
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
goto CLEANUP;
if (clip_region != NULL) {
- int i, num_rectangles;
+ int i, num_rectangles;
- num_rectangles = cairo_region_num_rectangles (clip_region);
+ num_rectangles = cairo_region_num_rectangles (clip_region);
for (i = 0; i < num_rectangles; i++) {
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (clip_region, i, &rect);
- _cairo_gl_composite_emit_rect (ctx,
- rect.x, rect.y,
- rect.x + rect.width, rect.y + rect.height,
- 0);
+ _cairo_gl_composite_emit_rect (ctx,
+ rect.x, rect.y,
+ rect.x + rect.width, rect.y + rect.height,
+ 0);
}
} else {
- _cairo_gl_composite_emit_rect (ctx,
- dst_x, dst_y,
- dst_x + width, dst_y + height,
- 0);
+ _cairo_gl_composite_emit_rect (ctx,
+ dst_x, dst_y,
+ dst_x + width, dst_y + height,
+ 0);
}
status = _cairo_gl_context_release (ctx, status);
@@ -360,37 +360,37 @@ _cairo_gl_surface_fill_rectangles (void *abstract_dst,
return status;
status = _cairo_gl_composite_init (&setup, op, dst,
- FALSE,
- /* XXX */ NULL);
+ FALSE,
+ /* XXX */ NULL);
if (unlikely (status))
- goto CLEANUP;
+ goto CLEANUP;
_cairo_pattern_init_solid (&solid, color);
status = _cairo_gl_composite_set_source (&setup, &solid.base,
- 0, 0,
- 0, 0,
- 0, 0);
+ 0, 0,
+ 0, 0,
+ 0, 0);
if (unlikely (status))
- goto CLEANUP;
+ goto CLEANUP;
status = _cairo_gl_composite_set_mask (&setup, NULL,
- 0, 0,
- 0, 0,
- 0, 0);
+ 0, 0,
+ 0, 0,
+ 0, 0);
if (unlikely (status))
- goto CLEANUP;
+ goto CLEANUP;
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
- goto CLEANUP;
+ goto CLEANUP;
for (i = 0; i < num_rects; i++) {
- _cairo_gl_composite_emit_rect (ctx,
- rects[i].x,
- rects[i].y,
- rects[i].x + rects[i].width,
- rects[i].y + rects[i].height,
- 0);
+ _cairo_gl_composite_emit_rect (ctx,
+ rects[i].x,
+ rects[i].y,
+ rects[i].x + rects[i].width,
+ rects[i].y + rects[i].height,
+ 0);
}
status = _cairo_gl_context_release (ctx, status);
@@ -425,10 +425,10 @@ _cairo_gl_render_bounded_spans (void *abstract_renderer,
do {
if (spans[0].coverage) {
- _cairo_gl_composite_emit_rect (renderer->ctx,
- spans[0].x, y,
- spans[1].x, y + height,
- spans[0].coverage);
+ _cairo_gl_composite_emit_rect (renderer->ctx,
+ spans[0].x, y,
+ spans[1].x, y + height,
+ spans[0].coverage);
}
spans++;
@@ -446,39 +446,39 @@ _cairo_gl_render_unbounded_spans (void *abstract_renderer,
cairo_gl_surface_span_renderer_t *renderer = abstract_renderer;
if (y > renderer->ymin) {
- _cairo_gl_composite_emit_rect (renderer->ctx,
- renderer->xmin, renderer->ymin,
- renderer->xmax, y,
- 0);
+ _cairo_gl_composite_emit_rect (renderer->ctx,
+ renderer->xmin, renderer->ymin,
+ renderer->xmax, y,
+ 0);
}
if (num_spans == 0) {
- _cairo_gl_composite_emit_rect (renderer->ctx,
- renderer->xmin, y,
- renderer->xmax, y + height,
- 0);
+ _cairo_gl_composite_emit_rect (renderer->ctx,
+ renderer->xmin, y,
+ renderer->xmax, y + height,
+ 0);
} else {
- if (spans[0].x != renderer->xmin) {
- _cairo_gl_composite_emit_rect (renderer->ctx,
- renderer->xmin, y,
- spans[0].x, y + height,
- 0);
- }
-
- do {
- _cairo_gl_composite_emit_rect (renderer->ctx,
- spans[0].x, y,
- spans[1].x, y + height,
- spans[0].coverage);
- spans++;
- } while (--num_spans > 1);
-
- if (spans[0].x != renderer->xmax) {
- _cairo_gl_composite_emit_rect (renderer->ctx,
- spans[0].x, y,
- renderer->xmax, y + height,
- 0);
- }
+ if (spans[0].x != renderer->xmin) {
+ _cairo_gl_composite_emit_rect (renderer->ctx,
+ renderer->xmin, y,
+ spans[0].x, y + height,
+ 0);
+ }
+
+ do {
+ _cairo_gl_composite_emit_rect (renderer->ctx,
+ spans[0].x, y,
+ spans[1].x, y + height,
+ spans[0].coverage);
+ spans++;
+ } while (--num_spans > 1);
+
+ if (spans[0].x != renderer->xmax) {
+ _cairo_gl_composite_emit_rect (renderer->ctx,
+ spans[0].x, y,
+ renderer->xmax, y + height,
+ 0);
+ }
}
renderer->ymin = y + height;
@@ -491,10 +491,10 @@ _cairo_gl_finish_unbounded_spans (void *abstract_renderer)
cairo_gl_surface_span_renderer_t *renderer = abstract_renderer;
if (renderer->ymax > renderer->ymin) {
- _cairo_gl_composite_emit_rect (renderer->ctx,
- renderer->xmin, renderer->ymin,
- renderer->xmax, renderer->ymax,
- 0);
+ _cairo_gl_composite_emit_rect (renderer->ctx,
+ renderer->xmin, renderer->ymin,
+ renderer->xmax, renderer->ymax,
+ 0);
}
return _cairo_gl_context_release (renderer->ctx, CAIRO_STATUS_SUCCESS);
@@ -560,11 +560,11 @@ _cairo_gl_surface_create_span_renderer (cairo_operator_t op,
renderer->base.destroy = _cairo_gl_surface_span_renderer_destroy;
if (rects->is_bounded) {
renderer->base.render_rows = _cairo_gl_render_bounded_spans;
- renderer->base.finish = _cairo_gl_finish_bounded_spans;
+ renderer->base.finish = _cairo_gl_finish_bounded_spans;
extents = &rects->bounded;
} else {
renderer->base.render_rows = _cairo_gl_render_unbounded_spans;
- renderer->base.finish = _cairo_gl_finish_unbounded_spans;
+ renderer->base.finish = _cairo_gl_finish_unbounded_spans;
extents = &rects->unbounded;
}
renderer->xmin = extents->x;
@@ -573,17 +573,17 @@ _cairo_gl_surface_create_span_renderer (cairo_operator_t op,
renderer->ymax = extents->y + extents->height;
status = _cairo_gl_composite_init (&renderer->setup,
- op, dst,
- FALSE, extents);
+ op, dst,
+ FALSE, extents);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
status = _cairo_gl_composite_set_source (&renderer->setup, src,
- extents->x, extents->y,
- extents->x, extents->y,
- extents->width, extents->height);
+ extents->x, extents->y,
+ extents->x, extents->y,
+ extents->width, extents->height);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
_cairo_gl_composite_set_spans (&renderer->setup);
_cairo_gl_composite_set_clip_region (&renderer->setup,
@@ -591,7 +591,7 @@ _cairo_gl_surface_create_span_renderer (cairo_operator_t op,
status = _cairo_gl_composite_begin (&renderer->setup, &renderer->ctx);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
return &renderer->base;
@@ -600,4 +600,3 @@ FAIL:
free (renderer);
return _cairo_span_renderer_create_in_error (status);
}
-
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 0fe283f00..12ea3ddc4 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -526,7 +526,7 @@ _cairo_gl_surface_create_scratch_for_caching (cairo_gl_context_t *ctx,
static cairo_status_t
_cairo_gl_surface_clear (cairo_gl_surface_t *surface,
- const cairo_color_t *color)
+ const cairo_color_t *color)
{
cairo_gl_context_t *ctx;
cairo_status_t status;
@@ -538,16 +538,16 @@ _cairo_gl_surface_clear (cairo_gl_surface_t *surface,
_cairo_gl_context_set_destination (ctx, surface, surface->msaa_active);
if (surface->base.content & CAIRO_CONTENT_COLOR) {
- r = color->red * color->alpha;
- g = color->green * color->alpha;
- b = color->blue * color->alpha;
+ r = color->red * color->alpha;
+ g = color->green * color->alpha;
+ b = color->blue * color->alpha;
} else {
- r = g = b = 0;
+ r = g = b = 0;
}
if (surface->base.content & CAIRO_CONTENT_ALPHA) {
- a = color->alpha;
+ a = color->alpha;
} else {
- a = 1.0;
+ a = 1.0;
}
glDisable (GL_SCISSOR_TEST);
@@ -714,11 +714,11 @@ cairo_gl_surface_set_size (cairo_surface_t *abstract_surface,
if (unlikely (abstract_surface->finished)) {
_cairo_surface_set_error (abstract_surface,
_cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
- return;
+ return;
}
if (! _cairo_surface_is_gl (abstract_surface) ||
- _cairo_gl_surface_is_texture (surface)) {
+ _cairo_gl_surface_is_texture (surface)) {
_cairo_surface_set_error (abstract_surface,
_cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
return;
@@ -763,7 +763,7 @@ cairo_gl_surface_swapbuffers (cairo_surface_t *abstract_surface)
if (unlikely (abstract_surface->finished)) {
_cairo_surface_set_error (abstract_surface,
_cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
- return;
+ return;
}
if (! _cairo_surface_is_gl (abstract_surface)) {
@@ -774,11 +774,11 @@ cairo_gl_surface_swapbuffers (cairo_surface_t *abstract_surface)
if (! _cairo_gl_surface_is_texture (surface)) {
cairo_gl_context_t *ctx;
- cairo_status_t status;
+ cairo_status_t status;
- status = _cairo_gl_context_acquire (surface->base.device, &ctx);
- if (unlikely (status))
- return;
+ status = _cairo_gl_context_acquire (surface->base.device, &ctx);
+ if (unlikely (status))
+ return;
/* For swapping on EGL, at least, we need a valid context/target. */
_cairo_gl_context_set_destination (ctx, surface, FALSE);
@@ -787,9 +787,9 @@ cairo_gl_surface_swapbuffers (cairo_surface_t *abstract_surface)
ctx->swap_buffers (ctx, surface);
- status = _cairo_gl_context_release (ctx, status);
- if (status)
- status = _cairo_surface_set_error (abstract_surface, status);
+ status = _cairo_gl_context_release (ctx, status);
+ if (status)
+ status = _cairo_surface_set_error (abstract_surface, status);
}
}
@@ -804,7 +804,7 @@ _cairo_gl_surface_create_similar (void *abstract_surface,
cairo_status_t status;
if (! _cairo_gl_surface_size_valid (abstract_surface, width, height))
- return _cairo_image_surface_create_with_content (content, width, height);
+ return _cairo_image_surface_create_with_content (content, width, height);
status = _cairo_gl_context_acquire (surface->device, &ctx);
if (unlikely (status))
@@ -814,8 +814,8 @@ _cairo_gl_surface_create_similar (void *abstract_surface,
status = _cairo_gl_context_release (ctx, status);
if (unlikely (status)) {
- cairo_surface_destroy (surface);
- return _cairo_surface_create_in_error (status);
+ cairo_surface_destroy (surface);
+ return _cairo_surface_create_in_error (status);
}
return surface;
@@ -836,13 +836,13 @@ _cairo_gl_surface_fill_alpha_channel (cairo_gl_surface_t *dst,
status = _cairo_gl_composite_init (&setup, CAIRO_OPERATOR_SOURCE,
dst, FALSE);
if (unlikely (status))
- goto CLEANUP;
+ goto CLEANUP;
_cairo_gl_composite_set_solid_source (&setup, CAIRO_COLOR_BLACK);
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
- goto CLEANUP;
+ goto CLEANUP;
_cairo_gl_context_emit_rect (ctx, x, y, x + width, y + height);
@@ -935,7 +935,7 @@ _cairo_gl_surface_draw_image (cairo_gl_surface_t *dst,
is_supported =
_cairo_gl_get_image_format_and_type (ctx->gl_flavor,
clone->pixman_format,
- &internal_format,
+ &internal_format,
&format,
&type,
&has_alpha,
@@ -995,7 +995,7 @@ _cairo_gl_surface_draw_image (cairo_gl_surface_t *dst,
goto FAIL;
}
- _cairo_gl_context_activate (ctx, CAIRO_GL_TEX_TEMP);
+ _cairo_gl_context_activate (ctx, CAIRO_GL_TEX_TEMP);
glBindTexture (ctx->tex_target, dst->tex);
glTexParameteri (ctx->tex_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri (ctx->tex_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -1017,25 +1017,25 @@ _cairo_gl_surface_draw_image (cairo_gl_surface_t *dst,
if (ctx->gl_flavor == CAIRO_GL_FLAVOR_ES3)
dst->content_in_texture = TRUE;
} else {
- cairo_surface_t *tmp;
-
- tmp = _cairo_gl_surface_create_scratch (ctx,
- dst->base.content,
- width, height);
- if (unlikely (tmp->status))
- goto FAIL;
-
- status = _cairo_gl_surface_draw_image ((cairo_gl_surface_t *) tmp,
- src,
- src_x, src_y,
- width, height,
- 0, 0, force_flush);
- if (status == CAIRO_INT_STATUS_SUCCESS) {
- cairo_surface_pattern_t tmp_pattern;
+ cairo_surface_t *tmp;
+
+ tmp = _cairo_gl_surface_create_scratch (ctx,
+ dst->base.content,
+ width, height);
+ if (unlikely (tmp->status))
+ goto FAIL;
+
+ status = _cairo_gl_surface_draw_image ((cairo_gl_surface_t *) tmp,
+ src,
+ src_x, src_y,
+ width, height,
+ 0, 0, force_flush);
+ if (status == CAIRO_INT_STATUS_SUCCESS) {
+ cairo_surface_pattern_t tmp_pattern;
cairo_rectangle_int_t r;
cairo_clip_t *clip;
- _cairo_pattern_init_for_surface (&tmp_pattern, tmp);
+ _cairo_pattern_init_for_surface (&tmp_pattern, tmp);
cairo_matrix_init_translate (&tmp_pattern.base.matrix,
-dst_x, -dst_y);
tmp_pattern.base.filter = CAIRO_FILTER_NEAREST;
@@ -1051,10 +1051,10 @@ _cairo_gl_surface_draw_image (cairo_gl_surface_t *dst,
&tmp_pattern.base,
clip);
_cairo_clip_destroy (clip);
- _cairo_pattern_fini (&tmp_pattern.base);
- }
+ _cairo_pattern_fini (&tmp_pattern.base);
+ }
- cairo_surface_destroy (tmp);
+ cairo_surface_destroy (tmp);
if (ctx->gl_flavor == CAIRO_GL_FLAVOR_ES3)
dst->content_in_texture = TRUE;
}
@@ -1063,7 +1063,7 @@ FAIL:
status = _cairo_gl_context_release (ctx, status);
if (clone)
- cairo_surface_destroy (&clone->base);
+ cairo_surface_destroy (&clone->base);
if (rgba_clone)
cairo_surface_destroy (&rgba_clone->base);
@@ -1086,21 +1086,21 @@ _cairo_gl_surface_finish (void *abstract_surface)
status = _cairo_gl_context_acquire (surface->base.device, &ctx);
if (unlikely (status))
- return status;
+ return status;
if (ctx->operands[CAIRO_GL_TEX_SOURCE].type == CAIRO_GL_OPERAND_TEXTURE &&
- ctx->operands[CAIRO_GL_TEX_SOURCE].texture.surface == surface)
- _cairo_gl_context_destroy_operand (ctx, CAIRO_GL_TEX_SOURCE);
+ ctx->operands[CAIRO_GL_TEX_SOURCE].texture.surface == surface)
+ _cairo_gl_context_destroy_operand (ctx, CAIRO_GL_TEX_SOURCE);
if (ctx->operands[CAIRO_GL_TEX_MASK].type == CAIRO_GL_OPERAND_TEXTURE &&
- ctx->operands[CAIRO_GL_TEX_MASK].texture.surface == surface)
- _cairo_gl_context_destroy_operand (ctx, CAIRO_GL_TEX_MASK);
+ ctx->operands[CAIRO_GL_TEX_MASK].texture.surface == surface)
+ _cairo_gl_context_destroy_operand (ctx, CAIRO_GL_TEX_MASK);
if (ctx->current_target == surface)
ctx->current_target = NULL;
if (surface->fb)
- ctx->dispatch.DeleteFramebuffers (1, &surface->fb);
+ ctx->dispatch.DeleteFramebuffers (1, &surface->fb);
if (surface->depth_stencil)
- ctx->dispatch.DeleteRenderbuffers (1, &surface->depth_stencil);
+ ctx->dispatch.DeleteRenderbuffers (1, &surface->depth_stencil);
if (surface->owns_tex)
glDeleteTextures (1, &surface->tex);
@@ -1369,13 +1369,13 @@ _cairo_gl_surface_flush (void *abstract_surface, unsigned flags)
status = _cairo_gl_context_acquire (surface->base.device, &ctx);
if (unlikely (status))
- return status;
+ return status;
if ((ctx->operands[CAIRO_GL_TEX_SOURCE].type == CAIRO_GL_OPERAND_TEXTURE &&
- ctx->operands[CAIRO_GL_TEX_SOURCE].texture.surface == surface) ||
- (ctx->operands[CAIRO_GL_TEX_MASK].type == CAIRO_GL_OPERAND_TEXTURE &&
- ctx->operands[CAIRO_GL_TEX_MASK].texture.surface == surface) ||
- (ctx->current_target == surface))
+ ctx->operands[CAIRO_GL_TEX_SOURCE].texture.surface == surface) ||
+ (ctx->operands[CAIRO_GL_TEX_MASK].type == CAIRO_GL_OPERAND_TEXTURE &&
+ ctx->operands[CAIRO_GL_TEX_MASK].texture.surface == surface) ||
+ (ctx->current_target == surface))
_cairo_gl_composite_flush (ctx);
status = _cairo_gl_surface_resolve_multisampling (surface);
@@ -1444,14 +1444,14 @@ _cairo_gl_surface_paint (void *surface,
{
/* simplify the common case of clearing the surface */
if (clip == NULL) {
- if (op == CAIRO_OPERATOR_CLEAR)
- return _cairo_gl_surface_clear (surface, CAIRO_COLOR_TRANSPARENT);
+ if (op == CAIRO_OPERATOR_CLEAR)
+ return _cairo_gl_surface_clear (surface, CAIRO_COLOR_TRANSPARENT);
else if (source->type == CAIRO_PATTERN_TYPE_SOLID &&
- (op == CAIRO_OPERATOR_SOURCE ||
- (op == CAIRO_OPERATOR_OVER && _cairo_pattern_is_opaque_solid (source)))) {
- return _cairo_gl_surface_clear (surface,
- &((cairo_solid_pattern_t *) source)->color);
- }
+ (op == CAIRO_OPERATOR_SOURCE ||
+ (op == CAIRO_OPERATOR_OVER && _cairo_pattern_is_opaque_solid (source)))) {
+ return _cairo_gl_surface_clear (surface,
+ &((cairo_solid_pattern_t *) source)->color);
+ }
}
return _cairo_compositor_paint (get_compositor (surface), surface,
@@ -1470,16 +1470,16 @@ _cairo_gl_surface_mask (void *surface,
}
static cairo_int_status_t
-_cairo_gl_surface_stroke (void *surface,
- cairo_operator_t op,
- const cairo_pattern_t *source,
- const cairo_path_fixed_t *path,
- const cairo_stroke_style_t *style,
- const cairo_matrix_t *ctm,
- const cairo_matrix_t *ctm_inverse,
- double tolerance,
- cairo_antialias_t antialias,
- const cairo_clip_t *clip)
+_cairo_gl_surface_stroke (void *surface,
+ cairo_operator_t op,
+ const cairo_pattern_t *source,
+ const cairo_path_fixed_t *path,
+ const cairo_stroke_style_t *style,
+ const cairo_matrix_t *ctm,
+ const cairo_matrix_t *ctm_inverse,
+ double tolerance,
+ cairo_antialias_t antialias,
+ const cairo_clip_t *clip)
{
return _cairo_compositor_stroke (get_compositor (surface), surface,
op, source, path, style,
@@ -1489,13 +1489,13 @@ _cairo_gl_surface_stroke (void *surface,
static cairo_int_status_t
_cairo_gl_surface_fill (void *surface,
- cairo_operator_t op,
- const cairo_pattern_t *source,
- const cairo_path_fixed_t*path,
- cairo_fill_rule_t fill_rule,
- double tolerance,
- cairo_antialias_t antialias,
- const cairo_clip_t *clip)
+ cairo_operator_t op,
+ const cairo_pattern_t *source,
+ const cairo_path_fixed_t*path,
+ cairo_fill_rule_t fill_rule,
+ double tolerance,
+ cairo_antialias_t antialias,
+ const cairo_clip_t *clip)
{
return _cairo_compositor_fill (get_compositor (surface), surface,
op, source, path,
diff --git a/src/cairo-gl-traps-compositor.c b/src/cairo-gl-traps-compositor.c
index 928f0189f..7938c5b20 100644
--- a/src/cairo-gl-traps-compositor.c
+++ b/src/cairo-gl-traps-compositor.c
@@ -137,13 +137,13 @@ fill_boxes (void *_dst,
status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
_cairo_gl_composite_set_solid_source (&setup, color);
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
emit_aligned_boxes (ctx, boxes);
status = _cairo_gl_context_release (ctx, CAIRO_STATUS_SUCCESS);
@@ -173,7 +173,7 @@ composite_boxes (void *_dst,
status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
_cairo_gl_composite_set_source_operand (&setup,
source_to_operand (abstract_src));
@@ -185,7 +185,7 @@ composite_boxes (void *_dst,
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
emit_aligned_boxes (ctx, boxes);
status = _cairo_gl_context_release (ctx, CAIRO_STATUS_SUCCESS);
@@ -215,7 +215,7 @@ composite (void *_dst,
status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
_cairo_gl_composite_set_source_operand (&setup,
source_to_operand (abstract_src));
@@ -227,7 +227,7 @@ composite (void *_dst,
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
/* XXX clip */
_cairo_gl_context_emit_rect (ctx, dst_x, dst_y, dst_x+width, dst_y+height);
@@ -364,7 +364,7 @@ composite_traps (void *_dst,
status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
_cairo_gl_composite_set_source_operand (&setup,
source_to_operand (abstract_src));
@@ -375,7 +375,7 @@ composite_traps (void *_dst,
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
/* XXX clip */
_cairo_gl_context_emit_rect (ctx,
@@ -464,7 +464,7 @@ composite_tristrip (void *_dst,
status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
_cairo_gl_composite_set_source_operand (&setup,
source_to_operand (abstract_src));
@@ -473,7 +473,7 @@ composite_tristrip (void *_dst,
status = _cairo_gl_composite_begin (&setup, &ctx);
if (unlikely (status))
- goto FAIL;
+ goto FAIL;
/* XXX clip */
_cairo_gl_context_emit_rect (ctx,
diff --git a/src/cairo-glx-context.c b/src/cairo-glx-context.c
index 3761b9079..66f5a0d1b 100644
--- a/src/cairo-glx-context.c
+++ b/src/cairo-glx-context.c
@@ -310,7 +310,7 @@ cairo_gl_surface_create_for_window (cairo_device_t *device,
return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
if (width <= 0 || height <= 0)
- return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
surface = calloc (1, sizeof (cairo_glx_surface_t));
if (unlikely (surface == NULL))
More information about the cairo-commit
mailing list