summaryrefslogtreecommitdiff
path: root/clutter/cogl/clutter-backend-cogl.c
blob: fdfbf38f21d3e5f05eb2a12d4db95dca79b0a815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
/*
 * Clutter.
 *
 * An OpenGL based 'interactive canvas' library.
 *
 * Copyright (C) 2010,2011  Intel Corporation.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.

 * Authors:
 *  Matthew Allum
 *  Emmanuele Bassi
 *  Robert Bragg
 *  Neil Roberts
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

#include <errno.h>

#include "clutter-backend-cogl.h"
#include "clutter-stage-cogl.h"

#ifdef HAVE_EVDEV
#include "clutter-device-manager-evdev.h"
#endif

#include "clutter-debug.h"
#include "clutter-private.h"
#include "clutter-main.h"
#include "clutter-stage-private.h"

#ifdef COGL_HAS_EGL_SUPPORT
#include "clutter-egl.h"
#endif
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
#include "clutter-cex100.h"
#endif
#ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
#include "wayland/clutter-device-manager-wayland.h"
#include "wayland/clutter-event-wayland.h"
#endif

static ClutterBackendCogl *backend_singleton = NULL;

static gchar *clutter_vblank = NULL;

/* FIXME: We should have CLUTTER_ define for this... */
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
static gdl_plane_id_t gdl_plane = GDL_PLANE_ID_UPP_C;
static guint gdl_n_buffers = CLUTTER_CEX100_TRIPLE_BUFFERING;
#endif

#ifdef COGL_HAS_X11_SUPPORT
G_DEFINE_TYPE (ClutterBackendCogl, _clutter_backend_cogl, CLUTTER_TYPE_BACKEND_X11);
#else
G_DEFINE_TYPE (ClutterBackendCogl, _clutter_backend_cogl, CLUTTER_TYPE_BACKEND);
#endif

static void
clutter_backend_at_exit (void)
{
  if (backend_singleton)
    g_object_run_dispose (G_OBJECT (backend_singleton));
}

const gchar*
_clutter_backend_cogl_get_vblank (void)
{
  if (clutter_vblank && strcmp (clutter_vblank, "0") == 0)
    return "none";
  else
    return clutter_vblank;
}

static gboolean
clutter_backend_cogl_pre_parse (ClutterBackend  *backend,
                                GError         **error)
{
  const gchar *env_string;
#ifdef COGL_HAS_X11_SUPPORT
  ClutterBackendClass *parent_class =
    CLUTTER_BACKEND_CLASS (_clutter_backend_cogl_parent_class);

  if (!parent_class->pre_parse (backend, error))
    return FALSE;
#endif

  env_string = g_getenv ("CLUTTER_VBLANK");
  if (env_string)
    {
      clutter_vblank = g_strdup (env_string);
      env_string = NULL;
    }

  return TRUE;
}

#ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
static void
handle_configure (void *data,
                  struct wl_shell *shell,
                  uint32_t timestamp,
                  uint32_t edges,
                  struct wl_surface *surface,
                  int32_t width,
                  int32_t height)
{
  ClutterStageCogl *stage_cogl = wl_surface_get_user_data (surface);
  CoglFramebuffer *fb = COGL_FRAMEBUFFER (stage_cogl->onscreen);

  if (cogl_framebuffer_get_width (fb) != width ||
      cogl_framebuffer_get_height (fb) != height)
    clutter_actor_queue_relayout (CLUTTER_ACTOR (stage_cogl->wrapper));

  clutter_actor_set_size (CLUTTER_ACTOR (stage_cogl->wrapper),
			  width, height);

  /* the resize process is complete, so we can ask the stage
   * to set up the GL viewport with the new size
   */
  clutter_stage_ensure_viewport (stage_cogl->wrapper);
}

static const struct wl_shell_listener shell_listener = {
	handle_configure,
};

