summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-15 19:12:00 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-15 19:12:00 +0000
commit8f74159d9295c8570c244c6e3c454937c842b9d3 (patch)
treec1fb69db1f972b6be4bc619cc60e1265d1d20c58
parent909f4a4a7f0a6082f4f1e9edaba8034a819a12ec (diff)
gl: Disable the msaa compositor by default (for release testing)
One of the remaining issues with msaa is Cairo's insistence on allocating a depth-stencil for every target. These cause massive overallocation and prevents my machines from completing cairo-perf-trace. So for the time being switch back to the old fashioned span-based compositor. To continue development of msaa, or indeed other compositors, we introduce the CAIRO_GL_COMPOSITOR env variable to allow the default compositor to be selected. Use CAIRO_GL_COMPOSITOR=msaa to continue to use the msaa compositor for instance. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/cairo-gl-device.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c
index ce34779b..edc207e7 100644
--- a/src/cairo-gl-device.c
+++ b/src/cairo-gl-device.c
@@ -161,12 +161,22 @@ _cairo_gl_context_init (cairo_gl_context_t *ctx)
cairo_gl_dispatch_t *dispatch = &ctx->dispatch;
int gl_version = _cairo_gl_get_version ();
cairo_gl_flavor_t gl_flavor = _cairo_gl_get_flavor ();
+ const char *env;
int n;
_cairo_device_init (&ctx->base, &_cairo_gl_device_backend);
- //ctx->compositor = _cairo_gl_span_compositor_get ();
- ctx->compositor = _cairo_gl_msaa_compositor_get ();
+ ctx->compositor = _cairo_gl_span_compositor_get ();
+
+ /* XXX The choice of compositor should be made automatically at runtime.
+ * However, it is useful to force one particular compositor whilst
+ * testing.
+ */
+ env = getenv ("CAIRO_GL_COMPOSITOR");
+ if (env) {
+ if (strcmp(env, "msaa") == 0)
+ ctx->compositor = _cairo_gl_msaa_compositor_get ();
+ }
memset (ctx->glyph_cache, 0, sizeof (ctx->glyph_cache));
cairo_list_init (&ctx->fonts);