beta-0.89.2
[luatex.git] / source / libs / cairo / cairo-src / src / cairo-gl-dispatch-private.h
blobcabf76f0d6b57b9c4bc600cc3b044fd1e2454159
1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2010 Linaro Limited
5 * This library is free software; you can redistribute it and/or
6 * modify it either under the terms of the GNU Lesser General Public
7 * License version 2.1 as published by the Free Software Foundation
8 * (the "LGPL") or, at your option, under the terms of the Mozilla
9 * Public License Version 1.1 (the "MPL"). If you do not alter this
10 * notice, a recipient may use your version of this file under either
11 * the MPL or the LGPL.
13 * You should have received a copy of the LGPL along with this library
14 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
16 * You should have received a copy of the MPL along with this library
17 * in the file COPYING-MPL-1.1
19 * The contents of this file are subject to the Mozilla Public License
20 * Version 1.1 (the "License"); you may not use this file except in
21 * compliance with the License. You may obtain a copy of the License at
22 * http://www.mozilla.org/MPL/
24 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26 * the specific language governing rights and limitations.
28 * Contributor(s):
29 * Alexandros Frantzis <alexandros.frantzis@linaro.org>
32 #ifndef CAIRO_GL_DISPATCH_PRIVATE_H
33 #define CAIRO_GL_DISPATCH_PRIVATE_H
35 #include "cairo-gl-private.h"
36 #include <stddef.h>
38 typedef enum _cairo_gl_dispatch_name {
39 CAIRO_GL_DISPATCH_NAME_CORE,
40 CAIRO_GL_DISPATCH_NAME_EXT,
41 CAIRO_GL_DISPATCH_NAME_ES,
42 CAIRO_GL_DISPATCH_NAME_COUNT
43 } cairo_gl_dispatch_name_t;
45 typedef struct _cairo_gl_dispatch_entry {
46 const char *name[CAIRO_GL_DISPATCH_NAME_COUNT];
47 size_t offset;
48 } cairo_gl_dispatch_entry_t;
50 #define DISPATCH_ENTRY_ARB(name) { { "gl"#name, "gl"#name"ARB", "gl"#name }, \
51 offsetof(cairo_gl_dispatch_t, name) }
52 #define DISPATCH_ENTRY_EXT(name) { { "gl"#name, "gl"#name"EXT", "gl"#name }, \
53 offsetof(cairo_gl_dispatch_t, name) }
54 #define DISPATCH_ENTRY_ARB_OES(name) { { "gl"#name, "gl"#name"ARB", "gl"#name"OES" }, \
55 offsetof(cairo_gl_dispatch_t, name) }
56 #define DISPATCH_ENTRY_EXT_IMG(name) { { "gl"#name, "gl"#name"EXT", "gl"#name"IMG" }, \
57 offsetof(cairo_gl_dispatch_t, name) }
58 #define DISPATCH_ENTRY_CUSTOM(name, name2) { { "gl"#name, "gl"#name2, "gl"#name }, \
59 offsetof(cairo_gl_dispatch_t, name)}
60 #define DISPATCH_ENTRY_LAST { { NULL, NULL, NULL }, 0 }
62 cairo_private cairo_gl_dispatch_entry_t dispatch_buffers_entries[] = {
63 DISPATCH_ENTRY_ARB (GenBuffers),
64 DISPATCH_ENTRY_ARB (BindBuffer),
65 DISPATCH_ENTRY_ARB (BufferData),
66 DISPATCH_ENTRY_ARB_OES (MapBuffer),
67 DISPATCH_ENTRY_ARB_OES (UnmapBuffer),
68 DISPATCH_ENTRY_LAST
71 cairo_private cairo_gl_dispatch_entry_t dispatch_shaders_entries[] = {
72 /* Shaders */
73 DISPATCH_ENTRY_CUSTOM (CreateShader, CreateShaderObjectARB),
74 DISPATCH_ENTRY_ARB (ShaderSource),
75 DISPATCH_ENTRY_ARB (CompileShader),
76 DISPATCH_ENTRY_CUSTOM (GetShaderiv, GetObjectParameterivARB),
77 DISPATCH_ENTRY_CUSTOM (GetShaderInfoLog, GetInfoLogARB),
78 DISPATCH_ENTRY_CUSTOM (DeleteShader, DeleteObjectARB),
80 /* Programs */
81 DISPATCH_ENTRY_CUSTOM (CreateProgram, CreateProgramObjectARB),
82 DISPATCH_ENTRY_CUSTOM (AttachShader, AttachObjectARB),
83 DISPATCH_ENTRY_CUSTOM (DeleteProgram, DeleteObjectARB),
84 DISPATCH_ENTRY_ARB (LinkProgram),
85 DISPATCH_ENTRY_CUSTOM (UseProgram, UseProgramObjectARB),
86 DISPATCH_ENTRY_CUSTOM (GetProgramiv, GetObjectParameterivARB),
87 DISPATCH_ENTRY_CUSTOM (GetProgramInfoLog, GetInfoLogARB),
89 /* Uniforms */
90 DISPATCH_ENTRY_ARB (GetUniformLocation),
91 DISPATCH_ENTRY_ARB (Uniform1f),
92 DISPATCH_ENTRY_ARB (Uniform2f),
93 DISPATCH_ENTRY_ARB (Uniform3f),
94 DISPATCH_ENTRY_ARB (Uniform4f),
95 DISPATCH_ENTRY_ARB (UniformMatrix3fv),
96 DISPATCH_ENTRY_ARB (UniformMatrix4fv),
97 DISPATCH_ENTRY_ARB (Uniform1i),
99 /* Attributes */
100 DISPATCH_ENTRY_ARB (BindAttribLocation),
101 DISPATCH_ENTRY_ARB (VertexAttribPointer),
102 DISPATCH_ENTRY_ARB (EnableVertexAttribArray),
103 DISPATCH_ENTRY_ARB (DisableVertexAttribArray),
105 DISPATCH_ENTRY_LAST
108 cairo_private cairo_gl_dispatch_entry_t dispatch_fbo_entries[] = {
109 DISPATCH_ENTRY_EXT (GenFramebuffers),
110 DISPATCH_ENTRY_EXT (BindFramebuffer),
111 DISPATCH_ENTRY_EXT (FramebufferTexture2D),
112 DISPATCH_ENTRY_EXT (CheckFramebufferStatus),
113 DISPATCH_ENTRY_EXT (DeleteFramebuffers),
114 DISPATCH_ENTRY_EXT (GenRenderbuffers),
115 DISPATCH_ENTRY_EXT (BindRenderbuffer),
116 DISPATCH_ENTRY_EXT (RenderbufferStorage),
117 DISPATCH_ENTRY_EXT (FramebufferRenderbuffer),
118 DISPATCH_ENTRY_EXT (DeleteRenderbuffers),
119 DISPATCH_ENTRY_EXT (BlitFramebuffer),
120 DISPATCH_ENTRY_LAST
123 cairo_private cairo_gl_dispatch_entry_t dispatch_multisampling_entries[] = {
124 DISPATCH_ENTRY_EXT_IMG (RenderbufferStorageMultisample),
125 DISPATCH_ENTRY_EXT_IMG (FramebufferTexture2DMultisample),
126 DISPATCH_ENTRY_LAST
129 #endif /* CAIRO_GL_DISPATCH_PRIVATE_H */