static void
display_handle_global (struct wl_display *display,
                       uint32_t id,
                       const char *interface,
                       uint32_t version,
                       void *data)
{
  ClutterBackendCogl *backend_cogl = data;

  if (strcmp (interface, "wl_compositor") == 0)
    backend_cogl->wayland_compositor = wl_compositor_create (display, id, 1);
  else if (strcmp (interface, "wl_input_device") == 0)
    _clutter_wayland_add_input_group (backend_cogl, id);
  else if (strcmp (interface, "wl_shell") == 0)
    {
      backend_cogl->wayland_shell = wl_shell_create (display, id, 1);
      wl_shell_add_listener (backend_cogl->wayland_shell,
                             &shell_listener, backend_cogl);
    }
  else if (strcmp (interface, "wl_shm") == 0)
    backend_cogl->wayland_shm = wl_shm_create (display, id, 1);
}

static int
event_mask_update_cb (uint32_t mask, void *user_data)
{
  ClutterBackendCogl *backend_cogl = user_data;
  backend_cogl->wayland_event_mask = mask;
  return 0;
}
#endif

static gboolean
clutter_backend_cogl_post_parse (ClutterBackend  *backend,
                                 GError         **error)
{
#ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
  ClutterBackendCogl *backend_cogl = CLUTTER_BACKEND_COGL (backend);
#endif

#ifdef COGL_HAS_X11_SUPPORT
  ClutterBackendClass *parent_class =
    CLUTTER_BACKEND_CLASS (_clutter_backend_cogl_parent_class);

  if (!parent_class->post_parse (backend, error))
    return FALSE;

  return TRUE;
#endif

#ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT

  /* TODO: expose environment variable/commandline option for this... */
  backend_cogl->wayland_display = wl_display_connect (NULL);
  if (!backend_cogl->wayland_display)
    {
      g_set_error (error, CLUTTER_INIT_ERROR,
		   CLUTTER_INIT_ERROR_BACKEND,
		   "Failed to open Wayland display socket");
      return FALSE;
    }

  backend_cogl->wayland_source =
    _clutter_event_source_wayland_new (backend_cogl->wayland_display);
  g_source_attach (backend_cogl->wayland_source, NULL);

  /* Set up listener so we'll catch all events. */
  wl_display_add_global_listener (backend_cogl->wayland_display,
                                  display_handle_global,
                                  backend_cogl);

  wl_display_get_fd (backend_cogl->wayland_display,
                     event_mask_update_cb, backend_cogl);

  /* Wait until we have been notified about the compositor object */
  while (!backend_cogl->wayland_compositor)
    wl_display_iterate (backend_cogl->wayland_display,
                        backend_cogl->wayland_event_mask);

#endif

  g_atexit (clutter_backend_at_exit);

  return TRUE;
}

#ifndef COGL_HAS_XLIB_SUPPORT
static ClutterDeviceManager *
clutter_backend_cogl_get_device_manager (ClutterBackend *backend)
{
  ClutterBackendCogl *backend_cogl = CLUTTER_BACKEND_COGL (backend);

  if (G_UNLIKELY (backend_cogl->device_manager == NULL))
    {
#ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
      backend_cogl->device_manager =
        g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_WAYLAND,
		      "backend", backend_cogl,
		      NULL);
#elif defined (HAVE_EVDEV)
      backend_cogl->device_manager =
	g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_EVDEV,
		      "backend", backend_cogl,
		      NULL);
#endif
    }

  return backend_cogl->device_manager;
}
#endif

static void
clutter_backend_cogl_init_events (ClutterBackend *backend)
{
#ifdef HAVE_TSLIB
  /* XXX: This should be renamed to _clutter_events_tslib_init */
  _clutter_events_tslib_init (CLUTTER_BACKEND_COGL (backend));
#endif
#ifdef HAVE_EVDEV
  _clutter_events_evdev_init (CLUTTER_BACKEND (backend));
#endif
#ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
  _clutter_events_wayland_init (backend);
#endif
#ifdef COGL_HAS_X11_SUPPORT
  /* Chain up to the X11 backend */
  CLUTTER_BACKEND_CLASS (_clutter_backend_cogl_parent_class)->
    init_events (backend);
#endif
}

