blob: 024c9ccf4e2236c181880c815ff58cc770715470 (
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
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"
#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
#endif
#include "gpu/GLES2/gl2extchromium.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
namespace skia_bindings {
GrGLInterface* CreateCommandBufferSkiaGLBinding() {
GrGLInterface* interface = new GrGLInterface;
interface->fStandard = kGLES_GrGLStandard;
interface->fExtensions.init(kGLES_GrGLStandard,
glGetString,
NULL,
glGetIntegerv);
GrGLInterface::Functions* functions = &interface->fFunctions;
functions->fActiveTexture = glActiveTexture;
functions->fAttachShader = glAttachShader;
functions->fBindAttribLocation = glBindAttribLocation;
functions->fBindBuffer = glBindBuffer;
functions->fBindTexture = glBindTexture;
functions->fBindVertexArray = glBindVertexArrayOES;
functions->fBlendBarrier = glBlendBarrierKHR;
functions->fBlendColor = glBlendColor;
functions->fBlendEquation = glBlendEquation;
functions->fBlendFunc = glBlendFunc;
functions->fBufferData = glBufferData;
functions->fBufferSubData = glBufferSubData;
functions->fClear = glClear;
functions->fClearColor = glClearColor;
functions->fClearStencil = glClearStencil;
functions->fColorMask = glColorMask;
functions->fCompileShader = glCompileShader;
functions->fCompressedTexImage2D = glCompressedTexImage2D;
functions->fCopyTexSubImage2D = glCopyTexSubImage2D;
functions->fCreateProgram = glCreateProgram;
functions->fCreateShader = glCreateShader;
functions->fCullFace = glCullFace;
functions->fDeleteBuffers = glDeleteBuffers;
functions->fDeleteProgram = glDeleteProgram;
functions->fDeleteShader = glDeleteShader;
functions->fDeleteTextures = glDeleteTextures;
functions->fDeleteVertexArrays = glDeleteVertexArraysOES;
functions->fDepthMask = glDepthMask;
functions->fDisable = glDisable;
functions->fDisableVertexAttribArray = glDisableVertexAttribArray;
functions->fDiscardFramebuffer = glDiscardFramebufferEXT;
functions->fDrawArrays = glDrawArrays;
functions->fDrawElements = glDrawElements;
functions->fEnable = glEnable;
functions->fEnableVertexAttribArray = glEnableVertexAttribArray;
functions->fFinish = glFinish;
functions->fFlush = glFlush;
functions->fFrontFace = glFrontFace;
functions->fGenBuffers = glGenBuffers;
functions->fGenTextures = glGenTextures;
functions->fGenVertexArrays = glGenVertexArraysOES;
functions->fGetBufferParameteriv = glGetBufferParameteriv;
functions->fGetError = glGetError;
functions->fGetIntegerv = glGetIntegerv;
functions->fGetProgramInfoLog = glGetProgramInfoLog;
functions->fGetProgramiv = glGetProgramiv;
functions->fGetShaderInfoLog = glGetShaderInfoLog;
functions->fGetShaderiv = glGetShaderiv;
functions->fGetShaderPrecisionFormat = glGetShaderPrecisionFormat;
functions->fGetString = glGetString;
functions->fGetUniformLocation = glGetUniformLocation;
functions->fInsertEventMarker = glInsertEventMarkerEXT;
functions->fLineWidth = glLineWidth;
functions->fLinkProgram = glLinkProgram;
functions->fMapBufferSubData = glMapBufferSubDataCHROMIUM;
functions->fMapTexSubImage2D = glMapTexSubImage2DCHROMIUM;
functions->fPixelStorei = glPixelStorei;
functions->fPopGroupMarker = glPopGroupMarkerEXT;
functions->fPushGroupMarker = glPushGroupMarkerEXT;
functions->fReadPixels = glReadPixels;
functions->fScissor = glScissor;
functions->fShaderSource = glShaderSource;
functions->fStencilFunc = glStencilFunc;
functions->fStencilFuncSeparate = glStencilFuncSeparate;
functions->fStencilMask = glStencilMask;
functions->fStencilMaskSeparate = glStencilMaskSeparate;
functions->fStencilOp = glStencilOp;
functions->fStencilOpSeparate = glStencilOpSeparate;
functions->fTexImage2D = glTexImage2D;
functions->fTexParameteri = glTexParameteri;
functions->fTexParameteriv = glTexParameteriv;
functions->fTexStorage2D = glTexStorage2DEXT;
functions->fTexSubImage2D = glTexSubImage2D;
functions->fUniform1f = glUniform1f;
functions->fUniform1i = glUniform1i;
functions->fUniform1fv = glUniform1fv;
functions->fUniform1iv = glUniform1iv;
functions->fUniform2f = glUniform2f;
functions->fUniform2i = glUniform2i;
functions->fUniform2fv = glUniform2fv;
functions->fUniform2iv = glUniform2iv;
functions->fUniform3f = glUniform3f;
functions->fUniform3i = glUniform3i;
functions->fUniform3fv = glUniform3fv;
functions->fUniform3iv = glUniform3iv;
functions->fUniform4f = glUniform4f;
functions->fUniform4i = glUniform4i;
functions->fUniform4fv = glUniform4fv;
functions->fUniform4iv = glUniform4iv;
functions->fUniformMatrix2fv = glUniformMatrix2fv;
functions->fUniformMatrix3fv = glUniformMatrix3fv;
functions->fUniformMatrix4fv = glUniformMatrix4fv;
functions->fUnmapBufferSubData = glUnmapBufferSubDataCHROMIUM;
functions->fUnmapTexSubImage2D = glUnmapTexSubImage2DCHROMIUM;
functions->fUseProgram = glUseProgram;
functions->fVertexAttrib1f = glVertexAttrib1f;
functions->fVertexAttrib2fv = glVertexAttrib2fv;
functions->fVertexAttrib3fv = glVertexAttrib3fv;
functions->fVertexAttrib4fv = glVertexAttrib4fv;
functions->fVertexAttribPointer = glVertexAttribPointer;
functions->fViewport = glViewport;
functions->fBindFramebuffer = glBindFramebuffer;
functions->fBindRenderbuffer = glBindRenderbuffer;
functions->fCheckFramebufferStatus = glCheckFramebufferStatus;
functions->fDeleteFramebuffers = glDeleteFramebuffers;
functions->fDeleteRenderbuffers = glDeleteRenderbuffers;
functions->fFramebufferRenderbuffer = glFramebufferRenderbuffer;
functions->fFramebufferTexture2D = glFramebufferTexture2D;
functions->fFramebufferTexture2DMultisample =
glFramebufferTexture2DMultisampleEXT;
functions->fGenFramebuffers = glGenFramebuffers;
functions->fGenRenderbuffers = glGenRenderbuffers;
functions->fGetFramebufferAttachmentParameteriv =
glGetFramebufferAttachmentParameteriv;
functions->fGetRenderbufferParameteriv = glGetRenderbufferParameteriv;
functions->fRenderbufferStorage = glRenderbufferStorage;
functions->fRenderbufferStorageMultisample =
glRenderbufferStorageMultisampleCHROMIUM;
functions->fRenderbufferStorageMultisampleES2EXT =
glRenderbufferStorageMultisampleEXT;
functions->fBindUniformLocation = glBindUniformLocationCHROMIUM;
functions->fBlitFramebuffer = glBlitFramebufferCHROMIUM;
functions->fGenerateMipmap = glGenerateMipmap;
if (false) {
// These are disabled until the full extension is implemented.
// Otherwise the interface fails validation and the context can not
// be created.
functions->fMatrixLoadf = glMatrixLoadfCHROMIUM;
functions->fMatrixLoadIdentity = glMatrixLoadIdentityCHROMIUM;
functions->fPathCommands = glPathCommandsCHROMIUM;
functions->fPathParameteri = glPathParameteriCHROMIUM;
functions->fPathParameterf = glPathParameterfCHROMIUM;
functions->fGenPaths = glGenPathsCHROMIUM;
functions->fIsPath = glIsPathCHROMIUM;
functions->fDeletePaths = glDeletePathsCHROMIUM;
functions->fPathStencilFunc = glPathStencilFuncCHROMIUM;
functions->fStencilFillPath = glStencilFillPathCHROMIUM;
functions->fStencilStrokePath = glStencilStrokePathCHROMIUM;
functions->fCoverFillPath = glCoverFillPathCHROMIUM;
functions->fCoverStrokePath = glCoverStrokePathCHROMIUM;
functions->fStencilThenCoverFillPath = glStencilThenCoverFillPathCHROMIUM;
functions->fStencilThenCoverStrokePath =
glStencilThenCoverStrokePathCHROMIUM;
}
return interface;
}
} // namespace skia
|