OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "gl/GrGLInterface.h" | 9 #include "gl/GrGLInterface.h" |
10 #include "GrGLDefines.h" | 10 #include "GrGLDefines.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 gBuffers[id] = gBuffers[0]; | 93 gBuffers[id] = gBuffers[0]; |
94 gBuffers[0] = SkTCast<GrBufferObj*>((const void*)(intptr_t)id); | 94 gBuffers[0] = SkTCast<GrBufferObj*>((const void*)(intptr_t)id); |
95 } | 95 } |
96 | 96 |
97 GrGLvoid GR_GL_FUNCTION_TYPE nullGLActiveTexture(GrGLenum texture) {} | 97 GrGLvoid GR_GL_FUNCTION_TYPE nullGLActiveTexture(GrGLenum texture) {} |
98 GrGLvoid GR_GL_FUNCTION_TYPE nullGLAttachShader(GrGLuint program, GrGLuint shade
r) {} | 98 GrGLvoid GR_GL_FUNCTION_TYPE nullGLAttachShader(GrGLuint program, GrGLuint shade
r) {} |
99 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBeginQuery(GrGLenum target, GrGLuint id) {} | 99 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBeginQuery(GrGLenum target, GrGLuint id) {} |
100 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindAttribLocation(GrGLuint program, GrGLuint
index, const char* name) {} | 100 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindAttribLocation(GrGLuint program, GrGLuint
index, const char* name) {} |
101 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindTexture(GrGLenum target, GrGLuint texture
) {} | 101 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindTexture(GrGLenum target, GrGLuint texture
) {} |
102 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindVertexArray(GrGLuint id) {} | 102 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindVertexArray(GrGLuint id) {} |
103 GrGLvoid GR_GL_FUNCTION_TYPE nullGLClientActiveTexture(GrGLenum) {} | |
104 | 103 |
105 GrGLvoid GR_GL_FUNCTION_TYPE nullGLGenBuffers(GrGLsizei n, GrGLuint* ids) { | 104 GrGLvoid GR_GL_FUNCTION_TYPE nullGLGenBuffers(GrGLsizei n, GrGLuint* ids) { |
106 | 105 |
107 for (int i = 0; i < n; ++i) { | 106 for (int i = 0; i < n; ++i) { |
108 GrBufferObj* buffer = create_buffer(); | 107 GrBufferObj* buffer = create_buffer(); |
109 ids[i] = buffer->id(); | 108 ids[i] = buffer->id(); |
110 } | 109 } |
111 } | 110 } |
112 | 111 |
113 GrGLvoid GR_GL_FUNCTION_TYPE nullGLGenerateMipmap(GrGLenum target) {} | 112 GrGLvoid GR_GL_FUNCTION_TYPE nullGLGenerateMipmap(GrGLenum target) {} |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 functions->fBindFragDataLocation = noOpGLBindFragDataLocation; | 277 functions->fBindFragDataLocation = noOpGLBindFragDataLocation; |
279 functions->fBindTexture = nullGLBindTexture; | 278 functions->fBindTexture = nullGLBindTexture; |
280 functions->fBindVertexArray = nullGLBindVertexArray; | 279 functions->fBindVertexArray = nullGLBindVertexArray; |
281 functions->fBlendColor = noOpGLBlendColor; | 280 functions->fBlendColor = noOpGLBlendColor; |
282 functions->fBlendFunc = noOpGLBlendFunc; | 281 functions->fBlendFunc = noOpGLBlendFunc; |
283 functions->fBufferData = nullGLBufferData; | 282 functions->fBufferData = nullGLBufferData; |
284 functions->fBufferSubData = noOpGLBufferSubData; | 283 functions->fBufferSubData = noOpGLBufferSubData; |
285 functions->fClear = noOpGLClear; | 284 functions->fClear = noOpGLClear; |
286 functions->fClearColor = noOpGLClearColor; | 285 functions->fClearColor = noOpGLClearColor; |
287 functions->fClearStencil = noOpGLClearStencil; | 286 functions->fClearStencil = noOpGLClearStencil; |
288 functions->fClientActiveTexture = nullGLClientActiveTexture; | |
289 functions->fColorMask = noOpGLColorMask; | 287 functions->fColorMask = noOpGLColorMask; |
290 functions->fCompileShader = noOpGLCompileShader; | 288 functions->fCompileShader = noOpGLCompileShader; |
291 functions->fCompressedTexImage2D = noOpGLCompressedTexImage2D; | 289 functions->fCompressedTexImage2D = noOpGLCompressedTexImage2D; |
292 functions->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D; | 290 functions->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D; |
293 functions->fCreateProgram = nullGLCreateProgram; | 291 functions->fCreateProgram = nullGLCreateProgram; |
294 functions->fCreateShader = nullGLCreateShader; | 292 functions->fCreateShader = nullGLCreateShader; |
295 functions->fCullFace = noOpGLCullFace; | 293 functions->fCullFace = noOpGLCullFace; |
296 functions->fDeleteBuffers = nullGLDeleteBuffers; | 294 functions->fDeleteBuffers = nullGLDeleteBuffers; |
297 functions->fDeleteProgram = nullGLDelete; | 295 functions->fDeleteProgram = nullGLDelete; |
298 functions->fDeleteQueries = noOpGLDeleteIds; | 296 functions->fDeleteQueries = noOpGLDeleteIds; |
299 functions->fDeleteShader = nullGLDelete; | 297 functions->fDeleteShader = nullGLDelete; |
300 functions->fDeleteTextures = noOpGLDeleteIds; | 298 functions->fDeleteTextures = noOpGLDeleteIds; |
301 functions->fDeleteVertexArrays = noOpGLDeleteIds; | 299 functions->fDeleteVertexArrays = noOpGLDeleteIds; |
302 functions->fDepthMask = noOpGLDepthMask; | 300 functions->fDepthMask = noOpGLDepthMask; |
303 functions->fDisable = noOpGLDisable; | 301 functions->fDisable = noOpGLDisable; |
304 functions->fDisableClientState = noOpGLDisableClientState; | |
305 functions->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray; | 302 functions->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray; |
306 functions->fDrawArrays = noOpGLDrawArrays; | 303 functions->fDrawArrays = noOpGLDrawArrays; |
307 functions->fDrawBuffer = noOpGLDrawBuffer; | 304 functions->fDrawBuffer = noOpGLDrawBuffer; |
308 functions->fDrawBuffers = noOpGLDrawBuffers; | 305 functions->fDrawBuffers = noOpGLDrawBuffers; |
309 functions->fDrawElements = noOpGLDrawElements; | 306 functions->fDrawElements = noOpGLDrawElements; |
310 functions->fEnable = noOpGLEnable; | 307 functions->fEnable = noOpGLEnable; |
311 functions->fEnableClientState = noOpGLEnableClientState; | |
312 functions->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray; | 308 functions->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray; |
313 functions->fEndQuery = noOpGLEndQuery; | 309 functions->fEndQuery = noOpGLEndQuery; |
314 functions->fFinish = noOpGLFinish; | 310 functions->fFinish = noOpGLFinish; |
315 functions->fFlush = noOpGLFlush; | 311 functions->fFlush = noOpGLFlush; |
316 functions->fFrontFace = noOpGLFrontFace; | 312 functions->fFrontFace = noOpGLFrontFace; |
317 functions->fGenBuffers = nullGLGenBuffers; | 313 functions->fGenBuffers = nullGLGenBuffers; |
318 functions->fGenerateMipmap = nullGLGenerateMipmap; | 314 functions->fGenerateMipmap = nullGLGenerateMipmap; |
319 functions->fGenQueries = noOpGLGenIds; | 315 functions->fGenQueries = noOpGLGenIds; |
320 functions->fGenTextures = noOpGLGenIds; | 316 functions->fGenTextures = noOpGLGenIds; |
321 functions->fGenVertexArrays = noOpGLGenIds; | 317 functions->fGenVertexArrays = noOpGLGenIds; |
(...skipping 26 matching lines...) Expand all Loading... |
348 functions->fReadBuffer = noOpGLReadBuffer; | 344 functions->fReadBuffer = noOpGLReadBuffer; |
349 functions->fReadPixels = nullGLReadPixels; | 345 functions->fReadPixels = nullGLReadPixels; |
350 functions->fScissor = noOpGLScissor; | 346 functions->fScissor = noOpGLScissor; |
351 functions->fShaderSource = noOpGLShaderSource; | 347 functions->fShaderSource = noOpGLShaderSource; |
352 functions->fStencilFunc = noOpGLStencilFunc; | 348 functions->fStencilFunc = noOpGLStencilFunc; |
353 functions->fStencilFuncSeparate = noOpGLStencilFuncSeparate; | 349 functions->fStencilFuncSeparate = noOpGLStencilFuncSeparate; |
354 functions->fStencilMask = noOpGLStencilMask; | 350 functions->fStencilMask = noOpGLStencilMask; |
355 functions->fStencilMaskSeparate = noOpGLStencilMaskSeparate; | 351 functions->fStencilMaskSeparate = noOpGLStencilMaskSeparate; |
356 functions->fStencilOp = noOpGLStencilOp; | 352 functions->fStencilOp = noOpGLStencilOp; |
357 functions->fStencilOpSeparate = noOpGLStencilOpSeparate; | 353 functions->fStencilOpSeparate = noOpGLStencilOpSeparate; |
358 functions->fTexGenf = noOpGLTexGenf; | |
359 functions->fTexGenfv = noOpGLTexGenfv; | 354 functions->fTexGenfv = noOpGLTexGenfv; |
360 functions->fTexGeni = noOpGLTexGeni; | 355 functions->fTexGeni = noOpGLTexGeni; |
361 functions->fTexImage2D = noOpGLTexImage2D; | 356 functions->fTexImage2D = noOpGLTexImage2D; |
362 functions->fTexParameteri = noOpGLTexParameteri; | 357 functions->fTexParameteri = noOpGLTexParameteri; |
363 functions->fTexParameteriv = noOpGLTexParameteriv; | 358 functions->fTexParameteriv = noOpGLTexParameteriv; |
364 functions->fTexSubImage2D = noOpGLTexSubImage2D; | 359 functions->fTexSubImage2D = noOpGLTexSubImage2D; |
365 functions->fTexStorage2D = noOpGLTexStorage2D; | 360 functions->fTexStorage2D = noOpGLTexStorage2D; |
366 functions->fDiscardFramebuffer = noOpGLDiscardFramebuffer; | 361 functions->fDiscardFramebuffer = noOpGLDiscardFramebuffer; |
367 functions->fUniform1f = noOpGLUniform1f; | 362 functions->fUniform1f = noOpGLUniform1f; |
368 functions->fUniform1i = noOpGLUniform1i; | 363 functions->fUniform1i = noOpGLUniform1i; |
(...skipping 10 matching lines...) Expand all Loading... |
379 functions->fUniform4f = noOpGLUniform4f; | 374 functions->fUniform4f = noOpGLUniform4f; |
380 functions->fUniform4i = noOpGLUniform4i; | 375 functions->fUniform4i = noOpGLUniform4i; |
381 functions->fUniform4fv = noOpGLUniform4fv; | 376 functions->fUniform4fv = noOpGLUniform4fv; |
382 functions->fUniform4iv = noOpGLUniform4iv; | 377 functions->fUniform4iv = noOpGLUniform4iv; |
383 functions->fUniformMatrix2fv = noOpGLUniformMatrix2fv; | 378 functions->fUniformMatrix2fv = noOpGLUniformMatrix2fv; |
384 functions->fUniformMatrix3fv = noOpGLUniformMatrix3fv; | 379 functions->fUniformMatrix3fv = noOpGLUniformMatrix3fv; |
385 functions->fUniformMatrix4fv = noOpGLUniformMatrix4fv; | 380 functions->fUniformMatrix4fv = noOpGLUniformMatrix4fv; |
386 functions->fUseProgram = nullGLUseProgram; | 381 functions->fUseProgram = nullGLUseProgram; |
387 functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv; | 382 functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv; |
388 functions->fVertexAttribPointer = noOpGLVertexAttribPointer; | 383 functions->fVertexAttribPointer = noOpGLVertexAttribPointer; |
389 functions->fVertexPointer = noOpGLVertexPointer; | |
390 functions->fViewport = nullGLViewport; | 384 functions->fViewport = nullGLViewport; |
391 functions->fBindFramebuffer = nullGLBindFramebuffer; | 385 functions->fBindFramebuffer = nullGLBindFramebuffer; |
392 functions->fBindRenderbuffer = nullGLBindRenderbuffer; | 386 functions->fBindRenderbuffer = nullGLBindRenderbuffer; |
393 functions->fCheckFramebufferStatus = noOpGLCheckFramebufferStatus; | 387 functions->fCheckFramebufferStatus = noOpGLCheckFramebufferStatus; |
394 functions->fDeleteFramebuffers = nullGLDeleteFramebuffers; | 388 functions->fDeleteFramebuffers = nullGLDeleteFramebuffers; |
395 functions->fDeleteRenderbuffers = nullGLDeleteRenderbuffers; | 389 functions->fDeleteRenderbuffers = nullGLDeleteRenderbuffers; |
396 functions->fFramebufferRenderbuffer = nullGLFramebufferRenderbuffer; | 390 functions->fFramebufferRenderbuffer = nullGLFramebufferRenderbuffer; |
397 functions->fFramebufferTexture2D = nullGLFramebufferTexture2D; | 391 functions->fFramebufferTexture2D = nullGLFramebufferTexture2D; |
398 functions->fGenFramebuffers = noOpGLGenIds; | 392 functions->fGenFramebuffers = noOpGLGenIds; |
399 functions->fGenRenderbuffers = noOpGLGenIds; | 393 functions->fGenRenderbuffers = noOpGLGenIds; |
400 functions->fGetFramebufferAttachmentParameteriv = noOpGLGetFramebufferAt
tachmentParameteriv; | 394 functions->fGetFramebufferAttachmentParameteriv = noOpGLGetFramebufferAt
tachmentParameteriv; |
401 functions->fGetRenderbufferParameteriv = noOpGLGetRenderbufferParameteri
v; | 395 functions->fGetRenderbufferParameteriv = noOpGLGetRenderbufferParameteri
v; |
402 functions->fRenderbufferStorage = noOpGLRenderbufferStorage; | 396 functions->fRenderbufferStorage = noOpGLRenderbufferStorage; |
403 functions->fRenderbufferStorageMultisample = noOpGLRenderbufferStorageMu
ltisample; | 397 functions->fRenderbufferStorageMultisample = noOpGLRenderbufferStorageMu
ltisample; |
404 functions->fBlitFramebuffer = noOpGLBlitFramebuffer; | 398 functions->fBlitFramebuffer = noOpGLBlitFramebuffer; |
405 functions->fResolveMultisampleFramebuffer = noOpGLResolveMultisampleFram
ebuffer; | 399 functions->fResolveMultisampleFramebuffer = noOpGLResolveMultisampleFram
ebuffer; |
406 functions->fMapBuffer = nullGLMapBuffer; | 400 functions->fMapBuffer = nullGLMapBuffer; |
407 functions->fUnmapBuffer = nullGLUnmapBuffer; | 401 functions->fUnmapBuffer = nullGLUnmapBuffer; |
408 functions->fBindFragDataLocationIndexed = noOpGLBindFragDataLocationInde
xed; | 402 functions->fBindFragDataLocationIndexed = noOpGLBindFragDataLocationInde
xed; |
409 } | 403 } |
410 glInterface.get()->ref(); | 404 glInterface.get()->ref(); |
411 return glInterface.get(); | 405 return glInterface.get(); |
412 } | 406 } |
OLD | NEW |