static void
clutter_backend_cogl_finalize (GObject *gobject)
{
  if (backend_singleton)
    backend_singleton = NULL;

  G_OBJECT_CLASS (_clutter_backend_cogl_parent_class)->finalize (gobject);
}

static void
clutter_backend_cogl_dispose (GObject *gobject)
{
  ClutterBackend *backend = CLUTTER_BACKEND (gobject);
#if defined (HAVE_TSLIB) || defined (COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT)
  ClutterBackendCogl *backend_cogl = CLUTTER_BACKEND_COGL (gobject);
#endif

  /* We chain up before disposing our CoglContext so that we will
   * destroy all of the stages first. Otherwise the actors may try to
   * make Cogl calls during destruction which would cause a crash */
  G_OBJECT_CLASS (_clutter_backend_cogl_parent_class)->dispose (gobject);

  if (backend->cogl_context)
    {
      cogl_object_unref (backend->cogl_context);
      backend->cogl_context = NULL;
    }

#ifdef HAVE_TSLIB
  /* XXX: This should be renamed to _clutter_events_tslib_uninit */
  _clutter_events_egl_uninit (backend_cogl);

  if (backend_cogl->event_timer != NULL)
    {
      g_timer_destroy (backend_cogl->event_timer);
      backend_cogl->event_timer = NULL;
    }
#endif
#ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
  _clutter_events_wayland_uninit (backend_cogl);
#endif
}

static GObject *
clutter_backend_cogl_constructor (GType                  gtype,
                                  guint                  n_params,
                                  GObjectConstructParam *params)
{
  GObjectClass *parent_class;
  GObject *retval;

  if (!backend_singleton)
    {
      parent_class = G_OBJECT_CLASS (_clutter_backend_cogl_parent_class);
      retval = parent_class->constructor (gtype, n_params, params);

      backend_singleton = CLUTTER_BACKEND_COGL (retval);

      return retval;
    }

  g_warning ("Attempting to create a new backend object. This should "
             "never happen, so we return the singleton instance.");

  return g_object_ref (backend_singleton);
}

static ClutterFeatureFlags
clutter_backend_cogl_get_features (ClutterBackend *backend)
{
  ClutterBackendCogl *backend_cogl = CLUTTER_BACKEND_COGL (backend);
#ifdef COGL_HAS_XLIB_SUPPORT
  ClutterBackendClass *parent_class;
#endif
  ClutterFeatureFlags flags = 0;

#ifdef COGL_HAS_XLIB_SUPPORT
  parent_class = CLUTTER_BACKEND_CLASS (_clutter_backend_cogl_parent_class);

  flags = parent_class->get_features (backend);
#endif

  if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_MULTIPLE_ONSCREEN))
    {
      CLUTTER_NOTE (BACKEND, "Cogl supports multiple onscreen framebuffers");
      flags |= CLUTTER_FEATURE_STAGE_MULTIPLE;
    }
  else
    {
      CLUTTER_NOTE (BACKEND, "Cogl only supports one onscreen framebuffer");
      flags |= CLUTTER_FEATURE_STAGE_STATIC;
    }

  if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_THROTTLE))
    {
      CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers throttling");
      flags |= CLUTTER_FEATURE_SYNC_TO_VBLANK;
    }
  else
    CLUTTER_NOTE (BACKEND, "Cogl doesn't support swap buffers throttling");

  if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_BUFFERS_EVENT))
    {
      CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers complete events");
      flags |= CLUTTER_FEATURE_SWAP_EVENTS;
    }

  if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION))
    {
      CLUTTER_NOTE (BACKEND, "Cogl supports swapping buffer regions");
      backend_cogl->can_blit_sub_buffer = TRUE;
    }

  return flags;
}

#ifdef COGL_HAS_XLIB_SUPPORT
static XVisualInfo *
clutter_backend_cogl_get_visual_info (ClutterBackendX11 *backend_x11)
{
  return cogl_clutter_winsys_xlib_get_visual_info ();
}
#endif

