static void
gdk_draw_context_init (GdkDrawContext *self)
{
-#ifdef G_ENABLE_DEBUG
if (pixels_counter == 0)
pixels_counter = gdk_profiler_define_int_counter ("frame pixels", "Pixels drawn per frame");
-#endif
}
/**
GDK_DRAW_CONTEXT_GET_CLASS (context)->begin_frame (context, priv->frame_region);
}
-#ifdef G_ENABLE_DEBUG
static gint64
region_get_pixels (cairo_region_t *region)
{
return pixels;
}
-#endif
/**
* gdk_draw_context_end_frame:
GDK_DRAW_CONTEXT_GET_CLASS (context)->end_frame (context, priv->frame_region);
-#ifdef G_ENABLE_DEBUG
if (gdk_profiler_is_running ())
gdk_profiler_set_int_counter (pixels_counter,
g_get_monotonic_time () * 1000,
region_get_pixels (priv->frame_region));
-#endif
g_clear_pointer (&priv->frame_region, cairo_region_destroy);
g_clear_object (&priv->surface->paint_context);
int minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
- GdkDisplay *display;
int version, min_ver;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
/* Enforce a minimum context version number of 3.2 */
version = (major * 100) + minor;
- display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
-
- if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES))
+ if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), GL_GLES))
min_ver = 200;
else
min_ver = 302;
int *minor)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
- GdkDisplay *display;
int default_major, default_minor;
int maj, min;
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
- display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
-
- if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES))
+ if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), GL_GLES))
{
default_major = 2;
default_minor = 0;
gdk_gl_context_check_extensions (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
- GdkDisplay *display;
gboolean has_npot, has_texture_rectangle;
if (!priv->realized)
priv->is_legacy = TRUE;
}
- display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
-
- if (priv->has_khr_debug && GDK_DISPLAY_DEBUG_CHECK (display, GL_DEBUG))
+ if (priv->has_khr_debug && GDK_DISPLAY_DEBUG_CHECK (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), GL_DEBUG))
{
priv->use_khr_debug = TRUE;
glGetIntegerv (GL_MAX_LABEL_LENGTH, &priv->max_debug_label_length);
}
- if (!priv->use_es && GDK_DISPLAY_DEBUG_CHECK (display, GL_TEXTURE_RECT))
+ if (!priv->use_es && GDK_DISPLAY_DEBUG_CHECK (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), GL_TEXTURE_RECT))
priv->use_texture_rectangle = TRUE;
else if (has_npot)
priv->use_texture_rectangle = FALSE;
else
g_warning ("GL implementation doesn't support any form of non-power-of-two textures");
- GDK_DISPLAY_NOTE (display, OPENGL,
+ GDK_DISPLAY_NOTE (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), OPENGL,
g_message ("%s version: %d.%d (%s)\n"
"* GLSL version: %s\n"
"* Extensions checked:\n"