1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 #include "ui/gl/gl_bindings_skia_in_process.h"
8 #include "base/logging.h"
9 #include "third_party/skia/include/gpu/gl/GrGLInterface.h"
10 #include "ui/gl/gl_bindings.h"
11 #include "ui/gl/gl_implementation.h"
16 // The following stub functions are required because the glXXX routines exported
17 // via gl_bindings.h use call-type GL_BINDING_CALL, which on Windows is stdcall.
18 // Skia has been built such that its GrGLInterface GL pointers are __cdecl.
20 GLvoid GR_GL_FUNCTION_TYPE
StubGLActiveTexture(GLenum texture
) {
21 glActiveTexture(texture
);
24 GLvoid GR_GL_FUNCTION_TYPE
StubGLAttachShader(GLuint program
, GLuint shader
) {
25 glAttachShader(program
, shader
);
28 GLvoid GR_GL_FUNCTION_TYPE
StubGLBeginQuery(GLenum target
, GLuint id
) {
29 glBeginQuery(target
, id
);
32 GLvoid GR_GL_FUNCTION_TYPE
StubGLBindAttribLocation(GLuint program
,
35 glBindAttribLocation(program
, index
, name
);
38 GLvoid GR_GL_FUNCTION_TYPE
StubGLBindBuffer(GLenum target
, GLuint buffer
) {
39 glBindBuffer(target
, buffer
);
42 GLvoid GR_GL_FUNCTION_TYPE
StubGLBindFragDataLocation(GLuint program
,
45 glBindFragDataLocation(program
, colorNumber
, name
);
48 GLvoid GR_GL_FUNCTION_TYPE
49 StubGLBindFragDataLocationIndexed(GLuint program
,
53 glBindFragDataLocationIndexed(program
, colorNumber
, index
, name
);
56 GLvoid GR_GL_FUNCTION_TYPE
StubGLBindFramebuffer(GLenum target
,
58 glBindFramebufferEXT(target
, framebuffer
);
61 GLvoid GR_GL_FUNCTION_TYPE
StubGLBindRenderbuffer(GLenum target
,
62 GLuint renderbuffer
) {
63 glBindRenderbufferEXT(target
, renderbuffer
);
66 GLvoid GR_GL_FUNCTION_TYPE
StubGLBindTexture(GLenum target
, GLuint texture
) {
67 glBindTexture(target
, texture
);
70 GLvoid GR_GL_FUNCTION_TYPE
StubGLBindVertexArray(GLuint array
) {
71 glBindVertexArrayOES(array
);
74 GLvoid GR_GL_FUNCTION_TYPE
StubGLBlendBarrier() {
78 GLvoid GR_GL_FUNCTION_TYPE
StubGLBlendColor(GLclampf red
,
82 glBlendColor(red
, green
, blue
, alpha
);
85 GLvoid GR_GL_FUNCTION_TYPE
StubGLBlendEquation(GLenum mode
) {
86 glBlendEquation(mode
);
89 GLvoid GR_GL_FUNCTION_TYPE
StubGLBlendFunc(GLenum sfactor
, GLenum dfactor
) {
90 glBlendFunc(sfactor
, dfactor
);
93 GLvoid GR_GL_FUNCTION_TYPE
StubGLBlitFramebuffer(GLint srcX0
,
103 glBlitFramebufferEXT(srcX0
, srcY0
, srcX1
, srcY1
, dstX0
, dstY0
, dstX1
, dstY1
,
107 GLvoid GR_GL_FUNCTION_TYPE
StubGLBufferData(GLenum target
,
111 glBufferData(target
, size
, data
, usage
);
114 GLvoid GR_GL_FUNCTION_TYPE
StubGLBufferSubData(GLenum target
,
118 glBufferSubData(target
, offset
, size
, data
);
121 GLenum GR_GL_FUNCTION_TYPE
StubGLCheckFramebufferStatus(GLenum target
) {
122 return glCheckFramebufferStatusEXT(target
);
125 GLvoid GR_GL_FUNCTION_TYPE
StubGLClear(GLbitfield mask
) {
129 GLvoid GR_GL_FUNCTION_TYPE
StubGLClearColor(GLclampf red
,
133 glClearColor(red
, green
, blue
, alpha
);
136 GLvoid GR_GL_FUNCTION_TYPE
StubGLClearStencil(GLint s
) {
140 GLvoid GR_GL_FUNCTION_TYPE
StubGLColorMask(GLboolean red
,
144 glColorMask(red
, green
, blue
, alpha
);
147 GLvoid GR_GL_FUNCTION_TYPE
StubGLCompileShader(GLuint shader
) {
148 glCompileShader(shader
);
151 GLvoid GR_GL_FUNCTION_TYPE
StubGLCompressedTexImage2D(GLenum target
,
153 GLenum internalformat
,
159 glCompressedTexImage2D(target
, level
, internalformat
, width
, height
, border
,
163 GLvoid GR_GL_FUNCTION_TYPE
StubGLCopyTexSubImage2D(GLenum target
,
171 glCopyTexSubImage2D(target
, level
, xoffset
, yoffset
, x
, y
, width
, height
);
174 GLuint GR_GL_FUNCTION_TYPE
StubGLCreateProgram(void) {
175 return glCreateProgram();
178 GLuint GR_GL_FUNCTION_TYPE
StubGLCreateShader(GLenum type
) {
179 return glCreateShader(type
);
182 GLvoid GR_GL_FUNCTION_TYPE
StubGLCullFace(GLenum mode
) {
186 GLvoid GR_GL_FUNCTION_TYPE
StubGLDeleteBuffers(GLsizei n
,
187 const GLuint
* buffers
) {
188 glDeleteBuffersARB(n
, buffers
);
191 GLvoid GR_GL_FUNCTION_TYPE
192 StubGLDeleteFramebuffers(GLsizei n
, const GLuint
* framebuffers
) {
193 glDeleteFramebuffersEXT(n
, framebuffers
);
196 GLvoid GR_GL_FUNCTION_TYPE
StubGLDeleteQueries(GLsizei n
, const GLuint
* ids
) {
197 glDeleteQueries(n
, ids
);
200 GLvoid GR_GL_FUNCTION_TYPE
StubGLDeleteProgram(GLuint program
) {
201 glDeleteProgram(program
);
204 GLvoid GR_GL_FUNCTION_TYPE
205 StubGLDeleteRenderbuffers(GLsizei n
, const GLuint
* renderbuffers
) {
206 glDeleteRenderbuffersEXT(n
, renderbuffers
);
209 GLvoid GR_GL_FUNCTION_TYPE
StubGLDeleteShader(GLuint shader
) {
210 glDeleteShader(shader
);
213 GLvoid GR_GL_FUNCTION_TYPE
StubGLDeleteTextures(GLsizei n
,
214 const GLuint
* textures
) {
215 glDeleteTextures(n
, textures
);
218 GLvoid GR_GL_FUNCTION_TYPE
StubGLDeleteVertexArrays(GLsizei n
,
219 const GLuint
* arrays
) {
220 glDeleteVertexArraysOES(n
, arrays
);
223 GLvoid GR_GL_FUNCTION_TYPE
StubGLDepthMask(GLboolean flag
) {
227 GLvoid GR_GL_FUNCTION_TYPE
StubGLDisable(GLenum cap
) {
231 GLvoid GR_GL_FUNCTION_TYPE
StubGLDisableVertexAttribArray(GLuint index
) {
232 glDisableVertexAttribArray(index
);
235 GLvoid GR_GL_FUNCTION_TYPE
StubGLDiscardFramebuffer(GLenum target
,
236 GLsizei numAttachments
,
237 const GLenum
* attachments
) {
238 glDiscardFramebufferEXT(target
, numAttachments
, attachments
);
241 GLvoid GR_GL_FUNCTION_TYPE
StubGLDrawArrays(GLenum mode
,
244 glDrawArrays(mode
, first
, count
);
247 GLvoid GR_GL_FUNCTION_TYPE
StubGLDrawBuffer(GLenum mode
) {
251 GLvoid GR_GL_FUNCTION_TYPE
StubGLDrawBuffers(GLsizei n
, const GLenum
* bufs
) {
252 glDrawBuffersARB(n
, bufs
);
255 GLvoid GR_GL_FUNCTION_TYPE
StubGLDrawElements(GLenum mode
,
258 const void* indices
) {
259 glDrawElements(mode
, count
, type
, indices
);
262 GLvoid GR_GL_FUNCTION_TYPE
StubGLEnable(GLenum cap
) {
266 GLvoid GR_GL_FUNCTION_TYPE
StubGLEnableVertexAttribArray(GLuint index
) {
267 glEnableVertexAttribArray(index
);
270 GLvoid GR_GL_FUNCTION_TYPE
StubGLEndQuery(GLenum target
) {
274 GLvoid GR_GL_FUNCTION_TYPE
StubGLFinish() {
278 GLvoid GR_GL_FUNCTION_TYPE
StubGLFlush() {
282 GLvoid GR_GL_FUNCTION_TYPE
StubGLFlushMappedBufferRange(GLenum target
,
285 glFlushMappedBufferRange(target
, offset
, length
);
288 GLvoid GR_GL_FUNCTION_TYPE
289 StubGLFramebufferRenderbuffer(GLenum target
,
291 GLenum renderbuffertarget
,
292 GLuint renderbuffer
) {
293 glFramebufferRenderbufferEXT(target
, attachment
, renderbuffertarget
,
297 GLvoid GR_GL_FUNCTION_TYPE
StubGLFramebufferTexture2D(GLenum target
,
302 glFramebufferTexture2DEXT(target
, attachment
, textarget
, texture
, level
);
305 GLvoid GR_GL_FUNCTION_TYPE
306 StubGLFramebufferTexture2DMultisample(GLenum target
,
312 glFramebufferTexture2DMultisampleEXT(target
, attachment
, textarget
, texture
,
316 GLvoid GR_GL_FUNCTION_TYPE
StubGLFrontFace(GLenum mode
) {
320 GLvoid GR_GL_FUNCTION_TYPE
StubGLGenBuffers(GLsizei n
, GLuint
* buffers
) {
321 glGenBuffersARB(n
, buffers
);
324 GLvoid GR_GL_FUNCTION_TYPE
StubGLGenFramebuffers(GLsizei n
,
325 GLuint
* framebuffers
) {
326 glGenFramebuffersEXT(n
, framebuffers
);
329 GLvoid GR_GL_FUNCTION_TYPE
StubGLGenQueries(GLsizei n
, GLuint
* ids
) {
330 glGenQueries(n
, ids
);
333 GLvoid GR_GL_FUNCTION_TYPE
StubGLGenRenderbuffers(GLsizei n
,
334 GLuint
* renderbuffers
) {
335 glGenRenderbuffersEXT(n
, renderbuffers
);
338 GLvoid GR_GL_FUNCTION_TYPE
StubGLGenTextures(GLsizei n
, GLuint
* textures
) {
339 glGenTextures(n
, textures
);
342 GLvoid GR_GL_FUNCTION_TYPE
StubGLGenVertexArrays(GLsizei n
, GLuint
* arrays
) {
343 glGenVertexArraysOES(n
, arrays
);
346 GLvoid GR_GL_FUNCTION_TYPE
StubGLGenerateMipmap(GLenum target
) {
347 glGenerateMipmapEXT(target
);
350 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetBufferParameteriv(GLenum target
,
353 glGetBufferParameteriv(target
, pname
, params
);
356 GLvoid GR_GL_FUNCTION_TYPE
357 StubGLGetFramebufferAttachmentParameteriv(GLenum target
,
361 glGetFramebufferAttachmentParameterivEXT(target
, attachment
, pname
, params
);
364 GLenum GR_GL_FUNCTION_TYPE
StubGLGetError() {
368 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetIntegerv(GLenum pname
, GLint
* params
) {
369 glGetIntegerv(pname
, params
);
372 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetProgramInfoLog(GLuint program
,
376 glGetProgramInfoLog(program
, bufsize
, length
, infolog
);
379 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetProgramiv(GLuint program
,
382 glGetProgramiv(program
, pname
, params
);
385 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetRenderbufferParameteriv(GLenum target
,
388 glGetRenderbufferParameterivEXT(target
, pname
, params
);
391 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetShaderInfoLog(GLuint shader
,
395 glGetShaderInfoLog(shader
, bufsize
, length
, infolog
);
398 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetShaderiv(GLuint shader
,
401 glGetShaderiv(shader
, pname
, params
);
404 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetShaderPrecisionFormat(GLenum shadertype
,
405 GLenum precisiontype
,
408 glGetShaderPrecisionFormat(shadertype
, precisiontype
, range
, precision
);
411 const GLubyte
* GR_GL_FUNCTION_TYPE
StubGLGetString(GLenum name
) {
412 return glGetString(name
);
415 const GLubyte
* GR_GL_FUNCTION_TYPE
StubGLGetStringi(GLenum name
, GLuint index
) {
416 return glGetStringi(name
, index
);
419 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetQueryiv(GLenum target
,
422 glGetQueryiv(target
, pname
, params
);
425 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetQueryObjecti64v(GLuint id
,
428 glGetQueryObjecti64v(id
, pname
, params
);
431 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetQueryObjectiv(GLuint id
,
434 glGetQueryObjectiv(id
, pname
, params
);
437 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetQueryObjectui64v(GLuint id
,
440 glGetQueryObjectui64v(id
, pname
, params
);
443 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetQueryObjectuiv(GLuint id
,
446 glGetQueryObjectuiv(id
, pname
, params
);
449 GLvoid GR_GL_FUNCTION_TYPE
StubGLGetTexLevelParameteriv(GLenum target
,
453 glGetTexLevelParameteriv(target
, level
, pname
, params
);
456 GLint GR_GL_FUNCTION_TYPE
StubGLGetUniformLocation(GLuint program
,
458 return glGetUniformLocation(program
, name
);
461 GLvoid GR_GL_FUNCTION_TYPE
StubGLInsertEventMarker(GLsizei length
,
462 const char* marker
) {
463 glInsertEventMarkerEXT(length
, marker
);
466 GLvoid GR_GL_FUNCTION_TYPE
467 StubGLInvalidateFramebuffer(GLenum target
,
468 GLsizei numAttachments
,
469 const GLenum
* attachments
) {
470 glInvalidateFramebuffer(target
, numAttachments
, attachments
);
473 GLvoid GR_GL_FUNCTION_TYPE
474 StubGLInvalidateSubFramebuffer(GLenum target
,
475 GLsizei numAttachments
,
476 const GLenum
* attachments
,
481 glInvalidateSubFramebuffer(target
, numAttachments
, attachments
,
482 x
, y
, width
, height
);
485 GLvoid GR_GL_FUNCTION_TYPE
StubGLLineWidth(GLfloat width
) {
489 GLvoid GR_GL_FUNCTION_TYPE
StubGLLinkProgram(GLuint program
) {
490 glLinkProgram(program
);
493 void* GR_GL_FUNCTION_TYPE
StubGLMapBuffer(GLenum target
, GLenum access
) {
494 return glMapBuffer(target
, access
);
497 void* GR_GL_FUNCTION_TYPE
StubGLMapBufferRange(GLenum target
,
501 return glMapBufferRange(target
, offset
, length
, access
);
504 GLvoid GR_GL_FUNCTION_TYPE
StubGLPixelStorei(GLenum pname
, GLint param
) {
505 glPixelStorei(pname
, param
);
508 GLvoid GR_GL_FUNCTION_TYPE
StubGLPopGroupMarker() {
509 glPopGroupMarkerEXT();
512 GLvoid GR_GL_FUNCTION_TYPE
StubGLPushGroupMarker(GLsizei length
,
513 const char* marker
) {
514 glPushGroupMarkerEXT(length
, marker
);
517 GLvoid GR_GL_FUNCTION_TYPE
StubGLQueryCounter(GLuint id
, GLenum target
) {
518 glQueryCounter(id
, target
);
521 GLvoid GR_GL_FUNCTION_TYPE
StubGLReadBuffer(GLenum src
) {
525 GLvoid GR_GL_FUNCTION_TYPE
StubGLReadPixels(GLint x
,
532 glReadPixels(x
, y
, width
, height
, format
, type
, pixels
);
535 GLvoid GR_GL_FUNCTION_TYPE
StubGLRenderbufferStorage(GLenum target
,
536 GLenum internalformat
,
539 glRenderbufferStorageEXT(target
, internalformat
, width
, height
);
542 GLvoid GR_GL_FUNCTION_TYPE
543 StubGLRenderbufferStorageMultisample(GLenum target
,
545 GLenum internalformat
,
548 glRenderbufferStorageMultisampleEXT(target
, samples
, internalformat
, width
,
552 GLvoid GR_GL_FUNCTION_TYPE
StubGLScissor(GLint x
,
556 glScissor(x
, y
, width
, height
);
559 GLvoid GR_GL_FUNCTION_TYPE
StubGLShaderSource(GLuint shader
,
561 const char* const* str
,
562 const GLint
* length
) {
563 glShaderSource(shader
, count
, str
, length
);
566 GLvoid GR_GL_FUNCTION_TYPE
StubGLStencilFunc(GLenum func
,
569 glStencilFunc(func
, ref
, mask
);
572 GLvoid GR_GL_FUNCTION_TYPE
StubGLStencilFuncSeparate(GLenum face
,
576 glStencilFuncSeparate(face
, func
, ref
, mask
);
579 GLvoid GR_GL_FUNCTION_TYPE
StubGLStencilMask(GLuint mask
) {
583 GLvoid GR_GL_FUNCTION_TYPE
StubGLStencilMaskSeparate(GLenum face
, GLuint mask
) {
584 glStencilMaskSeparate(face
, mask
);
587 GLvoid GR_GL_FUNCTION_TYPE
StubGLStencilOp(GLenum fail
,
590 glStencilOp(fail
, zfail
, zpass
);
593 GLvoid GR_GL_FUNCTION_TYPE
StubGLStencilOpSeparate(GLenum face
,
597 glStencilOpSeparate(face
, fail
, zfail
, zpass
);
600 GLvoid GR_GL_FUNCTION_TYPE
StubGLTexImage2D(GLenum target
,
602 GLint internalformat
,
608 const void* pixels
) {
609 glTexImage2D(target
, level
, internalformat
, width
, height
, border
, format
,
613 GLvoid GR_GL_FUNCTION_TYPE
StubGLTexParameteri(GLenum target
,
616 glTexParameteri(target
, pname
, param
);
619 GLvoid GR_GL_FUNCTION_TYPE
StubGLTexParameteriv(GLenum target
,
621 const GLint
* params
) {
622 glTexParameteriv(target
, pname
, params
);
625 GLvoid GR_GL_FUNCTION_TYPE
StubGLTexStorage2D(GLenum target
,
627 GLenum internalFormat
,
630 glTexStorage2DEXT(target
, levels
, internalFormat
, width
, height
);
633 GLvoid GR_GL_FUNCTION_TYPE
StubGLTexSubImage2D(GLenum target
,
641 const void* pixels
) {
642 glTexSubImage2D(target
, level
, xoffset
, yoffset
, width
, height
, format
, type
,
646 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform1f(GLint location
, GLfloat v
) {
647 glUniform1f(location
, v
);
650 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform1i(GLint location
, GLint v
) {
651 glUniform1i(location
, v
);
654 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform1fv(GLint location
,
657 glUniform1fv(location
, count
, v
);
660 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform1iv(GLint location
,
663 glUniform1iv(location
, count
, v
);
666 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform2f(GLint location
,
669 glUniform2f(location
, v0
, v1
);
672 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform2i(GLint location
, GLint v0
, GLint v1
) {
673 glUniform2i(location
, v0
, v1
);
676 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform2fv(GLint location
,
679 glUniform2fv(location
, count
, v
);
682 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform2iv(GLint location
,
685 glUniform2iv(location
, count
, v
);
688 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform3f(GLint location
,
692 glUniform3f(location
, v0
, v1
, v2
);
695 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform3i(GLint location
,
699 glUniform3i(location
, v0
, v1
, v2
);
702 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform3fv(GLint location
,
705 glUniform3fv(location
, count
, v
);
708 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform3iv(GLint location
,
711 glUniform3iv(location
, count
, v
);
714 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform4f(GLint location
,
719 glUniform4f(location
, v0
, v1
, v2
, v3
);
722 GLvoid GR_GL_FUNCTION_TYPE
723 StubGLUniform4i(GLint location
, GLint v0
, GLint v1
, GLint v2
, GLint v3
) {
724 glUniform4i(location
, v0
, v1
, v2
, v3
);
727 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform4fv(GLint location
,
730 glUniform4fv(location
, count
, v
);
733 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniform4iv(GLint location
,
736 glUniform4iv(location
, count
, v
);
739 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniformMatrix2fv(GLint location
,
742 const GLfloat
* value
) {
743 glUniformMatrix2fv(location
, count
, transpose
, value
);
746 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniformMatrix3fv(GLint location
,
749 const GLfloat
* value
) {
750 glUniformMatrix3fv(location
, count
, transpose
, value
);
753 GLvoid GR_GL_FUNCTION_TYPE
StubGLUniformMatrix4fv(GLint location
,
756 const GLfloat
* value
) {
757 glUniformMatrix4fv(location
, count
, transpose
, value
);
760 GLboolean GR_GL_FUNCTION_TYPE
StubGLUnmapBuffer(GLenum target
) {
761 return glUnmapBuffer(target
);
764 GLvoid GR_GL_FUNCTION_TYPE
StubGLUseProgram(GLuint program
) {
765 glUseProgram(program
);
768 GLvoid GR_GL_FUNCTION_TYPE
StubGLVertexAttrib1f(GLuint indx
,
769 const GLfloat value
) {
770 glVertexAttrib1f(indx
, value
);
773 GLvoid GR_GL_FUNCTION_TYPE
StubGLVertexAttrib2fv(GLuint indx
,
774 const GLfloat
* values
) {
775 glVertexAttrib2fv(indx
, values
);
778 GLvoid GR_GL_FUNCTION_TYPE
StubGLVertexAttrib3fv(GLuint indx
,
779 const GLfloat
* values
) {
780 glVertexAttrib3fv(indx
, values
);
783 GLvoid GR_GL_FUNCTION_TYPE
StubGLVertexAttrib4fv(GLuint indx
,
784 const GLfloat
* values
) {
785 glVertexAttrib4fv(indx
, values
);
788 GLvoid GR_GL_FUNCTION_TYPE
StubGLVertexAttribPointer(GLuint indx
,
791 GLboolean normalized
,
794 glVertexAttribPointer(indx
, size
, type
, normalized
, stride
, ptr
);
797 GLvoid GR_GL_FUNCTION_TYPE
StubGLViewport(GLint x
,
801 glViewport(x
, y
, width
, height
);
804 GLint GR_GL_FUNCTION_TYPE
805 StubGLGetProgramResourceLocation(GLuint program
,
806 GLenum programInterface
,
808 return glGetProgramResourceLocation(program
, programInterface
, name
);
816 GrGLInterface
* CreateInProcessSkiaGLBinding() {
817 GrGLStandard standard
;
818 switch (gfx::GetGLImplementation()) {
819 case gfx::kGLImplementationNone
:
822 case gfx::kGLImplementationDesktopGL
:
823 case gfx::kGLImplementationAppleGL
:
824 standard
= kGL_GrGLStandard
;
826 case gfx::kGLImplementationOSMesaGL
:
827 standard
= kGL_GrGLStandard
;
829 case gfx::kGLImplementationEGLGLES2
:
830 standard
= kGLES_GrGLStandard
;
832 case gfx::kGLImplementationMockGL
:
840 GrGLInterface
* interface
= new GrGLInterface
;
841 interface
->fStandard
= standard
;
842 interface
->fExtensions
.init(standard
,
847 GrGLInterface::Functions
* functions
= &interface
->fFunctions
;
848 functions
->fActiveTexture
= StubGLActiveTexture
;
849 functions
->fAttachShader
= StubGLAttachShader
;
850 functions
->fBeginQuery
= StubGLBeginQuery
;
851 functions
->fBindAttribLocation
= StubGLBindAttribLocation
;
852 functions
->fBindBuffer
= StubGLBindBuffer
;
853 functions
->fBindFragDataLocation
= StubGLBindFragDataLocation
;
854 functions
->fBindTexture
= StubGLBindTexture
;
855 functions
->fBindVertexArray
= StubGLBindVertexArray
;
856 functions
->fBlendBarrier
= StubGLBlendBarrier
;
857 functions
->fBlendColor
= StubGLBlendColor
;
858 functions
->fBlendEquation
= StubGLBlendEquation
;
859 functions
->fBlendFunc
= StubGLBlendFunc
;
860 functions
->fBufferData
= StubGLBufferData
;
861 functions
->fBufferSubData
= StubGLBufferSubData
;
862 functions
->fClear
= StubGLClear
;
863 functions
->fClearColor
= StubGLClearColor
;
864 functions
->fClearStencil
= StubGLClearStencil
;
865 functions
->fColorMask
= StubGLColorMask
;
866 functions
->fCompileShader
= StubGLCompileShader
;
867 functions
->fCompressedTexImage2D
= StubGLCompressedTexImage2D
;
868 functions
->fCopyTexSubImage2D
= StubGLCopyTexSubImage2D
;
869 functions
->fCreateProgram
= StubGLCreateProgram
;
870 functions
->fCreateShader
= StubGLCreateShader
;
871 functions
->fCullFace
= StubGLCullFace
;
872 functions
->fDeleteBuffers
= StubGLDeleteBuffers
;
873 functions
->fDeleteProgram
= StubGLDeleteProgram
;
874 functions
->fDeleteQueries
= StubGLDeleteQueries
;
875 functions
->fDeleteShader
= StubGLDeleteShader
;
876 functions
->fDeleteTextures
= StubGLDeleteTextures
;
877 functions
->fDeleteVertexArrays
= StubGLDeleteVertexArrays
;
878 functions
->fDepthMask
= StubGLDepthMask
;
879 functions
->fDisable
= StubGLDisable
;
880 functions
->fDisableVertexAttribArray
= StubGLDisableVertexAttribArray
;
881 functions
->fDiscardFramebuffer
= StubGLDiscardFramebuffer
;
882 functions
->fDrawArrays
= StubGLDrawArrays
;
883 functions
->fDrawBuffer
= StubGLDrawBuffer
;
884 functions
->fDrawBuffers
= StubGLDrawBuffers
;
885 functions
->fDrawElements
= StubGLDrawElements
;
886 functions
->fEnable
= StubGLEnable
;
887 functions
->fEnableVertexAttribArray
= StubGLEnableVertexAttribArray
;
888 functions
->fEndQuery
= StubGLEndQuery
;
889 functions
->fFinish
= StubGLFinish
;
890 functions
->fFlush
= StubGLFlush
;
891 functions
->fFlushMappedBufferRange
= StubGLFlushMappedBufferRange
;
892 functions
->fFrontFace
= StubGLFrontFace
;
893 functions
->fGenBuffers
= StubGLGenBuffers
;
894 functions
->fGenQueries
= StubGLGenQueries
;
895 functions
->fGenTextures
= StubGLGenTextures
;
896 functions
->fGenVertexArrays
= StubGLGenVertexArrays
;
897 functions
->fGenerateMipmap
= StubGLGenerateMipmap
;
898 functions
->fGetBufferParameteriv
= StubGLGetBufferParameteriv
;
899 functions
->fGetError
= StubGLGetError
;
900 functions
->fGetIntegerv
= StubGLGetIntegerv
;
901 functions
->fGetQueryiv
= StubGLGetQueryiv
;
902 functions
->fGetQueryObjecti64v
= StubGLGetQueryObjecti64v
;
903 functions
->fGetQueryObjectiv
= StubGLGetQueryObjectiv
;
904 functions
->fGetQueryObjectui64v
= StubGLGetQueryObjectui64v
;
905 functions
->fGetQueryObjectuiv
= StubGLGetQueryObjectuiv
;
906 functions
->fGetProgramInfoLog
= StubGLGetProgramInfoLog
;
907 functions
->fGetProgramiv
= StubGLGetProgramiv
;
908 functions
->fGetShaderInfoLog
= StubGLGetShaderInfoLog
;
909 functions
->fGetShaderiv
= StubGLGetShaderiv
;
910 functions
->fGetShaderPrecisionFormat
= StubGLGetShaderPrecisionFormat
;
911 functions
->fGetString
= StubGLGetString
;
912 functions
->fGetStringi
= StubGLGetStringi
;
913 functions
->fGetTexLevelParameteriv
= StubGLGetTexLevelParameteriv
;
914 functions
->fGetUniformLocation
= StubGLGetUniformLocation
;
915 functions
->fInsertEventMarker
= StubGLInsertEventMarker
;
916 functions
->fInvalidateFramebuffer
= StubGLInvalidateFramebuffer
;
917 functions
->fInvalidateSubFramebuffer
= StubGLInvalidateSubFramebuffer
;
918 functions
->fLineWidth
= StubGLLineWidth
;
919 functions
->fLinkProgram
= StubGLLinkProgram
;
920 functions
->fMapBufferRange
= StubGLMapBufferRange
;
921 functions
->fPixelStorei
= StubGLPixelStorei
;
922 functions
->fPopGroupMarker
= StubGLPopGroupMarker
;
923 functions
->fPushGroupMarker
= StubGLPushGroupMarker
;
924 functions
->fQueryCounter
= StubGLQueryCounter
;
925 functions
->fReadBuffer
= StubGLReadBuffer
;
926 functions
->fReadPixels
= StubGLReadPixels
;
927 functions
->fScissor
= StubGLScissor
;
928 functions
->fShaderSource
= StubGLShaderSource
;
929 functions
->fStencilFunc
= StubGLStencilFunc
;
930 functions
->fStencilFuncSeparate
= StubGLStencilFuncSeparate
;
931 functions
->fStencilMask
= StubGLStencilMask
;
932 functions
->fStencilMaskSeparate
= StubGLStencilMaskSeparate
;
933 functions
->fStencilOp
= StubGLStencilOp
;
934 functions
->fStencilOpSeparate
= StubGLStencilOpSeparate
;
935 functions
->fTexImage2D
= StubGLTexImage2D
;
936 functions
->fTexParameteri
= StubGLTexParameteri
;
937 functions
->fTexParameteriv
= StubGLTexParameteriv
;
938 functions
->fTexSubImage2D
= StubGLTexSubImage2D
;
939 functions
->fTexStorage2D
= StubGLTexStorage2D
;
940 functions
->fUniform1f
= StubGLUniform1f
;
941 functions
->fUniform1i
= StubGLUniform1i
;
942 functions
->fUniform1fv
= StubGLUniform1fv
;
943 functions
->fUniform1iv
= StubGLUniform1iv
;
944 functions
->fUniform2f
= StubGLUniform2f
;
945 functions
->fUniform2i
= StubGLUniform2i
;
946 functions
->fUniform2fv
= StubGLUniform2fv
;
947 functions
->fUniform2iv
= StubGLUniform2iv
;
948 functions
->fUniform3f
= StubGLUniform3f
;
949 functions
->fUniform3i
= StubGLUniform3i
;
950 functions
->fUniform3fv
= StubGLUniform3fv
;
951 functions
->fUniform3iv
= StubGLUniform3iv
;
952 functions
->fUniform4f
= StubGLUniform4f
;
953 functions
->fUniform4i
= StubGLUniform4i
;
954 functions
->fUniform4fv
= StubGLUniform4fv
;
955 functions
->fUniform4iv
= StubGLUniform4iv
;
956 functions
->fUniformMatrix2fv
= StubGLUniformMatrix2fv
;
957 functions
->fUniformMatrix3fv
= StubGLUniformMatrix3fv
;
958 functions
->fUniformMatrix4fv
= StubGLUniformMatrix4fv
;
959 functions
->fUseProgram
= StubGLUseProgram
;
960 functions
->fVertexAttrib1f
= StubGLVertexAttrib1f
;
961 functions
->fVertexAttrib2fv
= StubGLVertexAttrib2fv
;
962 functions
->fVertexAttrib3fv
= StubGLVertexAttrib3fv
;
963 functions
->fVertexAttrib4fv
= StubGLVertexAttrib4fv
;
964 functions
->fVertexAttribPointer
= StubGLVertexAttribPointer
;
965 functions
->fViewport
= StubGLViewport
;
966 functions
->fBindFramebuffer
= StubGLBindFramebuffer
;
967 functions
->fBindRenderbuffer
= StubGLBindRenderbuffer
;
968 functions
->fCheckFramebufferStatus
= StubGLCheckFramebufferStatus
;
969 functions
->fDeleteFramebuffers
= StubGLDeleteFramebuffers
;
970 functions
->fDeleteRenderbuffers
= StubGLDeleteRenderbuffers
;
971 functions
->fFramebufferRenderbuffer
= StubGLFramebufferRenderbuffer
;
972 functions
->fFramebufferTexture2D
= StubGLFramebufferTexture2D
;
973 functions
->fFramebufferTexture2DMultisample
=
974 StubGLFramebufferTexture2DMultisample
;
975 functions
->fGenFramebuffers
= StubGLGenFramebuffers
;
976 functions
->fGenRenderbuffers
= StubGLGenRenderbuffers
;
977 functions
->fGetFramebufferAttachmentParameteriv
=
978 StubGLGetFramebufferAttachmentParameteriv
;
979 functions
->fGetRenderbufferParameteriv
= StubGLGetRenderbufferParameteriv
;
980 functions
->fRenderbufferStorage
= StubGLRenderbufferStorage
;
981 functions
->fRenderbufferStorageMultisample
=
982 StubGLRenderbufferStorageMultisample
;
983 functions
->fRenderbufferStorageMultisampleES2EXT
=
984 StubGLRenderbufferStorageMultisample
;
985 functions
->fBlitFramebuffer
= StubGLBlitFramebuffer
;
986 functions
->fMapBuffer
= StubGLMapBuffer
;
987 functions
->fUnmapBuffer
= StubGLUnmapBuffer
;
988 functions
->fBindFragDataLocationIndexed
=
989 StubGLBindFragDataLocationIndexed
;
990 functions
->fGetProgramResourceLocation
= StubGLGetProgramResourceLocation
;