static gboolean
clutter_backend_cogl_create_context (ClutterBackend  *backend,
                                     GError         **error)
{
#if defined (COGL_HAS_XLIB_SUPPORT)
  ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
#elif defined (COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT)
  ClutterBackendCogl *backend_cogl = CLUTTER_BACKEND_COGL (backend);
#endif
  CoglSwapChain *swap_chain = NULL;
  CoglOnscreenTemplate *onscreen_template = NULL;

  if (backend->cogl_context)
    return TRUE;

  backend->cogl_renderer = cogl_renderer_new ();
#if defined (COGL_HAS_XLIB_SUPPORT)
  cogl_xlib_renderer_set_foreign_display (backend->cogl_renderer,
                                          backend_x11->xdpy);
#elif defined (COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT)
  cogl_renderer_wayland_set_foreign_display (backend->cogl_renderer,
                                             backend_cogl->wayland_display);
  cogl_renderer_wayland_set_foreign_compositor (backend->cogl_renderer,
                                                backend_cogl->wayland_compositor);
#endif
  if (!cogl_renderer_connect (backend->cogl_renderer, error))
    goto error;

  swap_chain = cogl_swap_chain_new ();
#ifdef COGL_HAS_XLIB_SUPPORT
  cogl_swap_chain_set_has_alpha (swap_chain,
                                 clutter_x11_get_use_argb_visual ());
#endif

#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
  cogl_swap_chain_set_length (swap_chain, gdl_n_buffers);
#endif

  onscreen_template = cogl_onscreen_template_new (swap_chain);
  cogl_object_unref (swap_chain);

  /* XXX: I have some doubts that this is a good design.
   * Conceptually should we be able to check an onscreen_template
   * without more details about the CoglDisplay configuration?
   */
  if (!cogl_renderer_check_onscreen_template (backend->cogl_renderer,
                                              onscreen_template,
                                              error))
    goto error;

  backend->cogl_display = cogl_display_new (backend->cogl_renderer,
                                            onscreen_template);

#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
  cogl_gdl_display_set_plane (backend->cogl_display, gdl_plane);
#endif

  cogl_object_unref (backend->cogl_renderer);
  cogl_object_unref (onscreen_template);

  if (!cogl_display_setup (backend->cogl_display, error))
    goto error;

  backend->cogl_context = cogl_context_new (backend->cogl_display, error);
  if (!backend->cogl_context)
    goto error;

  return TRUE;

error:
  if (backend->cogl_display)
    {
      cogl_object_unref (backend->cogl_display);
      backend->cogl_display = NULL;
    }

  if (onscreen_template)
    cogl_object_unref (onscreen_template);
  if (swap_chain)
    cogl_object_unref (swap_chain);

  if (backend->cogl_renderer)
    {
      cogl_object_unref (backend->cogl_renderer);
      backend->cogl_renderer = NULL;
    }
  return FALSE;
}

static ClutterStageWindow *
clutter_backend_cogl_create_stage (ClutterBackend  *backend,
                                   ClutterStage    *wrapper,
                                   GError         **error)
{
#ifdef COGL_HAS_XLIB_SUPPORT
  ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
  ClutterEventTranslator *translator;
  ClutterStageWindow *stage;
  ClutterStageX11 *stage_x11;

  stage = g_object_new (CLUTTER_TYPE_STAGE_COGL, NULL);

  /* copy backend data into the stage */
  stage_x11 = CLUTTER_STAGE_X11 (stage);
  stage_x11->wrapper = wrapper;
  stage_x11->backend = backend_x11;

  translator = CLUTTER_EVENT_TRANSLATOR (stage_x11);
  _clutter_backend_add_event_translator (backend, translator);

  CLUTTER_NOTE (MISC, "Cogl stage created (display:%p, screen:%d, root:%u)",
                backend_x11->xdpy,
                backend_x11->xscreen_num,
                (unsigned int) backend_x11->xwin_root);

#else /* COGL_HAS_XLIB_SUPPORT */

  ClutterBackendCogl *backend_cogl = CLUTTER_BACKEND_COGL (backend);
  ClutterStageWindow *stage;
  ClutterStageCogl *stage_cogl;

  if (G_UNLIKELY (backend_cogl->stage != NULL))
    {
      g_set_error (error, CLUTTER_INIT_ERROR,
                   CLUTTER_INIT_ERROR_BACKEND,
                   "The Cogl backend does not support multiple "
                   "onscreen windows");
      return backend_cogl->stage;
    }

  stage = g_object_new (CLUTTER_TYPE_STAGE_COGL, NULL);

  stage_cogl = CLUTTER_STAGE_COGL (stage);
  stage_cogl->backend = backend_cogl;
  stage_cogl->wrapper = wrapper;

  backend_cogl->stage = stage;

#endif /* COGL_HAS_XLIB_SUPPORT */

  return stage;
}

