diff --git a/cogl/cogl-debug.c b/cogl/cogl-debug.c index 37ae266af..7d9e1a746 100644 --- a/cogl/cogl-debug.c +++ b/cogl/cogl-debug.c @@ -48,6 +48,7 @@ static const GDebugKey cogl_log_debug_keys[] = { { "batching", COGL_DEBUG_BATCHING }, { "matrices", COGL_DEBUG_MATRICES }, { "draw", COGL_DEBUG_DRAW }, + { "opengl", COGL_DEBUG_OPENGL }, { "pango", COGL_DEBUG_PANGO }, }; static const int n_cogl_log_debug_keys = @@ -114,6 +115,7 @@ _cogl_parse_debug_string (const char *value, OPT ("force-scanline-paths:", "use a scanline based path rasterizer"); OPT ("dump-atlas-image:", "dump atlas changes to an image file"); OPT ("disable-atlas:", "disable texture atlasing"); + OPT ("opengl:", "traces some select OpenGL calls"); g_printerr ("\n%28s\n", "Special debug values:"); OPT ("all:", "Enables all non-behavioural debug options"); OPT ("verbose:", "Enables all non-behavioural debug options"); diff --git a/cogl/cogl-debug.h b/cogl/cogl-debug.h index 146db9cce..775625dae 100644 --- a/cogl/cogl-debug.h +++ b/cogl/cogl-debug.h @@ -45,7 +45,8 @@ typedef enum { COGL_DEBUG_FORCE_SCANLINE_PATHS = 1 << 14, COGL_DEBUG_ATLAS = 1 << 15, COGL_DEBUG_DUMP_ATLAS_IMAGE = 1 << 16, - COGL_DEBUG_DISABLE_ATLAS = 1 << 17 + COGL_DEBUG_DISABLE_ATLAS = 1 << 17, + COGL_DEBUG_OPENGL = 1 << 18 } CoglDebugFlags; #ifdef COGL_ENABLE_DEBUG diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index 2b35e1114..6bf6c531c 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -681,6 +681,12 @@ _cogl_framebuffer_flush_state (CoglHandle handle, gl_viewport_y = framebuffer->height - (framebuffer->viewport_y + framebuffer->viewport_height); + COGL_NOTE (OPENGL, "Calling glViewport(%d, %d, %d, %d)", + framebuffer->viewport_x, + gl_viewport_y, + framebuffer->viewport_width, + framebuffer->viewport_height); + GE (glViewport (framebuffer->viewport_x, gl_viewport_y, framebuffer->viewport_width,