Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: src/gpu/gl/GrGLAssembleGLESInterface.h

Issue 351583002: Revert of Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/utils/SkWGL.h ('k') | src/gpu/gl/GrGLAssembleInterface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2014 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9 const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
10 GET_PROC_LOCAL(GetString);
11 const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION)) ;
12 GrGLVersion version = GrGLGetVersionFromString(verStr);
13
14 if (version < GR_GL_VER(2,0)) {
15 return NULL;
16 }
17
18 GET_PROC_LOCAL(GetIntegerv);
19 GET_PROC_LOCAL(GetStringi);
20 GrGLExtensions extensions;
21 if (!extensions.init(kGLES_GrGLStandard, GetString, GetStringi, GetIntegerv) ) {
22 return NULL;
23 }
24
25 GrGLInterface* interface = SkNEW(GrGLInterface);
26 GrGLInterface::Functions* functions = &interface->fFunctions;
27
28 GET_LINKED(ActiveTexture);
29 GET_LINKED(AttachShader);
30 GET_LINKED(BindAttribLocation);
31 GET_LINKED(BindBuffer);
32 GET_LINKED(BindTexture);
33 GET_LINKED_SUFFIX(BindVertexArray, OES);
34 GET_LINKED(BlendColor);
35 GET_LINKED(BlendFunc);
36 GET_LINKED(BufferData);
37 GET_LINKED(BufferSubData);
38 GET_LINKED(Clear);
39 GET_LINKED(ClearColor);
40 GET_LINKED(ClearStencil);
41 GET_LINKED(ColorMask);
42 GET_LINKED(CompileShader);
43 GET_LINKED(CompressedTexImage2D);
44 GET_LINKED(CompressedTexSubImage2D);
45 GET_LINKED(CopyTexSubImage2D);
46 GET_LINKED(CreateProgram);
47 GET_LINKED(CreateShader);
48 GET_LINKED(CullFace);
49 GET_LINKED(DeleteBuffers);
50 GET_LINKED(DeleteProgram);
51 GET_LINKED(DeleteShader);
52 GET_LINKED(DeleteTextures);
53 GET_LINKED_SUFFIX(DeleteVertexArrays, OES);
54 GET_LINKED(DepthMask);
55 GET_LINKED(Disable);
56 GET_LINKED(DisableVertexAttribArray);
57 GET_LINKED(DrawArrays);
58 GET_LINKED(DrawElements);
59 GET_LINKED(Enable);
60 GET_LINKED(EnableVertexAttribArray);
61 GET_LINKED(Finish);
62 GET_LINKED(Flush);
63 GET_LINKED(FrontFace);
64 GET_LINKED(GenBuffers);
65 GET_LINKED(GenerateMipmap);
66 GET_LINKED(GenTextures);
67 GET_LINKED_SUFFIX(GenVertexArrays, OES);
68 GET_LINKED(GetBufferParameteriv);
69 GET_LINKED(GetError);
70 GET_LINKED(GetIntegerv);
71 GET_LINKED(GetProgramInfoLog);
72 GET_LINKED(GetProgramiv);
73 GET_LINKED(GetShaderInfoLog);
74 GET_LINKED(GetShaderiv);
75 GET_LINKED(GetString);
76 #if USE_LINKED && GL_ES_VERSION_3_0
77 GET_LINKED(GetStringi);
78 #else
79 GET_PROC(GetStringi);
80 #endif
81 GET_LINKED(GetUniformLocation);
82 GET_LINKED(LineWidth);
83 GET_LINKED(LinkProgram);
84 GET_LINKED(PixelStorei);
85 GET_LINKED(ReadPixels);
86 GET_LINKED(Scissor);
87 #if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE
88 functions->fShaderSource = (GrGLShaderSourceProc) glShaderSource;
89 #else
90 GET_LINKED(ShaderSource);
91 #endif
92 GET_LINKED(StencilFunc);
93 GET_LINKED(StencilFuncSeparate);
94 GET_LINKED(StencilMask);
95 GET_LINKED(StencilMaskSeparate);
96 GET_LINKED(StencilOp);
97 GET_LINKED(StencilOpSeparate);
98 GET_LINKED(TexImage2D);
99 GET_LINKED(TexParameteri);
100 GET_LINKED(TexParameteriv);
101 GET_LINKED(TexSubImage2D);
102
103 if (version >= GR_GL_VER(3,0)) {
104 #if USE_LINKED && GL_ES_VERSION_3_0
105 GET_LINKED(TexStorage2D);
106 #else
107 GET_PROC(TexStorage2D);
108 #endif
109 } else {
110 #if USE_LINKED && GL_EXT_texture_storage
111 GET_LINKED_SUFFIX(TexStorage2D, EXT);
112 #else
113 GET_PROC_SUFFIX(TexStorage2D, EXT);
114 #endif
115 }
116
117 #if USE_LINKED && GL_EXT_discard_framebuffer
118 GET_LINKED_SUFFIX(DiscardFramebuffer, EXT);
119 #endif
120 GET_LINKED(Uniform1f);
121 GET_LINKED(Uniform1i);
122 GET_LINKED(Uniform1fv);
123 GET_LINKED(Uniform1iv);
124 GET_LINKED(Uniform2f);
125 GET_LINKED(Uniform2i);
126 GET_LINKED(Uniform2fv);
127 GET_LINKED(Uniform2iv);
128 GET_LINKED(Uniform3f);
129 GET_LINKED(Uniform3i);
130 GET_LINKED(Uniform3fv);
131 GET_LINKED(Uniform3iv);
132 GET_LINKED(Uniform4f);
133 GET_LINKED(Uniform4i);
134 GET_LINKED(Uniform4fv);
135 GET_LINKED(Uniform4iv);
136 GET_LINKED(UniformMatrix2fv);
137 GET_LINKED(UniformMatrix3fv);
138 GET_LINKED(UniformMatrix4fv);
139 GET_LINKED(UseProgram);
140 GET_LINKED(VertexAttrib4fv);
141 GET_LINKED(VertexAttribPointer);
142 GET_LINKED(Viewport);
143 GET_LINKED(BindFramebuffer);
144 GET_LINKED(BindRenderbuffer);
145 GET_LINKED(CheckFramebufferStatus);
146 GET_LINKED(DeleteFramebuffers);
147 GET_LINKED(DeleteRenderbuffers);
148 GET_LINKED(FramebufferRenderbuffer);
149 GET_LINKED(FramebufferTexture2D);
150
151 if (version >= GR_GL_VER(3,0)) {
152 #if USE_LINKED && GL_ES_VERSION_3_0
153 GET_LINKED(RenderbufferStorageMultisample);
154 GET_LINKED(BlitFramebuffer);
155 #else
156 GET_PROC(RenderbufferStorageMultisample);
157 GET_PROC(BlitFramebuffer);
158 #endif
159 }
160
161 if (extensions.has("GL_EXT_multisampled_render_to_texture")) {
162 #if USE_LINKED && GL_EXT_multisampled_render_to_texture
163 GET_LINKED_SUFFIX(FramebufferTexture2DMultisample, EXT);
164 functions->fRenderbufferStorageMultisampleES2EXT = glRenderbufferStorage MultisampleEXT;
165 #else
166 GET_PROC_SUFFIX(FramebufferTexture2DMultisample, EXT);
167 functions->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStor ageMultisampleProc) get(ctx, "glRenderbufferStorageMultisampleEXT");
168 #endif
169 } else if (extensions.has("GL_IMG_multisampled_render_to_texture")) {
170 #if USE_LINKED && GL_IMG_multisampled_render_to_texture
171 GET_LINKED_SUFFIX(FramebufferTexture2DMultisample, IMG);
172 functions->fRenderbufferStorageMultisampleES2EXT = glRenderbufferStorage MultisampleIMG;
173 #else
174 GET_PROC_SUFFIX(FramebufferTexture2DMultisample, IMG);
175 functions->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStor ageMultisampleProc) get(ctx, "glRenderbufferStorageMultisampleIMG");
176 #endif
177 }
178
179 GET_LINKED(GenFramebuffers);
180 GET_LINKED(GenRenderbuffers);
181 GET_LINKED(GetFramebufferAttachmentParameteriv);
182 GET_LINKED(GetRenderbufferParameteriv);
183 GET_LINKED(RenderbufferStorage);
184
185 #if USE_LINKED && GL_OES_mapbuffer
186 GET_LINKED_SUFFIX(MapBuffer, OES);
187 GET_LINKED_SUFFIX(UnmapBuffer, OES);
188 #else
189 GET_PROC_SUFFIX(MapBuffer, OES);
190 GET_PROC_SUFFIX(UnmapBuffer, OES);
191 #endif
192
193 if (version >= GR_GL_VER(3,0)) {
194 #if USE_LINKED && GL_ES_VERSION_3_0
195 GET_LINKED(MapBufferRange);
196 GET_LINKED(FlushMappedBufferRange);
197 #else
198 GET_PROC(MapBufferRange);
199 GET_PROC(FlushMappedBufferRange);
200 #endif
201 } else if (extensions.has("GL_EXT_map_buffer_range")) {
202 #if USE_LINKED && GL_EXT_map_buffer_range
203 GET_LINKED_SUFFIX(MapBufferRange, EXT);
204 GET_LINKED_SUFFIX(FlushMappedBufferRange, EXT);
205 #else
206 GET_PROC_SUFFIX(MapBufferRange, EXT);
207 GET_PROC_SUFFIX(FlushMappedBufferRange, EXT);
208 #endif
209 }
210
211 if (extensions.has("GL_EXT_debug_marker")) {
212 GET_PROC(InsertEventMarker);
213 GET_PROC(PushGroupMarker);
214 GET_PROC(PopGroupMarker);
215 // The below check is here because a device has been found that has the extension string but
216 // returns NULL from the eglGetProcAddress for the functions
217 if (NULL == functions->fInsertEventMarker ||
218 NULL == functions->fPushGroupMarker ||
219 NULL == functions->fPopGroupMarker) {
220 extensions.remove("GL_EXT_debug_marker");
221 }
222 }
223
224 #if USE_LINKED && GL_ES_VERSION_3_0
225 GET_LINKED(InvalidateFramebuffer);
226 GET_LINKED(InvalidateSubFramebuffer);
227 #else
228 GET_PROC(InvalidateFramebuffer);
229 GET_PROC(InvalidateSubFramebuffer);
230 #endif
231 GET_PROC(InvalidateBufferData);
232 GET_PROC(InvalidateBufferSubData);
233 GET_PROC(InvalidateTexImage);
234 GET_PROC(InvalidateTexSubImage);
235
236 interface->fStandard = kGLES_GrGLStandard;
237 interface->fExtensions.swap(&extensions);
238
239 return interface;
240 }
OLDNEW
« no previous file with comments | « include/utils/SkWGL.h ('k') | src/gpu/gl/GrGLAssembleInterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698