static void
clutter_backend_cogl_ensure_context (ClutterBackend *backend,
                                     ClutterStage   *stage)
{
  ClutterStageCogl *stage_cogl;

  /* ignore ensuring the context on an empty stage */
  if (stage == NULL)
    return;

  stage_cogl =
    CLUTTER_STAGE_COGL (_clutter_stage_get_window (stage));

  cogl_set_framebuffer (COGL_FRAMEBUFFER (stage_cogl->onscreen));
}

static void
_clutter_backend_cogl_class_init (ClutterBackendCoglClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass);
#ifdef COGL_HAS_X11_SUPPORT
  ClutterBackendX11Class *backendx11_class = CLUTTER_BACKEND_X11_CLASS (klass);
#endif

  gobject_class->constructor = clutter_backend_cogl_constructor;
  gobject_class->dispose     = clutter_backend_cogl_dispose;
  gobject_class->finalize    = clutter_backend_cogl_finalize;

  backend_class->pre_parse          = clutter_backend_cogl_pre_parse;
  backend_class->post_parse         = clutter_backend_cogl_post_parse;
  backend_class->get_features       = clutter_backend_cogl_get_features;
#ifndef COGL_HAS_XLIB_SUPPORT
  backend_class->get_device_manager = clutter_backend_cogl_get_device_manager;
#endif
  backend_class->init_events        = clutter_backend_cogl_init_events;
  backend_class->create_stage       = clutter_backend_cogl_create_stage;
  backend_class->create_context     = clutter_backend_cogl_create_context;
  backend_class->ensure_context     = clutter_backend_cogl_ensure_context;

#ifdef COGL_HAS_XLIB_SUPPORT
  backendx11_class->get_visual_info = clutter_backend_cogl_get_visual_info;
#endif
}

static void
_clutter_backend_cogl_init (ClutterBackendCogl *backend_cogl)
{
#ifdef HAVE_TSLIB
  backend_cogl->event_timer = g_timer_new ();
#endif
}

GType
_clutter_backend_impl_get_type (void)
{
  return _clutter_backend_cogl_get_type ();
}

#ifdef COGL_HAS_EGL_SUPPORT
EGLDisplay
clutter_eglx_display (void)
{
  return clutter_egl_get_egl_display ();
}

EGLDisplay
clutter_egl_display (void)
{
  return clutter_egl_get_egl_display ();
}

EGLDisplay
clutter_egl_get_egl_display (void)
{
  if (backend_singleton == NULL)
    {
      g_critical ("%s has been called before clutter_init()", G_STRFUNC);
      return 0;
    }

  return cogl_egl_context_get_egl_display (backend_singleton->cogl_context);
}
#endif

/* FIXME we should have a CLUTTER_ define for this */
#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
void
clutter_cex100_set_plane (gdl_plane_id_t plane)
{
  g_return_if_fail (plane >= GDL_PLANE_ID_UPP_A && plane <= GDL_PLANE_ID_UPP_E);

  gdl_plane = plane;
}

void
clutter_cex100_set_buffering_mode (ClutterCex100BufferingMode mode)
{
  g_return_if_fail (mode == CLUTTER_CEX100_DOUBLE_BUFFERING ||
                    mode == CLUTTER_CEX100_TRIPLE_BUFFERING);

  gdl_n_buffers = mode;
}
#endif