blob: 6cfa8c29d08ca2bc7e4dff1a2cd6ea94ebb58448 [file] [log] [blame]
bsalomon@google.com74913722011-10-27 20:44:19 +00001/*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8
tomhudson@google.com6bf38b52012-02-14 15:11:59 +00009#include "gl/GrGLInterface.h"
bsalomon@google.com91bcc942012-05-07 17:28:41 +000010#include "GrGLDefines.h"
bsalomon@google.com21cbec42013-01-07 17:23:00 +000011#include "SkTDArray.h"
bsalomon@google.com8f943612013-02-26 14:34:43 +000012#include "GrGLNoOpInterface.h"
13
14// Functions not declared in GrGLBogusInterface.h (not common with the Debug GL interface).
bsalomon@google.com74913722011-10-27 20:44:19 +000015
caryclark@google.comcf6285b2012-06-06 12:09:01 +000016namespace { // added to suppress 'no previous prototype' warning
17
robertphillips@google.comd6543e52013-07-18 17:39:14 +000018class GrBufferObj {
19public:
20 GrBufferObj(GrGLuint id) : fID(id), fDataPtr(NULL), fSize(0), fMapped(false) {
21 }
22 ~GrBufferObj() { SkDELETE_ARRAY(fDataPtr); }
23
robertphillips@google.comae6b7772013-07-18 18:07:39 +000024 void allocate(GrGLsizeiptr size, const GrGLchar* dataPtr) {
robertphillips@google.comd6543e52013-07-18 17:39:14 +000025 if (NULL != fDataPtr) {
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +000026 SkASSERT(0 != fSize);
robertphillips@google.comd6543e52013-07-18 17:39:14 +000027 SkDELETE_ARRAY(fDataPtr);
28 }
29
30 fSize = size;
31 fDataPtr = SkNEW_ARRAY(char, size);
32 }
33
34 GrGLuint id() const { return fID; }
35 GrGLchar* dataPtr() { return fDataPtr; }
robertphillips@google.comae6b7772013-07-18 18:07:39 +000036 GrGLsizeiptr size() const { return fSize; }
robertphillips@google.comd6543e52013-07-18 17:39:14 +000037
38 void setMapped(bool mapped) { fMapped = mapped; }
39 bool mapped() const { return fMapped; }
40
41private:
42 GrGLuint fID;
43 GrGLchar* fDataPtr;
robertphillips@google.comae6b7772013-07-18 18:07:39 +000044 GrGLsizeiptr fSize; // size in bytes
robertphillips@google.comd6543e52013-07-18 17:39:14 +000045 bool fMapped;
46};
47
48// In debug builds we do asserts that ensure we agree with GL about when a buffer
49// is mapped.
50static SkTDArray<GrBufferObj*> gBuffers; // slot 0 is reserved for head of free list
51static GrGLuint gCurrArrayBuffer;
52static GrGLuint gCurrElementArrayBuffer;
53
54static GrBufferObj* look_up(GrGLuint id) {
55 GrBufferObj* buffer = gBuffers[id];
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +000056 SkASSERT(NULL != buffer && buffer->id() == id);
robertphillips@google.comd6543e52013-07-18 17:39:14 +000057 return buffer;
58}
59
60static GrBufferObj* create_buffer() {
61 if (0 == gBuffers.count()) {
62 // slot zero is reserved for the head of the free list
63 *gBuffers.append() = NULL;
64 }
65
66 GrGLuint id;
67 GrBufferObj* buffer;
68
69 if (NULL == gBuffers[0]) {
70 // no free slots - create a new one
71 id = gBuffers.count();
72 buffer = SkNEW_ARGS(GrBufferObj, (id));
73 gBuffers.append(1, &buffer);
74 } else {
75 // recycle a slot from the free list
robertphillips@google.comae6b7772013-07-18 18:07:39 +000076 id = SkTCast<GrGLuint>(gBuffers[0]);
robertphillips@google.comd6543e52013-07-18 17:39:14 +000077 gBuffers[0] = gBuffers[id];
78
79 buffer = SkNEW_ARGS(GrBufferObj, (id));
80 gBuffers[id] = buffer;
81 }
82
83 return buffer;
84}
85
86static void delete_buffer(GrBufferObj* buffer) {
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +000087 SkASSERT(gBuffers.count() > 0);
robertphillips@google.comd6543e52013-07-18 17:39:14 +000088
89 GrGLuint id = buffer->id();
90 SkDELETE(buffer);
91
92 // Add this slot to the free list
93 gBuffers[id] = gBuffers[0];
robertphillips@google.comd6bcfa32013-07-18 18:33:39 +000094 gBuffers[0] = SkTCast<GrBufferObj*>((const void*)(intptr_t)id);
robertphillips@google.comd6543e52013-07-18 17:39:14 +000095}
96
bsalomon@google.com74913722011-10-27 20:44:19 +000097GrGLvoid GR_GL_FUNCTION_TYPE nullGLActiveTexture(GrGLenum texture) {}
98GrGLvoid GR_GL_FUNCTION_TYPE nullGLAttachShader(GrGLuint program, GrGLuint shader) {}
99GrGLvoid GR_GL_FUNCTION_TYPE nullGLBeginQuery(GrGLenum target, GrGLuint id) {}
100GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindAttribLocation(GrGLuint program, GrGLuint index, const char* name) {}
101GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindTexture(GrGLenum target, GrGLuint texture) {}
bsalomon@google.comecd84842013-03-01 15:36:02 +0000102GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindVertexArray(GrGLuint id) {}
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000103
104GrGLvoid GR_GL_FUNCTION_TYPE nullGLGenBuffers(GrGLsizei n, GrGLuint* ids) {
105
106 for (int i = 0; i < n; ++i) {
107 GrBufferObj* buffer = create_buffer();
108 ids[i] = buffer->id();
109 }
110}
111
commit-bot@chromium.orgcffff792013-07-26 16:36:04 +0000112GrGLvoid GR_GL_FUNCTION_TYPE nullGLGenerateMipmap(GrGLenum target) {}
113
skia.committer@gmail.coma7991982013-07-19 07:00:57 +0000114GrGLvoid GR_GL_FUNCTION_TYPE nullGLBufferData(GrGLenum target,
115 GrGLsizeiptr size,
116 const GrGLvoid* data,
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000117 GrGLenum usage) {
118 GrGLuint id = 0;
119
120 switch (target) {
121 case GR_GL_ARRAY_BUFFER:
122 id = gCurrArrayBuffer;
123 break;
124 case GR_GL_ELEMENT_ARRAY_BUFFER:
125 id = gCurrElementArrayBuffer;
126 break;
127 default:
commit-bot@chromium.org88cb22b2014-04-30 14:17:00 +0000128 SkFAIL("Unexpected target to nullGLBufferData");
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000129 break;
130 }
131
132 if (id > 0) {
133 GrBufferObj* buffer = look_up(id);
134 buffer->allocate(size, (const GrGLchar*) data);
135 }
136}
137
bsalomon@google.com74913722011-10-27 20:44:19 +0000138GrGLvoid GR_GL_FUNCTION_TYPE nullGLPixelStorei(GrGLenum pname, GrGLint param) {}
bsalomon@google.com74913722011-10-27 20:44:19 +0000139GrGLvoid GR_GL_FUNCTION_TYPE nullGLReadPixels(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels) {}
bsalomon@google.com74913722011-10-27 20:44:19 +0000140GrGLvoid GR_GL_FUNCTION_TYPE nullGLUseProgram(GrGLuint program) {}
bsalomon@google.com74913722011-10-27 20:44:19 +0000141GrGLvoid GR_GL_FUNCTION_TYPE nullGLViewport(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height) {}
142GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindFramebuffer(GrGLenum target, GrGLuint framebuffer) {}
143GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindRenderbuffer(GrGLenum target, GrGLuint renderbuffer) {}
144GrGLvoid GR_GL_FUNCTION_TYPE nullGLDeleteFramebuffers(GrGLsizei n, const GrGLuint *framebuffers) {}
145GrGLvoid GR_GL_FUNCTION_TYPE nullGLDeleteRenderbuffers(GrGLsizei n, const GrGLuint *renderbuffers) {}
146GrGLvoid GR_GL_FUNCTION_TYPE nullGLFramebufferRenderbuffer(GrGLenum target, GrGLenum attachment, GrGLenum renderbuffertarget, GrGLuint renderbuffer) {}
147GrGLvoid GR_GL_FUNCTION_TYPE nullGLFramebufferTexture2D(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level) {}
bsalomon@google.com74913722011-10-27 20:44:19 +0000148
149GrGLuint GR_GL_FUNCTION_TYPE nullGLCreateProgram() {
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000150 static GrGLuint gCurrID = 0;
bsalomon@google.com74913722011-10-27 20:44:19 +0000151 return ++gCurrID;
152}
153
154GrGLuint GR_GL_FUNCTION_TYPE nullGLCreateShader(GrGLenum type) {
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000155 static GrGLuint gCurrID = 0;
bsalomon@google.com74913722011-10-27 20:44:19 +0000156 return ++gCurrID;
157}
158
159// same delete used for shaders and programs
160GrGLvoid GR_GL_FUNCTION_TYPE nullGLDelete(GrGLuint program) {
161}
162
bsalomon@google.com74913722011-10-27 20:44:19 +0000163GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindBuffer(GrGLenum target, GrGLuint buffer) {
164 switch (target) {
165 case GR_GL_ARRAY_BUFFER:
166 gCurrArrayBuffer = buffer;
167 break;
168 case GR_GL_ELEMENT_ARRAY_BUFFER:
169 gCurrElementArrayBuffer = buffer;
170 break;
171 }
172}
173
174// deleting a bound buffer has the side effect of binding 0
175GrGLvoid GR_GL_FUNCTION_TYPE nullGLDeleteBuffers(GrGLsizei n, const GrGLuint* ids) {
176 for (int i = 0; i < n; ++i) {
177 if (ids[i] == gCurrArrayBuffer) {
178 gCurrArrayBuffer = 0;
179 }
180 if (ids[i] == gCurrElementArrayBuffer) {
181 gCurrElementArrayBuffer = 0;
182 }
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000183
184 GrBufferObj* buffer = look_up(ids[i]);
185 delete_buffer(buffer);
bsalomon@google.com74913722011-10-27 20:44:19 +0000186 }
187}
188
commit-bot@chromium.orgf9deb8a2014-05-02 15:08:18 +0000189GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBufferRange(GrGLenum target, GrGLintptr offset,
190 GrGLsizeiptr length, GrGLbitfield access) {
191 GrGLuint id = 0;
192 switch (target) {
193 case GR_GL_ARRAY_BUFFER:
194 id = gCurrArrayBuffer;
195 break;
196 case GR_GL_ELEMENT_ARRAY_BUFFER:
197 id = gCurrElementArrayBuffer;
198 break;
199 }
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000200
commit-bot@chromium.orgf9deb8a2014-05-02 15:08:18 +0000201 if (id > 0) {
202 // We just ignore the offset and length here.
203 GrBufferObj* buffer = look_up(id);
204 SkASSERT(!buffer->mapped());
205 buffer->setMapped(true);
206 return buffer->dataPtr();
207 }
208 return NULL;
209}
210
211GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access) {
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000212 GrGLuint id = 0;
bsalomon@google.com74913722011-10-27 20:44:19 +0000213 switch (target) {
214 case GR_GL_ARRAY_BUFFER:
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000215 id = gCurrArrayBuffer;
bsalomon@google.com74913722011-10-27 20:44:19 +0000216 break;
217 case GR_GL_ELEMENT_ARRAY_BUFFER:
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000218 id = gCurrElementArrayBuffer;
bsalomon@google.com74913722011-10-27 20:44:19 +0000219 break;
220 }
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000221
222 if (id > 0) {
223 GrBufferObj* buffer = look_up(id);
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000224 SkASSERT(!buffer->mapped());
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000225 buffer->setMapped(true);
226 return buffer->dataPtr();
bsalomon@google.com74913722011-10-27 20:44:19 +0000227 }
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000228
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000229 SkASSERT(false);
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000230 return NULL; // no buffer bound to target
bsalomon@google.com74913722011-10-27 20:44:19 +0000231}
232
commit-bot@chromium.orgf9deb8a2014-05-02 15:08:18 +0000233GrGLvoid GR_GL_FUNCTION_TYPE nullGLFlushMappedBufferRange(GrGLenum target,
234 GrGLintptr offset,
235 GrGLsizeiptr length) {}
236
237
bsalomon@google.com74913722011-10-27 20:44:19 +0000238GrGLboolean GR_GL_FUNCTION_TYPE nullGLUnmapBuffer(GrGLenum target) {
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000239 GrGLuint id = 0;
bsalomon@google.com74913722011-10-27 20:44:19 +0000240 switch (target) {
241 case GR_GL_ARRAY_BUFFER:
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000242 id = gCurrArrayBuffer;
bsalomon@google.com74913722011-10-27 20:44:19 +0000243 break;
244 case GR_GL_ELEMENT_ARRAY_BUFFER:
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000245 id = gCurrElementArrayBuffer;
bsalomon@google.com74913722011-10-27 20:44:19 +0000246 break;
247 }
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000248 if (id > 0) {
249 GrBufferObj* buffer = look_up(id);
tfarina@chromium.orgf6de4752013-08-17 00:02:59 +0000250 SkASSERT(buffer->mapped());
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000251 buffer->setMapped(false);
252 return GR_GL_TRUE;
bsalomon@google.com74913722011-10-27 20:44:19 +0000253 }
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000254
255 GrAlwaysAssert(false);
256 return GR_GL_FALSE; // GR_GL_INVALID_OPERATION;
bsalomon@google.com74913722011-10-27 20:44:19 +0000257}
258
259GrGLvoid GR_GL_FUNCTION_TYPE nullGLGetBufferParameteriv(GrGLenum target, GrGLenum pname, GrGLint* params) {
260 switch (pname) {
261 case GR_GL_BUFFER_MAPPED: {
262 *params = GR_GL_FALSE;
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000263 GrGLuint id = 0;
bsalomon@google.com74913722011-10-27 20:44:19 +0000264 switch (target) {
265 case GR_GL_ARRAY_BUFFER:
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000266 id = gCurrArrayBuffer;
bsalomon@google.com74913722011-10-27 20:44:19 +0000267 break;
268 case GR_GL_ELEMENT_ARRAY_BUFFER:
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000269 id = gCurrElementArrayBuffer;
rmistry@google.comfbfcd562012-08-23 18:09:54 +0000270 break;
bsalomon@google.com74913722011-10-27 20:44:19 +0000271 }
robertphillips@google.comd6543e52013-07-18 17:39:14 +0000272 if (id > 0) {
273 GrBufferObj* buffer = look_up(id);
274 if (buffer->mapped()) {
275 *params = GR_GL_TRUE;
bsalomon@google.com74913722011-10-27 20:44:19 +0000276 }
277 }
278 break; }
279 default:
commit-bot@chromium.org88cb22b2014-04-30 14:17:00 +0000280 SkFAIL("Unexpected pname to GetBufferParamateriv");
bsalomon@google.com74913722011-10-27 20:44:19 +0000281 break;
282 }
283};
284
caryclark@google.comcf6285b2012-06-06 12:09:01 +0000285} // end anonymous namespace
286
bsalomon@google.com74913722011-10-27 20:44:19 +0000287const GrGLInterface* GrGLCreateNullInterface() {
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +0000288 GrGLInterface* interface = SkNEW(GrGLInterface);
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000289
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +0000290 interface->fStandard = kGL_GrGLStandard;
commit-bot@chromium.orgc72425a2014-01-21 16:09:18 +0000291
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +0000292 GrGLInterface::Functions* functions = &interface->fFunctions;
293 functions->fActiveTexture = nullGLActiveTexture;
294 functions->fAttachShader = nullGLAttachShader;
295 functions->fBeginQuery = nullGLBeginQuery;
296 functions->fBindAttribLocation = nullGLBindAttribLocation;
297 functions->fBindBuffer = nullGLBindBuffer;
298 functions->fBindFragDataLocation = noOpGLBindFragDataLocation;
299 functions->fBindTexture = nullGLBindTexture;
300 functions->fBindVertexArray = nullGLBindVertexArray;
301 functions->fBlendColor = noOpGLBlendColor;
302 functions->fBlendFunc = noOpGLBlendFunc;
303 functions->fBufferData = nullGLBufferData;
304 functions->fBufferSubData = noOpGLBufferSubData;
305 functions->fClear = noOpGLClear;
306 functions->fClearColor = noOpGLClearColor;
307 functions->fClearStencil = noOpGLClearStencil;
308 functions->fColorMask = noOpGLColorMask;
309 functions->fCompileShader = noOpGLCompileShader;
310 functions->fCompressedTexImage2D = noOpGLCompressedTexImage2D;
311 functions->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D;
312 functions->fCreateProgram = nullGLCreateProgram;
313 functions->fCreateShader = nullGLCreateShader;
314 functions->fCullFace = noOpGLCullFace;
315 functions->fDeleteBuffers = nullGLDeleteBuffers;
316 functions->fDeleteProgram = nullGLDelete;
317 functions->fDeleteQueries = noOpGLDeleteIds;
318 functions->fDeleteShader = nullGLDelete;
319 functions->fDeleteTextures = noOpGLDeleteIds;
320 functions->fDeleteVertexArrays = noOpGLDeleteIds;
321 functions->fDepthMask = noOpGLDepthMask;
322 functions->fDisable = noOpGLDisable;
323 functions->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray;
324 functions->fDrawArrays = noOpGLDrawArrays;
325 functions->fDrawBuffer = noOpGLDrawBuffer;
326 functions->fDrawBuffers = noOpGLDrawBuffers;
327 functions->fDrawElements = noOpGLDrawElements;
328 functions->fEnable = noOpGLEnable;
329 functions->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray;
330 functions->fEndQuery = noOpGLEndQuery;
331 functions->fFinish = noOpGLFinish;
332 functions->fFlush = noOpGLFlush;
commit-bot@chromium.orgf9deb8a2014-05-02 15:08:18 +0000333 functions->fFlushMappedBufferRange = nullGLFlushMappedBufferRange;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +0000334 functions->fFrontFace = noOpGLFrontFace;
335 functions->fGenBuffers = nullGLGenBuffers;
336 functions->fGenerateMipmap = nullGLGenerateMipmap;
337 functions->fGenQueries = noOpGLGenIds;
338 functions->fGenTextures = noOpGLGenIds;
339 functions->fGenVertexArrays = noOpGLGenIds;
340 functions->fGetBufferParameteriv = nullGLGetBufferParameteriv;
341 functions->fGetError = noOpGLGetError;
342 functions->fGetIntegerv = noOpGLGetIntegerv;
343 functions->fGetQueryObjecti64v = noOpGLGetQueryObjecti64v;
344 functions->fGetQueryObjectiv = noOpGLGetQueryObjectiv;
345 functions->fGetQueryObjectui64v = noOpGLGetQueryObjectui64v;
346 functions->fGetQueryObjectuiv = noOpGLGetQueryObjectuiv;
347 functions->fGetQueryiv = noOpGLGetQueryiv;
348 functions->fGetProgramInfoLog = noOpGLGetInfoLog;
349 functions->fGetProgramiv = noOpGLGetShaderOrProgramiv;
350 functions->fGetShaderInfoLog = noOpGLGetInfoLog;
351 functions->fGetShaderiv = noOpGLGetShaderOrProgramiv;
352 functions->fGetString = noOpGLGetString;
353 functions->fGetStringi = noOpGLGetStringi;
354 functions->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv;
355 functions->fGetUniformLocation = noOpGLGetUniformLocation;
356 functions->fInsertEventMarker = noOpGLInsertEventMarker;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +0000357 functions->fLineWidth = noOpGLLineWidth;
358 functions->fLinkProgram = noOpGLLinkProgram;
commit-bot@chromium.orgf9deb8a2014-05-02 15:08:18 +0000359 functions->fMapBuffer = nullGLMapBuffer;
360 functions->fMapBufferRange = nullGLMapBufferRange;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +0000361 functions->fPixelStorei = nullGLPixelStorei;
362 functions->fPopGroupMarker = noOpGLPopGroupMarker;
363 functions->fPushGroupMarker = noOpGLPushGroupMarker;
364 functions->fQueryCounter = noOpGLQueryCounter;
365 functions->fReadBuffer = noOpGLReadBuffer;
366 functions->fReadPixels = nullGLReadPixels;
367 functions->fScissor = noOpGLScissor;
368 functions->fShaderSource = noOpGLShaderSource;
369 functions->fStencilFunc = noOpGLStencilFunc;
370 functions->fStencilFuncSeparate = noOpGLStencilFuncSeparate;
371 functions->fStencilMask = noOpGLStencilMask;
372 functions->fStencilMaskSeparate = noOpGLStencilMaskSeparate;
373 functions->fStencilOp = noOpGLStencilOp;
374 functions->fStencilOpSeparate = noOpGLStencilOpSeparate;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +0000375 functions->fTexImage2D = noOpGLTexImage2D;
376 functions->fTexParameteri = noOpGLTexParameteri;
377 functions->fTexParameteriv = noOpGLTexParameteriv;
378 functions->fTexSubImage2D = noOpGLTexSubImage2D;
379 functions->fTexStorage2D = noOpGLTexStorage2D;
380 functions->fDiscardFramebuffer = noOpGLDiscardFramebuffer;
381 functions->fUniform1f = noOpGLUniform1f;
382 functions->fUniform1i = noOpGLUniform1i;
383 functions->fUniform1fv = noOpGLUniform1fv;
384 functions->fUniform1iv = noOpGLUniform1iv;
385 functions->fUniform2f = noOpGLUniform2f;
386 functions->fUniform2i = noOpGLUniform2i;
387 functions->fUniform2fv = noOpGLUniform2fv;
388 functions->fUniform2iv = noOpGLUniform2iv;
389 functions->fUniform3f = noOpGLUniform3f;
390 functions->fUniform3i = noOpGLUniform3i;
391 functions->fUniform3fv = noOpGLUniform3fv;
392 functions->fUniform3iv = noOpGLUniform3iv;
393 functions->fUniform4f = noOpGLUniform4f;
394 functions->fUniform4i = noOpGLUniform4i;
395 functions->fUniform4fv = noOpGLUniform4fv;
396 functions->fUniform4iv = noOpGLUniform4iv;
397 functions->fUniformMatrix2fv = noOpGLUniformMatrix2fv;
398 functions->fUniformMatrix3fv = noOpGLUniformMatrix3fv;
399 functions->fUniformMatrix4fv = noOpGLUniformMatrix4fv;
commit-bot@chromium.orgf9deb8a2014-05-02 15:08:18 +0000400 functions->fUnmapBuffer = nullGLUnmapBuffer;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +0000401 functions->fUseProgram = nullGLUseProgram;
402 functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv;
403 functions->fVertexAttribPointer = noOpGLVertexAttribPointer;
404 functions->fViewport = nullGLViewport;
405 functions->fBindFramebuffer = nullGLBindFramebuffer;
406 functions->fBindRenderbuffer = nullGLBindRenderbuffer;
407 functions->fCheckFramebufferStatus = noOpGLCheckFramebufferStatus;
408 functions->fDeleteFramebuffers = nullGLDeleteFramebuffers;
409 functions->fDeleteRenderbuffers = nullGLDeleteRenderbuffers;
410 functions->fFramebufferRenderbuffer = nullGLFramebufferRenderbuffer;
411 functions->fFramebufferTexture2D = nullGLFramebufferTexture2D;
412 functions->fGenFramebuffers = noOpGLGenIds;
413 functions->fGenRenderbuffers = noOpGLGenIds;
414 functions->fGetFramebufferAttachmentParameteriv = noOpGLGetFramebufferAttachmentParameteriv;
415 functions->fGetRenderbufferParameteriv = noOpGLGetRenderbufferParameteriv;
416 functions->fRenderbufferStorage = noOpGLRenderbufferStorage;
417 functions->fRenderbufferStorageMultisample = noOpGLRenderbufferStorageMultisample;
418 functions->fBlitFramebuffer = noOpGLBlitFramebuffer;
419 functions->fResolveMultisampleFramebuffer = noOpGLResolveMultisampleFramebuffer;
commit-bot@chromium.orgf6696722014-04-25 06:21:30 +0000420 functions->fMatrixLoadf = noOpGLMatrixLoadf;
421 functions->fMatrixLoadIdentity = noOpGLMatrixLoadIdentity;
commit-bot@chromium.orgf5355612014-02-28 20:28:50 +0000422 functions->fBindFragDataLocationIndexed = noOpGLBindFragDataLocationIndexed;
423
424 interface->fExtensions.init(kGL_GrGLStandard, functions->fGetString, functions->fGetStringi,
425 functions->fGetIntegerv);
426 return interface;
bsalomon@google.com74913722011-10-27 20:44:19 +0000427}