[Cogl] [PATCH] debug: ignore wireframe debug drawing for line primitives

Robert Bragg robert at sixbynine.org
Tue Aug 28 08:47:19 PDT 2012


From: Robert Bragg <robert at linux.intel.com>

If a primitive is already line based then we don't need to do anything
special to draw it in wireframe mode.
---
 cogl/cogl-framebuffer.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index c34bc80..2add6e6 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -3319,7 +3319,10 @@ _cogl_framebuffer_draw_attributes (CoglFramebuffer *framebuffer,
 {
 #ifdef COGL_ENABLE_DEBUG
   if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WIREFRAME) &&
-                  (flags & COGL_DRAW_SKIP_DEBUG_WIREFRAME) == 0))
+                  (flags & COGL_DRAW_SKIP_DEBUG_WIREFRAME) == 0) &&
+      mode != COGL_VERTICES_MODE_LINES &&
+      mode != COGL_VERTICES_MODE_LINE_LOOP &&
+      mode != COGL_VERTICES_MODE_LINE_STRIP)
     draw_wireframe (framebuffer->context,
                     framebuffer, pipeline,
                     mode, first_vertex, n_vertices,
@@ -3415,7 +3418,10 @@ _cogl_framebuffer_draw_indexed_attributes (CoglFramebuffer *framebuffer,
 {
 #ifdef COGL_ENABLE_DEBUG
   if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WIREFRAME) &&
-                  (flags & COGL_DRAW_SKIP_DEBUG_WIREFRAME) == 0))
+                  (flags & COGL_DRAW_SKIP_DEBUG_WIREFRAME) == 0) &&
+      mode != COGL_VERTICES_MODE_LINES &&
+      mode != COGL_VERTICES_MODE_LINE_LOOP &&
+      mode != COGL_VERTICES_MODE_LINE_STRIP)
     draw_wireframe (framebuffer->context,
                     framebuffer, pipeline,
                     mode, first_vertex, n_vertices,
-- 
1.7.7.6



More information about the Cogl mailing list