michael@0: /* michael@0: * Copyright 2013 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #include "GrGLNoOpInterface.h" michael@0: #include "SkString.h" michael@0: #include "SkThread.h" michael@0: michael@0: // the OpenGLES 2.0 spec says this must be >= 128 michael@0: static const GrGLint kDefaultMaxVertexUniformVectors = 128; michael@0: michael@0: // the OpenGLES 2.0 spec says this must be >=16 michael@0: static const GrGLint kDefaultMaxFragmentUniformVectors = 16; michael@0: michael@0: // the OpenGLES 2.0 spec says this must be >= 8 michael@0: static const GrGLint kDefaultMaxVertexAttribs = 8; michael@0: michael@0: // the OpenGLES 2.0 spec says this must be >= 8 michael@0: static const GrGLint kDefaultMaxVaryingVectors = 8; michael@0: michael@0: static const char* kExtensions[] = { michael@0: "GL_ARB_framebuffer_object", michael@0: "GL_ARB_blend_func_extended", michael@0: "GL_ARB_timer_query", michael@0: "GL_ARB_draw_buffers", michael@0: "GL_ARB_occlusion_query", michael@0: "GL_EXT_blend_color", michael@0: "GL_EXT_stencil_wrap" michael@0: }; michael@0: michael@0: namespace { michael@0: const GrGLubyte* combined_extensions_string() { michael@0: static SkString gExtString; michael@0: static SkMutex gMutex; michael@0: gMutex.acquire(); michael@0: if (0 == gExtString.size()) { michael@0: for (size_t i = 0; i < GR_ARRAY_COUNT(kExtensions) - 1; ++i) { michael@0: gExtString.append(kExtensions[i]); michael@0: gExtString.append(" "); michael@0: } michael@0: gExtString.append(kExtensions[GR_ARRAY_COUNT(kExtensions) - 1]); michael@0: } michael@0: gMutex.release(); michael@0: return (const GrGLubyte*) gExtString.c_str(); michael@0: } michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendColor(GrGLclampf red, michael@0: GrGLclampf green, michael@0: GrGLclampf blue, michael@0: GrGLclampf alpha) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBindFragDataLocation(GrGLuint program, michael@0: GrGLuint colorNumber, michael@0: const GrGLchar* name) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendFunc(GrGLenum sfactor, michael@0: GrGLenum dfactor) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBufferSubData(GrGLenum target, michael@0: GrGLintptr offset, michael@0: GrGLsizeiptr size, michael@0: const GrGLvoid* data) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLClear(GrGLbitfield mask) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLClearColor(GrGLclampf red, michael@0: GrGLclampf green, michael@0: GrGLclampf blue, michael@0: GrGLclampf alpha) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLClearStencil(GrGLint s) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLColorMask(GrGLboolean red, michael@0: GrGLboolean green, michael@0: GrGLboolean blue, michael@0: GrGLboolean alpha) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCompileShader(GrGLuint shader) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCompressedTexImage2D(GrGLenum target, michael@0: GrGLint level, michael@0: GrGLenum internalformat, michael@0: GrGLsizei width, michael@0: GrGLsizei height, michael@0: GrGLint border, michael@0: GrGLsizei imageSize, michael@0: const GrGLvoid* data) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCopyTexSubImage2D(GrGLenum target, michael@0: GrGLint level, michael@0: GrGLint xoffset, michael@0: GrGLint yoffset, michael@0: GrGLint x, michael@0: GrGLint y, michael@0: GrGLsizei width, michael@0: GrGLsizei height) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCullFace(GrGLenum mode) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDepthMask(GrGLboolean flag) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisable(GrGLenum cap) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisableVertexAttribArray(GrGLuint index) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawArrays(GrGLenum mode, michael@0: GrGLint first, michael@0: GrGLsizei count) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawBuffer(GrGLenum mode) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawBuffers(GrGLsizei n, michael@0: const GrGLenum* bufs) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawElements(GrGLenum mode, michael@0: GrGLsizei count, michael@0: GrGLenum type, michael@0: const GrGLvoid* indices) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnable(GrGLenum cap) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnableVertexAttribArray(GrGLuint index) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEndQuery(GrGLenum target) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLFinish() { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLFlush() { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLFrontFace(GrGLenum mode) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLLineWidth(GrGLfloat width) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLLinkProgram(GrGLuint program) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLLoadIdentity() { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLLoadMatrixf(const GrGLfloat*) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLMatrixMode(GrGLenum) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLQueryCounter(GrGLuint id, GrGLenum target) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLReadBuffer(GrGLenum src) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLScissor(GrGLint x, michael@0: GrGLint y, michael@0: GrGLsizei width, michael@0: GrGLsizei height) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLShaderSource(GrGLuint shader, michael@0: GrGLsizei count, michael@0: #if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE michael@0: const char* const * str, michael@0: #else michael@0: const char** str, michael@0: #endif michael@0: const GrGLint* length) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilFunc(GrGLenum func, GrGLint ref, GrGLuint mask) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilFuncSeparate(GrGLenum face, michael@0: GrGLenum func, michael@0: GrGLint ref, michael@0: GrGLuint mask) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilMask(GrGLuint mask) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilMaskSeparate(GrGLenum face, GrGLuint mask) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilOp(GrGLenum fail, GrGLenum zfail, GrGLenum zpass) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilOpSeparate(GrGLenum face, michael@0: GrGLenum fail, michael@0: GrGLenum zfail, michael@0: GrGLenum zpass) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexGenf(GrGLenum, GrGLenum, float) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexGenfv(GrGLenum, GrGLenum, const float*) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexGeni(GrGLenum, GrGLenum, GrGLint) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexImage2D(GrGLenum target, michael@0: GrGLint level, michael@0: GrGLint internalformat, michael@0: GrGLsizei width, michael@0: GrGLsizei height, michael@0: GrGLint border, michael@0: GrGLenum format, michael@0: GrGLenum type, michael@0: const GrGLvoid* pixels) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexParameteri(GrGLenum target, michael@0: GrGLenum pname, michael@0: GrGLint param) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexParameteriv(GrGLenum target, michael@0: GrGLenum pname, michael@0: const GrGLint* params) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexStorage2D(GrGLenum target, michael@0: GrGLsizei levels, michael@0: GrGLenum internalformat, michael@0: GrGLsizei width, michael@0: GrGLsizei height) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDiscardFramebuffer(GrGLenum target, michael@0: GrGLsizei numAttachments, michael@0: const GrGLenum* attachments) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexSubImage2D(GrGLenum target, michael@0: GrGLint level, michael@0: GrGLint xoffset, michael@0: GrGLint yoffset, michael@0: GrGLsizei width, michael@0: GrGLsizei height, michael@0: GrGLenum format, michael@0: GrGLenum type, michael@0: const GrGLvoid* pixels) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1f(GrGLint location, GrGLfloat v0) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1i(GrGLint location, GrGLint v0) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1fv(GrGLint location, michael@0: GrGLsizei count, michael@0: const GrGLfloat* v) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1iv(GrGLint location, michael@0: GrGLsizei count, michael@0: const GrGLint* v) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2f(GrGLint location, GrGLfloat v0, GrGLfloat v1) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2i(GrGLint location, GrGLint v0, GrGLint v1) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2fv(GrGLint location, michael@0: GrGLsizei count, michael@0: const GrGLfloat* v) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2iv(GrGLint location, michael@0: GrGLsizei count, michael@0: const GrGLint* v) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3f(GrGLint location, michael@0: GrGLfloat v0, michael@0: GrGLfloat v1, michael@0: GrGLfloat v2) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3i(GrGLint location, michael@0: GrGLint v0, michael@0: GrGLint v1, michael@0: GrGLint v2) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3fv(GrGLint location, michael@0: GrGLsizei count, michael@0: const GrGLfloat* v) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3iv(GrGLint location, michael@0: GrGLsizei count, michael@0: const GrGLint* v) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4f(GrGLint location, michael@0: GrGLfloat v0, michael@0: GrGLfloat v1, michael@0: GrGLfloat v2, michael@0: GrGLfloat v3) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4i(GrGLint location, michael@0: GrGLint v0, michael@0: GrGLint v1, michael@0: GrGLint v2, michael@0: GrGLint v3) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4fv(GrGLint location, michael@0: GrGLsizei count, michael@0: const GrGLfloat* v) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4iv(GrGLint location, michael@0: GrGLsizei count, michael@0: const GrGLint* v) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniformMatrix2fv(GrGLint location, michael@0: GrGLsizei count, michael@0: GrGLboolean transpose, michael@0: const GrGLfloat* value) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniformMatrix3fv(GrGLint location, michael@0: GrGLsizei count, michael@0: GrGLboolean transpose, michael@0: const GrGLfloat* value) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniformMatrix4fv(GrGLint location, michael@0: GrGLsizei count, michael@0: GrGLboolean transpose, michael@0: const GrGLfloat* value) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLVertexAttrib4fv(GrGLuint indx, const GrGLfloat* values) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLVertexAttribPointer(GrGLuint indx, michael@0: GrGLint size, michael@0: GrGLenum type, michael@0: GrGLboolean normalized, michael@0: GrGLsizei stride, michael@0: const GrGLvoid* ptr) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLViewport(GrGLint x, michael@0: GrGLint y, michael@0: GrGLsizei width, michael@0: GrGLsizei height) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetFramebufferAttachmentParameteriv(GrGLenum target, michael@0: GrGLenum attachment, michael@0: GrGLenum pname, michael@0: GrGLint* params) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetRenderbufferParameteriv(GrGLenum target, michael@0: GrGLenum pname, michael@0: GrGLint* params) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLRenderbufferStorage(GrGLenum target, michael@0: GrGLenum internalformat, michael@0: GrGLsizei width, michael@0: GrGLsizei height) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLRenderbufferStorageMultisample(GrGLenum target, michael@0: GrGLsizei samples, michael@0: GrGLenum internalformat, michael@0: GrGLsizei width, michael@0: GrGLsizei height) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlitFramebuffer(GrGLint srcX0, michael@0: GrGLint srcY0, michael@0: GrGLint srcX1, michael@0: GrGLint srcY1, michael@0: GrGLint dstX0, michael@0: GrGLint dstY0, michael@0: GrGLint dstX1, michael@0: GrGLint dstY1, michael@0: GrGLbitfield mask, michael@0: GrGLenum filter) { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLResolveMultisampleFramebuffer() { michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBindFragDataLocationIndexed(GrGLuint program, michael@0: GrGLuint colorNumber, michael@0: GrGLuint index, michael@0: const GrGLchar * name) { michael@0: } michael@0: michael@0: GrGLenum GR_GL_FUNCTION_TYPE noOpGLCheckFramebufferStatus(GrGLenum target) { michael@0: michael@0: GrAlwaysAssert(GR_GL_FRAMEBUFFER == target); michael@0: michael@0: return GR_GL_FRAMEBUFFER_COMPLETE; michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGenIds(GrGLsizei n, GrGLuint* ids) { michael@0: static int gCurrID = 1; michael@0: for (int i = 0; i < n; ++i) { michael@0: ids[i] = ++gCurrID; michael@0: } michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDeleteIds(GrGLsizei n, const GrGLuint* ids) { michael@0: } michael@0: michael@0: GrGLenum GR_GL_FUNCTION_TYPE noOpGLGetError() { michael@0: return GR_GL_NO_ERROR; michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetIntegerv(GrGLenum pname, GrGLint* params) { michael@0: // TODO: remove from Ganesh the #defines for gets we don't use. michael@0: // We would like to minimize gets overall due to performance issues michael@0: switch (pname) { michael@0: case GR_GL_CONTEXT_PROFILE_MASK: michael@0: *params = GR_GL_CONTEXT_COMPATIBILITY_PROFILE_BIT; michael@0: break; michael@0: case GR_GL_STENCIL_BITS: michael@0: *params = 8; michael@0: break; michael@0: case GR_GL_SAMPLES: michael@0: *params = 1; michael@0: break; michael@0: case GR_GL_FRAMEBUFFER_BINDING: michael@0: *params = 0; michael@0: break; michael@0: case GR_GL_VIEWPORT: michael@0: params[0] = 0; michael@0: params[1] = 0; michael@0: params[2] = 800; michael@0: params[3] = 600; michael@0: break; michael@0: case GR_GL_MAX_TEXTURE_IMAGE_UNITS: michael@0: *params = 8; michael@0: break; michael@0: case GR_GL_MAX_TEXTURE_COORDS: michael@0: *params = 8; michael@0: break; michael@0: case GR_GL_MAX_VERTEX_UNIFORM_VECTORS: michael@0: *params = kDefaultMaxVertexUniformVectors; michael@0: break; michael@0: case GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS: michael@0: *params = kDefaultMaxFragmentUniformVectors; michael@0: break; michael@0: case GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS: michael@0: *params = 16 * 4; michael@0: break; michael@0: case GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS: michael@0: *params = 0; michael@0: break; michael@0: case GR_GL_COMPRESSED_TEXTURE_FORMATS: michael@0: break; michael@0: case GR_GL_MAX_TEXTURE_SIZE: michael@0: *params = 8192; michael@0: break; michael@0: case GR_GL_MAX_RENDERBUFFER_SIZE: michael@0: *params = 8192; michael@0: break; michael@0: case GR_GL_MAX_SAMPLES: michael@0: *params = 32; michael@0: break; michael@0: case GR_GL_MAX_VERTEX_ATTRIBS: michael@0: *params = kDefaultMaxVertexAttribs; michael@0: break; michael@0: case GR_GL_MAX_VARYING_VECTORS: michael@0: *params = kDefaultMaxVaryingVectors; michael@0: break; michael@0: case GR_GL_NUM_EXTENSIONS: michael@0: *params = GR_ARRAY_COUNT(kExtensions); michael@0: break; michael@0: default: michael@0: GrCrash("Unexpected pname to GetIntegerv"); michael@0: } michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetInfoLog(GrGLuint program, michael@0: GrGLsizei bufsize, michael@0: GrGLsizei* length, michael@0: char* infolog) { michael@0: if (length) { michael@0: *length = 0; michael@0: } michael@0: if (bufsize > 0) { michael@0: *infolog = 0; michael@0: } michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetShaderOrProgramiv(GrGLuint program, michael@0: GrGLenum pname, michael@0: GrGLint* params) { michael@0: switch (pname) { michael@0: case GR_GL_LINK_STATUS: // fallthru michael@0: case GR_GL_COMPILE_STATUS: michael@0: *params = GR_GL_TRUE; michael@0: break; michael@0: case GR_GL_INFO_LOG_LENGTH: michael@0: *params = 0; michael@0: break; michael@0: // we don't expect any other pnames michael@0: default: michael@0: GrCrash("Unexpected pname to GetProgramiv"); michael@0: break; michael@0: } michael@0: } michael@0: michael@0: namespace { michael@0: template michael@0: void query_result(GrGLenum GLtarget, GrGLenum pname, T *params) { michael@0: switch (pname) { michael@0: case GR_GL_QUERY_RESULT_AVAILABLE: michael@0: *params = GR_GL_TRUE; michael@0: break; michael@0: case GR_GL_QUERY_RESULT: michael@0: *params = 0; michael@0: break; michael@0: default: michael@0: GrCrash("Unexpected pname passed to GetQueryObject."); michael@0: break; michael@0: } michael@0: } michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryiv(GrGLenum GLtarget, michael@0: GrGLenum pname, michael@0: GrGLint *params) { michael@0: switch (pname) { michael@0: case GR_GL_CURRENT_QUERY: michael@0: *params = 0; michael@0: break; michael@0: case GR_GL_QUERY_COUNTER_BITS: michael@0: *params = 32; michael@0: break; michael@0: default: michael@0: GrCrash("Unexpected pname passed GetQueryiv."); michael@0: } michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjecti64v(GrGLuint id, michael@0: GrGLenum pname, michael@0: GrGLint64 *params) { michael@0: query_result(id, pname, params); michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectiv(GrGLuint id, michael@0: GrGLenum pname, michael@0: GrGLint *params) { michael@0: query_result(id, pname, params); michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectui64v(GrGLuint id, michael@0: GrGLenum pname, michael@0: GrGLuint64 *params) { michael@0: query_result(id, pname, params); michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectuiv(GrGLuint id, michael@0: GrGLenum pname, michael@0: GrGLuint *params) { michael@0: query_result(id, pname, params); michael@0: } michael@0: michael@0: const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetString(GrGLenum name) { michael@0: switch (name) { michael@0: case GR_GL_EXTENSIONS: michael@0: return combined_extensions_string(); michael@0: case GR_GL_VERSION: michael@0: return (const GrGLubyte*)"4.0 Debug GL"; michael@0: case GR_GL_SHADING_LANGUAGE_VERSION: michael@0: return (const GrGLubyte*)"4.20.8 Debug GLSL"; michael@0: case GR_GL_VENDOR: michael@0: return (const GrGLubyte*)"Debug Vendor"; michael@0: case GR_GL_RENDERER: michael@0: return (const GrGLubyte*)"The Debug (Non-)Renderer"; michael@0: default: michael@0: GrCrash("Unexpected name passed to GetString"); michael@0: return NULL; michael@0: } michael@0: } michael@0: michael@0: const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetStringi(GrGLenum name, GrGLuint i) { michael@0: switch (name) { michael@0: case GR_GL_EXTENSIONS: michael@0: if (static_cast(i) <= GR_ARRAY_COUNT(kExtensions)) { michael@0: return (const GrGLubyte*) kExtensions[i]; michael@0: } else { michael@0: return NULL; michael@0: } michael@0: default: michael@0: GrCrash("Unexpected name passed to GetStringi"); michael@0: return NULL; michael@0: } michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetTexLevelParameteriv(GrGLenum target, michael@0: GrGLint level, michael@0: GrGLenum pname, michael@0: GrGLint* params) { michael@0: // we used to use this to query stuff about externally created textures, michael@0: // now we just require clients to tell us everything about the texture. michael@0: GrCrash("Should never query texture parameters."); michael@0: } michael@0: michael@0: GrGLint GR_GL_FUNCTION_TYPE noOpGLGetUniformLocation(GrGLuint program, const char* name) { michael@0: static int gUniLocation = 0; michael@0: return ++gUniLocation; michael@0: } michael@0: michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLInsertEventMarker(GrGLsizei length, const char* marker) { michael@0: } michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLPushGroupMarker(GrGLsizei length , const char* marker) { michael@0: } michael@0: GrGLvoid GR_GL_FUNCTION_TYPE noOpGLPopGroupMarker() { michael@0: }