Add GdkDrawingContext

Instead of giving out Cairo contexts, GdkWindow should provide a
"drawing context", which can then create Cairo contexts on demand; this
allows us to future proof the API for when we're going to use a
different rendering pipeline, like OpenGL.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
This commit is contained in:
Emmanuele Bassi
2016-05-30 09:44:30 +01:00
parent 2c7b21718f
commit a7ef37da2a
10 changed files with 453 additions and 21 deletions

View File

@ -0,0 +1,29 @@
#ifndef __GDK_DRAWING_CONTEXT_PRIVATE_H__
#define __GDK_DRAWING_CONTEXT_PRIVATE_H__
#include "gdkdrawingcontext.h"
G_BEGIN_DECLS
#define GDK_DRAWING_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWING_CONTEXT, GdkDrawingContextClass))
#define GDK_IS_DRAWING_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWING_CONTEXT))
#define GDK_DRAWING_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWING_CONTEXT, GdkDrawingContextClass))
struct _GdkDrawingContext
{
GObject parent_instance;
GdkWindow *window;
cairo_region_t *clip;
cairo_t *cr;
};
struct _GdkDrawingContextClass
{
GObjectClass parent_instance;
};
G_END_DECLS
#endif /* __GDK_DRAWING_CONTEXT_PRIVATE_H__ */