From f92cca5229fe620f911f3c3bbc3f4b377f990421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 29 Dec 2017 08:51:57 +0100 Subject: gl renderer: Fix release build --- gsk/gl/gskgldriver.c | 13 +++++++++++++ gsk/gl/gskglrenderer.c | 4 +--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gsk/gl/gskgldriver.c b/gsk/gl/gskgldriver.c index 5f9735c08c..4861657dd3 100644 --- a/gsk/gl/gskgldriver.c +++ b/gsk/gl/gskgldriver.c @@ -171,7 +171,9 @@ gsk_gl_driver_begin_frame (GskGLDriver *self) glActiveTexture (GL_TEXTURE0); +#ifdef G_ENABLE_DEBUG gsk_profiler_reset (self->profiler); +#endif } void @@ -185,6 +187,7 @@ gsk_gl_driver_end_frame (GskGLDriver *self) self->default_fbo.fbo_id = 0; +#ifdef G_ENABLE_DEBUG GSK_NOTE (OPENGL, g_print ("Textures created: %ld\n" " Textures reused: %ld\n" @@ -192,6 +195,8 @@ gsk_gl_driver_end_frame (GskGLDriver *self) gsk_profiler_counter_get (self->profiler, self->counters.created_textures), gsk_profiler_counter_get (self->profiler, self->counters.reused_textures), gsk_profiler_counter_get (self->profiler, self->counters.surface_uploads))); +#endif + GSK_NOTE (OPENGL, g_print ("*** Frame end: textures=%d\n", g_hash_table_size (self->textures))); @@ -324,7 +329,10 @@ create_texture (GskGLDriver *self, GSK_NOTE (OPENGL, g_print ("Reusing Texture(%d) for size %dx%d\n", t->texture_id, t->width, t->height)); t->in_use = TRUE; + +#ifdef G_ENABLE_DEBUG gsk_profiler_counter_inc (self->profiler, self->counters.reused_textures); +#endif return t; } @@ -338,7 +346,9 @@ create_texture (GskGLDriver *self, t->mag_filter = GL_NEAREST; t->in_use = TRUE; g_hash_table_insert (self->textures, GINT_TO_POINTER (texture_id), t); +#ifdef G_ENABLE_DEBUG gsk_profiler_counter_inc (self->profiler, self->counters.created_textures); +#endif return t; } @@ -613,7 +623,10 @@ gsk_gl_driver_init_texture_with_surface (GskGLDriver *self, gsk_gl_driver_set_texture_parameters (self, min_filter, mag_filter); gdk_cairo_surface_upload_to_gl (surface, GL_TEXTURE_2D, t->width, t->height, NULL); + +#ifdef G_ENABLE_DEBUG gsk_profiler_counter_inc (self->profiler, self->counters.surface_uploads); +#endif t->min_filter = min_filter; t->mag_filter = mag_filter; diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index 5a5594a29e..1c67ef3404 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -1971,11 +1971,9 @@ gsk_gl_renderer_clear_tree (GskGLRenderer *self) gdk_gl_context_make_current (self->gl_context); g_array_remove_range (self->render_ops, 0, self->render_ops->len); - removed_textures = gsk_gl_driver_collect_textures (self->gl_driver); - GSK_NOTE (OPENGL, g_print ("Collected: %d textures\n", - removed_textures)); + GSK_NOTE (OPENGL, g_print ("Collected: %d textures\n", removed_textures)); } static void -- cgit v1.2.1