Merge branch '7.8'
[mesa.git] / src / gallium / state_trackers / egl / common / egl_g3d.h
1 /*
2 * Mesa 3-D graphics library
3 * Version: 7.8
4 *
5 * Copyright (C) 2009-2010 Chia-I Wu <olv@0xlab.org>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 #ifndef _EGL_G3D_H_
26 #define _EGL_G3D_H_
27
28 #include "pipe/p_compiler.h"
29 #include "pipe/p_screen.h"
30 #include "pipe/p_context.h"
31 #include "pipe/p_format.h"
32 #include "egldriver.h"
33 #include "egldisplay.h"
34 #include "eglcontext.h"
35 #include "eglsurface.h"
36 #include "eglconfig.h"
37 #include "eglimage.h"
38 #include "eglscreen.h"
39 #include "eglmode.h"
40
41 #include "native.h"
42 #include "egl_g3d_st.h"
43
44 struct egl_g3d_driver {
45 _EGLDriver base;
46 struct st_api *stapis[ST_API_COUNT];
47 EGLint api_mask;
48
49 EGLint probe_key;
50 };
51
52 struct egl_g3d_display {
53 struct native_display *native;
54
55 struct st_manager *smapi;
56 struct pipe_context *pipe;
57 };
58
59 struct egl_g3d_context {
60 _EGLContext base;
61
62 struct st_api *stapi;
63
64 struct st_context_iface *stctxi;
65 };
66
67 struct egl_g3d_surface {
68 _EGLSurface base;
69
70 struct st_visual stvis;
71 struct st_framebuffer_iface *stfbi;
72
73 struct native_surface *native;
74 struct pipe_texture *render_texture;
75 unsigned int sequence_number;
76 };
77
78 struct egl_g3d_config {
79 _EGLConfig base;
80 const struct native_config *native;
81 struct st_visual stvis;
82 };
83
84 struct egl_g3d_image {
85 _EGLImage base;
86 struct pipe_texture *texture;
87 unsigned face;
88 unsigned level;
89 unsigned zslice;
90 };
91
92 struct egl_g3d_screen {
93 _EGLScreen base;
94 const struct native_connector *native;
95 const struct native_mode **native_modes;
96 };
97
98 /* standard typecasts */
99 _EGL_DRIVER_STANDARD_TYPECASTS(egl_g3d)
100 _EGL_DRIVER_TYPECAST(egl_g3d_screen, _EGLScreen, obj)
101 _EGL_DRIVER_TYPECAST(egl_g3d_image, _EGLImage, obj)
102
103
104 _EGLConfig *
105 egl_g3d_find_pixmap_config(_EGLDisplay *dpy, EGLNativePixmapType pix);
106
107 #endif /* _EGL_G3D_H_ */