From d4ffa2f819737b0f06e7a1b1e83c6c648b11b8ca Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Wed, 4 Nov 2009 16:55:18 +0000 Subject: [PATCH] [debug] Adds a COGL_DEBUG=force-scanline-paths For a long time now the GLES driver for Cogl has supported a fallback scanline rasterizer for filling paths when no stencil buffer is available, but now that we build the same cogl-primitives code for GL and GLES I thought it may sometimes be useful for debugging to force Cogl to use the scanline rasterizer instead of the current stencil buffer approach. --- cogl/cogl-debug.c | 3 ++- cogl/cogl-debug.h | 3 ++- cogl/cogl-primitives.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cogl/cogl-debug.c b/cogl/cogl-debug.c index efc0146a3..3545de860 100644 --- a/cogl/cogl-debug.c +++ b/cogl/cogl-debug.c @@ -47,7 +47,8 @@ static const GDebugKey cogl_debug_keys[] = { { "journal", COGL_DEBUG_JOURNAL }, { "batching", COGL_DEBUG_BATCHING }, { "disable-software-transform", COGL_DEBUG_DISABLE_SOFTWARE_TRANSFORM }, - { "matrices", COGL_DEBUG_MATRICES } + { "matrices", COGL_DEBUG_MATRICES }, + { "force-scanline-paths", COGL_DEBUG_FORCE_SCANLINE_PATHS } }; static const gint n_cogl_debug_keys = G_N_ELEMENTS (cogl_debug_keys); diff --git a/cogl/cogl-debug.h b/cogl/cogl-debug.h index 86d3b57db..fb0e839ee 100644 --- a/cogl/cogl-debug.h +++ b/cogl/cogl-debug.h @@ -45,7 +45,8 @@ typedef enum { COGL_DEBUG_JOURNAL = 1 << 13, COGL_DEBUG_BATCHING = 1 << 14, COGL_DEBUG_DISABLE_SOFTWARE_TRANSFORM = 1 << 15, - COGL_DEBUG_MATRICES = 1 << 16 + COGL_DEBUG_MATRICES = 1 << 16, + COGL_DEBUG_FORCE_SCANLINE_PATHS = 1 << 17 } CoglDebugFlags; #ifdef COGL_ENABLE_DEBUG diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c index 2fc69160c..c72aa740b 100644 --- a/cogl/cogl-primitives.c +++ b/cogl/cogl-primitives.c @@ -1452,7 +1452,8 @@ _cogl_path_fill_nodes (void) _cogl_path_get_bounds (ctx->path_nodes_min, ctx->path_nodes_max, &bounds_x, &bounds_y, &bounds_w, &bounds_h); - if (cogl_features_available (COGL_FEATURE_STENCIL_BUFFER)) + if (G_LIKELY (!(cogl_debug_flags & COGL_DEBUG_FORCE_SCANLINE_PATHS)) && + cogl_features_available (COGL_FEATURE_STENCIL_BUFFER)) { CoglHandle draw_buffer; CoglClipStackState *clip_state;