| 1 |
#ifndef __CLUTTER_STAGE_COGL_H__ |
| 2 |
#define __CLUTTER_STAGE_COGL_H__ |
| 3 |
|
| 4 |
#include <cairo.h> |
| 5 |
#include <clutter/clutter-backend.h> |
| 6 |
#include <clutter/clutter-stage.h> |
| 7 |
|
| 8 |
#ifdef COGL_HAS_X11_SUPPORT |
| 9 |
#include <X11/Xlib.h> |
| 10 |
#include <X11/Xatom.h> |
| 11 |
#include <X11/Xutil.h> |
| 12 |
#endif |
| 13 |
|
| 14 |
G_BEGIN_DECLS |
| 15 |
|
| 16 |
#define CLUTTER_TYPE_STAGE_COGL (_clutter_stage_cogl_get_type ()) |
| 17 |
#define CLUTTER_STAGE_COGL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_COGL, ClutterStageCogl)) |
| 18 |
#define CLUTTER_IS_STAGE_COGL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_COGL)) |
| 19 |
#define CLUTTER_STAGE_COGL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_STAGE_COGL, ClutterStageCoglClass)) |
| 20 |
#define CLUTTER_IS_STAGE_COGL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_STAGE_COGL)) |
| 21 |
#define CLUTTER_STAGE_COGL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_STAGE_COGL, ClutterStageCoglClass)) |
| 22 |
|
| 23 |
typedef struct _ClutterStageCogl ClutterStageCogl; |
| 24 |
typedef struct _ClutterStageCoglClass ClutterStageCoglClass; |
| 25 |
|
| 26 |
struct _ClutterStageCogl |
| 27 |
{ |
| 28 |
GObject parent_instance; |
| 29 |
|
| 30 |
/* the stage wrapper */ |
| 31 |
ClutterStage *wrapper; |
| 32 |
|
| 33 |
/* back pointer to the backend */ |
| 34 |
ClutterBackend *backend; |
| 35 |
|
| 36 |
CoglOnscreen *onscreen; |
| 37 |
|
| 38 |
float refresh_rate; |
| 39 |
int pending_swaps; |
| 40 |
|
| 41 |
CoglFrameClosure *frame_closure; |
| 42 |
|
| 43 |
gint64 last_presentation_time; |
| 44 |
gint64 update_time; |
| 45 |
|
| 46 |
/* We only enable clipped redraws after 2 frames, since we've seen |
| 47 |
* a lot of drivers can struggle to get going and may output some |
| 48 |
* junk frames to start with. */ |
| 49 |
unsigned int frame_count; |
| 50 |
|
| 51 |
cairo_rectangle_int_t bounding_redraw_clip; |
| 52 |
|
| 53 |
/* Stores a list of previous damaged areas */ |
| 54 |
#define DAMAGE_HISTORY_MAX 16 |
| 55 |
#define DAMAGE_HISTORY(x) ((x) & (DAMAGE_HISTORY_MAX - 1)) |
| 56 |
cairo_rectangle_int_t damage_history[DAMAGE_HISTORY_MAX]; |
| 57 |
unsigned int damage_index; |
| 58 |
|
| 59 |
guint initialized_redraw_clip : 1; |
| 60 |
|
| 61 |
/* TRUE if the current paint cycle has a clipped redraw. In that |
| 62 |
case bounding_redraw_clip specifies the the bounds. */ |
| 63 |
guint using_clipped_redraw : 1; |
| 64 |
|
| 65 |
guint dirty_backbuffer : 1; |
| 66 |
}; |
| 67 |
|
| 68 |
struct _ClutterStageCoglClass |
| 69 |
{ |
| 70 |
GObjectClass parent_class; |
| 71 |
}; |
| 72 |
|
| 73 |
GType _clutter_stage_cogl_get_type (void) G_GNUC_CONST; |
| 74 |
|
| 75 |
G_END_DECLS |
| 76 |
|
| 77 |
#endif /* __CLUTTER_STAGE_COGL_H__ */ |