diff options
author | Alexander Larsson <alexl@redhat.com> | 2014-11-05 15:19:00 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2014-11-06 12:24:43 +0100 |
commit | 3c34ca3405f852b554bc05e07e460dbe9b9eae59 (patch) | |
tree | cf6ffc1eb03113737672c79fc25cf803f6753859 /gdk/gdkglcontext.c | |
parent | 0ac24904bda11b3f05c95a8499c5201f8c9e53ee (diff) | |
download | gtk+-3c34ca3405f852b554bc05e07e460dbe9b9eae59.tar.gz |
gdkgl: Don't constantly re-create the tmp framebuffer
Diffstat (limited to 'gdk/gdkglcontext.c')
-rw-r--r-- | gdk/gdkglcontext.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 697eb2ffa3..1628e51ced 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -87,6 +87,7 @@ typedef struct { guint realized : 1; guint use_texture_rectangle : 1; + GdkGLContextPaintData *paint_data; } GdkGLContextPrivate; enum { @@ -127,6 +128,15 @@ gdk_gl_context_dispose (GObject *gobject) } static void +gdk_gl_context_finalize (GObject *gobject) +{ + GdkGLContext *context = GDK_GL_CONTEXT (gobject); + GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); + + g_clear_pointer (&priv->paint_data, g_free); +} + +static void gdk_gl_context_set_property (GObject *gobject, guint prop_id, const GValue *value, @@ -286,6 +296,7 @@ gdk_gl_context_class_init (GdkGLContextClass *klass) gobject_class->set_property = gdk_gl_context_set_property; gobject_class->get_property = gdk_gl_context_get_property; gobject_class->dispose = gdk_gl_context_dispose; + gobject_class->finalize = gdk_gl_context_finalize; g_object_class_install_properties (gobject_class, LAST_PROP, obj_pspecs); } @@ -319,6 +330,18 @@ gdk_gl_context_end_frame (GdkGLContext *context, GDK_GL_CONTEXT_GET_CLASS (context)->end_frame (context, painted, damage); } +GdkGLContextPaintData * +gdk_gl_context_get_paint_data (GdkGLContext *context) +{ + + GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); + + if (priv->paint_data == NULL) + priv->paint_data = g_new0 (GdkGLContextPaintData, 1); + + return priv->paint_data; +} + gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context) { |