input: Rename weston_device_repick() to weston_seat_repick()
[platform/upstream/weston.git] / src / gl-renderer.h
1 /*
2  * Copyright © 2012 John Kåre Alsaker
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation for any purpose is hereby granted without fee, provided
6  * that the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation, and that the name of the copyright holders not be used in
9  * advertising or publicity pertaining to distribution of the software
10  * without specific, written prior permission.  The copyright holders make
11  * no representations about the suitability of this software for any
12  * purpose.  It is provided "as is" without express or implied warranty.
13  *
14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  */
22
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 #include  "compositor.h"
27
28 #ifdef ENABLE_EGL
29
30 #include <EGL/egl.h>
31
32 extern const EGLint gl_renderer_opaque_attribs[];
33 extern const EGLint gl_renderer_alpha_attribs[];
34
35 int
36 gl_renderer_create(struct weston_compositor *ec, EGLNativeDisplayType display,
37         const EGLint *attribs, const EGLint *visual_id);
38 EGLDisplay
39 gl_renderer_display(struct weston_compositor *ec);
40 int
41 gl_renderer_output_create(struct weston_output *output,
42                                     EGLNativeWindowType window);
43 void
44 gl_renderer_output_destroy(struct weston_output *output);
45 EGLSurface
46 gl_renderer_output_surface(struct weston_output *output);
47 void
48 gl_renderer_set_border(struct weston_compositor *ec, int32_t width, int32_t height, void *data,
49                           int32_t *edges);
50
51 void
52 gl_renderer_print_egl_error_state(void);
53 #else
54
55 typedef int EGLint;
56 typedef void *EGLDisplay;
57 typedef void *EGLSurface;
58 typedef intptr_t EGLNativeDisplayType;
59 typedef intptr_t EGLNativeWindowType;
60
61 static const EGLint gl_renderer_opaque_attribs[];
62 static const EGLint gl_renderer_alpha_attribs[];
63
64 inline static int
65 gl_renderer_create(struct weston_compositor *ec, EGLNativeDisplayType display,
66         const EGLint *attribs, const EGLint *visual_id)
67 {
68         return -1;
69 }
70
71 inline static EGLDisplay
72 gl_renderer_display(struct weston_compositor *ec)
73 {
74         return 0;
75 }
76
77 inline static int
78 gl_renderer_output_create(struct weston_output *output,
79                                     EGLNativeWindowType window)
80 {
81         return -1;
82 }
83
84 inline static void
85 gl_renderer_output_destroy(struct weston_output *output)
86 {
87 }
88
89 inline static EGLSurface
90 gl_renderer_output_surface(struct weston_output *output)
91 {
92         return 0;
93 }
94
95 inline static void
96 gl_renderer_set_border(struct weston_compositor *ec, int32_t width, int32_t height, void *data,
97                           int32_t *edges)
98 {
99 }
100
101 inline static void
102 gl_renderer_print_egl_error_state(void)
103 {
104 }
105
106 #endif