summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cogl/cogl-attribute-private.h5
-rw-r--r--cogl/cogl-framebuffer.c23
2 files changed, 16 insertions, 12 deletions
diff --git a/cogl/cogl-attribute-private.h b/cogl/cogl-attribute-private.h
index aa621209..c0d76f9d 100644
--- a/cogl/cogl-attribute-private.h
+++ b/cogl/cogl-attribute-private.h
@@ -77,7 +77,10 @@ typedef enum
blending. However when drawing from the journal we know what the
contents of the color array is so we can override this by passing
this flag. */
- COGL_DRAW_COLOR_ATTRIBUTE_IS_OPAQUE = 1 << 4
+ COGL_DRAW_COLOR_ATTRIBUTE_IS_OPAQUE = 1 << 4,
+ /* This forcibly disables the debug option to divert all drawing to
+ * wireframes */
+ COGL_DRAW_SKIP_DEBUG_WIREFRAME = 1 << 5
} CoglDrawFlags;
/* During CoglContext initialization we register the "cogl_color_in"
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 1bbff130..0f3d6679 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -2937,7 +2937,8 @@ draw_wireframe (CoglContext *ctx,
int n_vertices,
CoglAttribute **attributes,
int n_attributes,
- CoglIndices *indices)
+ CoglIndices *indices,
+ CoglDrawFlags flags)
{
CoglIndices *wire_indices;
CoglPipeline *wire_pipeline;
@@ -2986,7 +2987,7 @@ draw_wireframe (CoglContext *ctx,
}
/* temporarily disable the wireframe to avoid recursion! */
- COGL_DEBUG_CLEAR_FLAG (COGL_DEBUG_WIREFRAME);
+ flags |= COGL_DRAW_SKIP_DEBUG_WIREFRAME;
_cogl_framebuffer_draw_indexed_attributes (
framebuffer,
wire_pipeline,
@@ -2996,11 +2997,7 @@ draw_wireframe (CoglContext *ctx,
wire_indices,
attributes,
n_attributes,
- COGL_DRAW_SKIP_JOURNAL_FLUSH |
- COGL_DRAW_SKIP_PIPELINE_VALIDATION |
- COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH |
- COGL_DRAW_SKIP_LEGACY_STATE);
- COGL_DEBUG_SET_FLAG (COGL_DEBUG_WIREFRAME);
+ flags);
cogl_object_unref (wire_indices);
}
@@ -3020,11 +3017,13 @@ _cogl_framebuffer_draw_attributes (CoglFramebuffer *framebuffer,
CoglDrawFlags flags)
{
#ifdef COGL_ENABLE_DEBUG
- if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WIREFRAME)))
+ if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WIREFRAME) &&
+ (flags & COGL_DRAW_SKIP_DEBUG_WIREFRAME) == 0))
draw_wireframe (framebuffer->context,
framebuffer, pipeline,
mode, first_vertex, n_vertices,
- attributes, n_attributes, NULL);
+ attributes, n_attributes, NULL,
+ flags);
else
#endif
{
@@ -3114,11 +3113,13 @@ _cogl_framebuffer_draw_indexed_attributes (CoglFramebuffer *framebuffer,
CoglDrawFlags flags)
{
#ifdef COGL_ENABLE_DEBUG
- if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WIREFRAME)))
+ if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WIREFRAME) &&
+ (flags & COGL_DRAW_SKIP_DEBUG_WIREFRAME) == 0))
draw_wireframe (framebuffer->context,
framebuffer, pipeline,
mode, first_vertex, n_vertices,
- attributes, n_attributes, indices);
+ attributes, n_attributes, indices,
+ flags);
else
#endif
{