~gnome3-team/mutter/trunk

« back to all changes in this revision

Viewing changes to cogl/cogl/cogl-xlib-renderer-private.h

  • Committer: Rui Matos
  • Date: 2016-04-27 16:36:25 UTC
  • mfrom: (0.87.3184)
  • Revision ID: git-v1:3fcbe1d3ec5c9208dde080f7e9dac24e4c379bc0
Merge cogl's cogl-1.22 branch into mutter

https://bugzilla.gnome.org/show_bug.cgi?id=760439

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Cogl
 
3
 *
 
4
 * A Low Level GPU Graphics and Utilities API
 
5
 *
 
6
 * Copyright (C) 2011 Intel Corporation.
 
7
 *
 
8
 * Permission is hereby granted, free of charge, to any person
 
9
 * obtaining a copy of this software and associated documentation
 
10
 * files (the "Software"), to deal in the Software without
 
11
 * restriction, including without limitation the rights to use, copy,
 
12
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 
13
 * of the Software, and to permit persons to whom the Software is
 
14
 * furnished to do so, subject to the following conditions:
 
15
 *
 
16
 * The above copyright notice and this permission notice shall be
 
17
 * included in all copies or substantial portions of the Software.
 
18
 *
 
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
20
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
21
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
22
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 
23
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 
24
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
25
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 
26
 * SOFTWARE.
 
27
 *
 
28
 *
 
29
 */
 
30
 
 
31
#ifndef __COGL_RENDERER_XLIB_PRIVATE_H
 
32
#define __COGL_RENDERER_XLIB_PRIVATE_H
 
33
 
 
34
#include "cogl-object-private.h"
 
35
#include "cogl-xlib-private.h"
 
36
#include "cogl-x11-renderer-private.h"
 
37
#include "cogl-context.h"
 
38
#include "cogl-output.h"
 
39
 
 
40
typedef struct _CoglXlibRenderer
 
41
{
 
42
  CoglX11Renderer _parent;
 
43
 
 
44
  Display *xdpy;
 
45
 
 
46
  /* Current top of the XError trap state stack. The actual memory for
 
47
     these is expected to be allocated on the stack by the caller */
 
48
  CoglXlibTrapState *trap_state;
 
49
 
 
50
  unsigned long outputs_update_serial;
 
51
 
 
52
  XVisualInfo *xvisinfo;
 
53
} CoglXlibRenderer;
 
54
 
 
55
CoglBool
 
56
_cogl_xlib_renderer_connect (CoglRenderer *renderer, CoglError **error);
 
57
 
 
58
void
 
59
_cogl_xlib_renderer_disconnect (CoglRenderer *renderer);
 
60
 
 
61
/*
 
62
 * cogl_xlib_renderer_trap_errors:
 
63
 * @state: A temporary place to store data for the trap.
 
64
 *
 
65
 * Traps every X error until _cogl_xlib_renderer_untrap_errors()
 
66
 * called. You should allocate an uninitialised CoglXlibTrapState
 
67
 * struct on the stack to pass to this function. The same pointer
 
68
 * should later be passed to _cogl_xlib_renderer_untrap_errors().
 
69
 *
 
70
 * Calls to _cogl_xlib_renderer_trap_errors() can be nested as long as
 
71
 * _cogl_xlib_renderer_untrap_errors() is called with the
 
72
 * corresponding state pointers in reverse order.
 
73
 */
 
74
void
 
75
_cogl_xlib_renderer_trap_errors (CoglRenderer *renderer,
 
76
                                 CoglXlibTrapState *state);
 
77
 
 
78
/*
 
79
 * cogl_xlib_renderer_untrap_errors:
 
80
 * @state: The state that was passed to _cogl_xlib_renderer_trap_errors().
 
81
 *
 
82
 * Removes the X error trap and returns the current status.
 
83
 *
 
84
 * Return value: the trapped error code, or 0 for success
 
85
 */
 
86
int
 
87
_cogl_xlib_renderer_untrap_errors (CoglRenderer *renderer,
 
88
                                   CoglXlibTrapState *state);
 
89
 
 
90
CoglXlibRenderer *
 
91
_cogl_xlib_renderer_get_data (CoglRenderer *renderer);
 
92
 
 
93
int64_t
 
94
_cogl_xlib_renderer_get_dispatch_timeout (CoglRenderer *renderer);
 
95
 
 
96
CoglOutput *
 
97
_cogl_xlib_renderer_output_for_rectangle (CoglRenderer *renderer,
 
98
                                          int x,
 
99
                                          int y,
 
100
                                          int width,
 
101
                                          int height);
 
102
 
 
103
#endif /* __COGL_RENDERER_XLIB_PRIVATE_H */