2011-05-08 19:27:10 -04:00
|
|
|
#ifndef __CLUTTER_STAGE_COGL_H__
|
|
|
|
#define __CLUTTER_STAGE_COGL_H__
|
|
|
|
|
2011-08-16 11:01:22 -04:00
|
|
|
#include <cairo.h>
|
2011-11-04 12:52:44 -04:00
|
|
|
#include <clutter/clutter-backend.h>
|
2011-05-08 19:27:10 -04:00
|
|
|
#include <clutter/clutter-stage.h>
|
|
|
|
|
|
|
|
#ifdef COGL_HAS_X11_SUPPORT
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xatom.h>
|
|
|
|
#include <X11/Xutil.h>
|
Add a new GDK backend
This commit introduces a new flavour for Clutter, that uses GDK
for handling all window system specific interactions (except for
creating the cogl context, as cogl does not know about GDK), including
in particular events. This is not compatible with the X11 (glx)
flavour, and this is reflected by the different soname (libclutter-gdk-1.0.so),
as all X11 specific functions and classes are not available. If you
wish to be compatible, you should check for CLUTTER_WINDOWING_X11.
Other than that, this backend should be on feature parity with X11,
including XInput 2, XSettings and EMWH (with much, much less code)
https://bugzilla.gnome.org/show_bug.cgi?id=657434
2011-08-25 21:09:18 -04:00
|
|
|
#endif
|
|
|
|
|
2011-05-08 19:27:10 -04:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define CLUTTER_TYPE_STAGE_COGL (_clutter_stage_cogl_get_type ())
|
|
|
|
#define CLUTTER_STAGE_COGL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_COGL, ClutterStageCogl))
|
|
|
|
#define CLUTTER_IS_STAGE_COGL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_COGL))
|
|
|
|
#define CLUTTER_STAGE_COGL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_STAGE_COGL, ClutterStageCoglClass))
|
|
|
|
#define CLUTTER_IS_STAGE_COGL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_STAGE_COGL))
|
|
|
|
#define CLUTTER_STAGE_COGL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_STAGE_COGL, ClutterStageCoglClass))
|
|
|
|
|
|
|
|
typedef struct _ClutterStageCogl ClutterStageCogl;
|
|
|
|
typedef struct _ClutterStageCoglClass ClutterStageCoglClass;
|
|
|
|
|
|
|
|
struct _ClutterStageCogl
|
|
|
|
{
|
|
|
|
GObject parent_instance;
|
|
|
|
|
|
|
|
/* the stage wrapper */
|
2011-11-04 12:52:44 -04:00
|
|
|
ClutterStage *wrapper;
|
2011-05-08 19:27:10 -04:00
|
|
|
|
|
|
|
/* back pointer to the backend */
|
2011-11-04 12:52:44 -04:00
|
|
|
ClutterBackend *backend;
|
2011-05-08 19:27:10 -04:00
|
|
|
|
|
|
|
CoglOnscreen *onscreen;
|
|
|
|
|
2012-11-08 12:42:24 -05:00
|
|
|
float refresh_rate;
|
2015-07-08 06:15:54 -04:00
|
|
|
int pending_swaps;
|
2012-11-08 12:42:24 -05:00
|
|
|
|
|
|
|
CoglFrameClosure *frame_closure;
|
2011-05-08 19:27:10 -04:00
|
|
|
|
2015-07-08 06:15:54 -04:00
|
|
|
gint64 last_presentation_time;
|
|
|
|
gint64 update_time;
|
|
|
|
|
2011-05-08 19:27:10 -04:00
|
|
|
/* We only enable clipped redraws after 2 frames, since we've seen
|
|
|
|
* a lot of drivers can struggle to get going and may output some
|
|
|
|
* junk frames to start with. */
|
2015-07-08 06:15:54 -04:00
|
|
|
unsigned int frame_count;
|
2011-05-08 19:27:10 -04:00
|
|
|
|
2011-08-16 11:01:22 -04:00
|
|
|
cairo_rectangle_int_t bounding_redraw_clip;
|
2011-05-08 19:27:10 -04:00
|
|
|
|
2015-07-08 06:15:54 -04:00
|
|
|
/* Stores a list of previous damaged areas */
|
|
|
|
#define DAMAGE_HISTORY_MAX 16
|
|
|
|
#define DAMAGE_HISTORY(x) ((x) & (DAMAGE_HISTORY_MAX - 1))
|
|
|
|
cairo_rectangle_int_t damage_history[DAMAGE_HISTORY_MAX];
|
|
|
|
unsigned int damage_index;
|
|
|
|
|
2011-05-08 19:27:10 -04:00
|
|
|
guint initialized_redraw_clip : 1;
|
2011-07-12 12:16:43 -04:00
|
|
|
|
|
|
|
/* TRUE if the current paint cycle has a clipped redraw. In that
|
|
|
|
case bounding_redraw_clip specifies the the bounds. */
|
|
|
|
guint using_clipped_redraw : 1;
|
2013-02-03 05:51:19 -05:00
|
|
|
|
|
|
|
guint dirty_backbuffer : 1;
|
2011-05-08 19:27:10 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _ClutterStageCoglClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
GType _clutter_stage_cogl_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __CLUTTER_STAGE_COGL_H__ */
|