Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright 2011 Google Inc. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 5 | * found in the LICENSE file. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | |
michael@0 | 9 | #include "gl/GrGLInterface.h" |
michael@0 | 10 | #include "GrGLDefines.h" |
michael@0 | 11 | #include "SkTDArray.h" |
michael@0 | 12 | #include "GrGLNoOpInterface.h" |
michael@0 | 13 | |
michael@0 | 14 | // Functions not declared in GrGLBogusInterface.h (not common with the Debug GL interface). |
michael@0 | 15 | |
michael@0 | 16 | namespace { // added to suppress 'no previous prototype' warning |
michael@0 | 17 | |
michael@0 | 18 | class GrBufferObj { |
michael@0 | 19 | public: |
michael@0 | 20 | GrBufferObj(GrGLuint id) : fID(id), fDataPtr(NULL), fSize(0), fMapped(false) { |
michael@0 | 21 | } |
michael@0 | 22 | ~GrBufferObj() { SkDELETE_ARRAY(fDataPtr); } |
michael@0 | 23 | |
michael@0 | 24 | void allocate(GrGLsizeiptr size, const GrGLchar* dataPtr) { |
michael@0 | 25 | if (NULL != fDataPtr) { |
michael@0 | 26 | SkASSERT(0 != fSize); |
michael@0 | 27 | SkDELETE_ARRAY(fDataPtr); |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | fSize = size; |
michael@0 | 31 | fDataPtr = SkNEW_ARRAY(char, size); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | GrGLuint id() const { return fID; } |
michael@0 | 35 | GrGLchar* dataPtr() { return fDataPtr; } |
michael@0 | 36 | GrGLsizeiptr size() const { return fSize; } |
michael@0 | 37 | |
michael@0 | 38 | void setMapped(bool mapped) { fMapped = mapped; } |
michael@0 | 39 | bool mapped() const { return fMapped; } |
michael@0 | 40 | |
michael@0 | 41 | private: |
michael@0 | 42 | GrGLuint fID; |
michael@0 | 43 | GrGLchar* fDataPtr; |
michael@0 | 44 | GrGLsizeiptr fSize; // size in bytes |
michael@0 | 45 | bool fMapped; |
michael@0 | 46 | }; |
michael@0 | 47 | |
michael@0 | 48 | // In debug builds we do asserts that ensure we agree with GL about when a buffer |
michael@0 | 49 | // is mapped. |
michael@0 | 50 | static SkTDArray<GrBufferObj*> gBuffers; // slot 0 is reserved for head of free list |
michael@0 | 51 | static GrGLuint gCurrArrayBuffer; |
michael@0 | 52 | static GrGLuint gCurrElementArrayBuffer; |
michael@0 | 53 | |
michael@0 | 54 | static GrBufferObj* look_up(GrGLuint id) { |
michael@0 | 55 | GrBufferObj* buffer = gBuffers[id]; |
michael@0 | 56 | SkASSERT(NULL != buffer && buffer->id() == id); |
michael@0 | 57 | return buffer; |
michael@0 | 58 | } |
michael@0 | 59 | |
michael@0 | 60 | static GrBufferObj* create_buffer() { |
michael@0 | 61 | if (0 == gBuffers.count()) { |
michael@0 | 62 | // slot zero is reserved for the head of the free list |
michael@0 | 63 | *gBuffers.append() = NULL; |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | GrGLuint id; |
michael@0 | 67 | GrBufferObj* buffer; |
michael@0 | 68 | |
michael@0 | 69 | if (NULL == gBuffers[0]) { |
michael@0 | 70 | // no free slots - create a new one |
michael@0 | 71 | id = gBuffers.count(); |
michael@0 | 72 | buffer = SkNEW_ARGS(GrBufferObj, (id)); |
michael@0 | 73 | gBuffers.append(1, &buffer); |
michael@0 | 74 | } else { |
michael@0 | 75 | // recycle a slot from the free list |
michael@0 | 76 | id = SkTCast<GrGLuint>(gBuffers[0]); |
michael@0 | 77 | gBuffers[0] = gBuffers[id]; |
michael@0 | 78 | |
michael@0 | 79 | buffer = SkNEW_ARGS(GrBufferObj, (id)); |
michael@0 | 80 | gBuffers[id] = buffer; |
michael@0 | 81 | } |
michael@0 | 82 | |
michael@0 | 83 | return buffer; |
michael@0 | 84 | } |
michael@0 | 85 | |
michael@0 | 86 | static void delete_buffer(GrBufferObj* buffer) { |
michael@0 | 87 | SkASSERT(gBuffers.count() > 0); |
michael@0 | 88 | |
michael@0 | 89 | GrGLuint id = buffer->id(); |
michael@0 | 90 | SkDELETE(buffer); |
michael@0 | 91 | |
michael@0 | 92 | // Add this slot to the free list |
michael@0 | 93 | gBuffers[id] = gBuffers[0]; |
michael@0 | 94 | gBuffers[0] = SkTCast<GrBufferObj*>((const void*)(intptr_t)id); |
michael@0 | 95 | } |
michael@0 | 96 | |
michael@0 | 97 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLActiveTexture(GrGLenum texture) {} |
michael@0 | 98 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLAttachShader(GrGLuint program, GrGLuint shader) {} |
michael@0 | 99 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLBeginQuery(GrGLenum target, GrGLuint id) {} |
michael@0 | 100 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindAttribLocation(GrGLuint program, GrGLuint index, const char* name) {} |
michael@0 | 101 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindTexture(GrGLenum target, GrGLuint texture) {} |
michael@0 | 102 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindVertexArray(GrGLuint id) {} |
michael@0 | 103 | |
michael@0 | 104 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLGenBuffers(GrGLsizei n, GrGLuint* ids) { |
michael@0 | 105 | |
michael@0 | 106 | for (int i = 0; i < n; ++i) { |
michael@0 | 107 | GrBufferObj* buffer = create_buffer(); |
michael@0 | 108 | ids[i] = buffer->id(); |
michael@0 | 109 | } |
michael@0 | 110 | } |
michael@0 | 111 | |
michael@0 | 112 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLGenerateMipmap(GrGLenum target) {} |
michael@0 | 113 | |
michael@0 | 114 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLBufferData(GrGLenum target, |
michael@0 | 115 | GrGLsizeiptr size, |
michael@0 | 116 | const GrGLvoid* data, |
michael@0 | 117 | GrGLenum usage) { |
michael@0 | 118 | GrGLuint id = 0; |
michael@0 | 119 | |
michael@0 | 120 | switch (target) { |
michael@0 | 121 | case GR_GL_ARRAY_BUFFER: |
michael@0 | 122 | id = gCurrArrayBuffer; |
michael@0 | 123 | break; |
michael@0 | 124 | case GR_GL_ELEMENT_ARRAY_BUFFER: |
michael@0 | 125 | id = gCurrElementArrayBuffer; |
michael@0 | 126 | break; |
michael@0 | 127 | default: |
michael@0 | 128 | GrCrash("Unexpected target to nullGLBufferData"); |
michael@0 | 129 | break; |
michael@0 | 130 | } |
michael@0 | 131 | |
michael@0 | 132 | if (id > 0) { |
michael@0 | 133 | GrBufferObj* buffer = look_up(id); |
michael@0 | 134 | buffer->allocate(size, (const GrGLchar*) data); |
michael@0 | 135 | } |
michael@0 | 136 | } |
michael@0 | 137 | |
michael@0 | 138 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLPixelStorei(GrGLenum pname, GrGLint param) {} |
michael@0 | 139 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLReadPixels(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels) {} |
michael@0 | 140 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLUseProgram(GrGLuint program) {} |
michael@0 | 141 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLViewport(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height) {} |
michael@0 | 142 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindFramebuffer(GrGLenum target, GrGLuint framebuffer) {} |
michael@0 | 143 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindRenderbuffer(GrGLenum target, GrGLuint renderbuffer) {} |
michael@0 | 144 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLDeleteFramebuffers(GrGLsizei n, const GrGLuint *framebuffers) {} |
michael@0 | 145 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLDeleteRenderbuffers(GrGLsizei n, const GrGLuint *renderbuffers) {} |
michael@0 | 146 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLFramebufferRenderbuffer(GrGLenum target, GrGLenum attachment, GrGLenum renderbuffertarget, GrGLuint renderbuffer) {} |
michael@0 | 147 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLFramebufferTexture2D(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level) {} |
michael@0 | 148 | |
michael@0 | 149 | GrGLuint GR_GL_FUNCTION_TYPE nullGLCreateProgram() { |
michael@0 | 150 | static GrGLuint gCurrID = 0; |
michael@0 | 151 | return ++gCurrID; |
michael@0 | 152 | } |
michael@0 | 153 | |
michael@0 | 154 | GrGLuint GR_GL_FUNCTION_TYPE nullGLCreateShader(GrGLenum type) { |
michael@0 | 155 | static GrGLuint gCurrID = 0; |
michael@0 | 156 | return ++gCurrID; |
michael@0 | 157 | } |
michael@0 | 158 | |
michael@0 | 159 | // same delete used for shaders and programs |
michael@0 | 160 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLDelete(GrGLuint program) { |
michael@0 | 161 | } |
michael@0 | 162 | |
michael@0 | 163 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindBuffer(GrGLenum target, GrGLuint buffer) { |
michael@0 | 164 | switch (target) { |
michael@0 | 165 | case GR_GL_ARRAY_BUFFER: |
michael@0 | 166 | gCurrArrayBuffer = buffer; |
michael@0 | 167 | break; |
michael@0 | 168 | case GR_GL_ELEMENT_ARRAY_BUFFER: |
michael@0 | 169 | gCurrElementArrayBuffer = buffer; |
michael@0 | 170 | break; |
michael@0 | 171 | } |
michael@0 | 172 | } |
michael@0 | 173 | |
michael@0 | 174 | // deleting a bound buffer has the side effect of binding 0 |
michael@0 | 175 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLDeleteBuffers(GrGLsizei n, const GrGLuint* ids) { |
michael@0 | 176 | for (int i = 0; i < n; ++i) { |
michael@0 | 177 | if (ids[i] == gCurrArrayBuffer) { |
michael@0 | 178 | gCurrArrayBuffer = 0; |
michael@0 | 179 | } |
michael@0 | 180 | if (ids[i] == gCurrElementArrayBuffer) { |
michael@0 | 181 | gCurrElementArrayBuffer = 0; |
michael@0 | 182 | } |
michael@0 | 183 | |
michael@0 | 184 | GrBufferObj* buffer = look_up(ids[i]); |
michael@0 | 185 | delete_buffer(buffer); |
michael@0 | 186 | } |
michael@0 | 187 | } |
michael@0 | 188 | |
michael@0 | 189 | GrGLvoid* GR_GL_FUNCTION_TYPE nullGLMapBuffer(GrGLenum target, GrGLenum access) { |
michael@0 | 190 | |
michael@0 | 191 | GrGLuint id = 0; |
michael@0 | 192 | switch (target) { |
michael@0 | 193 | case GR_GL_ARRAY_BUFFER: |
michael@0 | 194 | id = gCurrArrayBuffer; |
michael@0 | 195 | break; |
michael@0 | 196 | case GR_GL_ELEMENT_ARRAY_BUFFER: |
michael@0 | 197 | id = gCurrElementArrayBuffer; |
michael@0 | 198 | break; |
michael@0 | 199 | } |
michael@0 | 200 | |
michael@0 | 201 | if (id > 0) { |
michael@0 | 202 | GrBufferObj* buffer = look_up(id); |
michael@0 | 203 | SkASSERT(!buffer->mapped()); |
michael@0 | 204 | buffer->setMapped(true); |
michael@0 | 205 | return buffer->dataPtr(); |
michael@0 | 206 | } |
michael@0 | 207 | |
michael@0 | 208 | SkASSERT(false); |
michael@0 | 209 | return NULL; // no buffer bound to target |
michael@0 | 210 | } |
michael@0 | 211 | |
michael@0 | 212 | GrGLboolean GR_GL_FUNCTION_TYPE nullGLUnmapBuffer(GrGLenum target) { |
michael@0 | 213 | GrGLuint id = 0; |
michael@0 | 214 | switch (target) { |
michael@0 | 215 | case GR_GL_ARRAY_BUFFER: |
michael@0 | 216 | id = gCurrArrayBuffer; |
michael@0 | 217 | break; |
michael@0 | 218 | case GR_GL_ELEMENT_ARRAY_BUFFER: |
michael@0 | 219 | id = gCurrElementArrayBuffer; |
michael@0 | 220 | break; |
michael@0 | 221 | } |
michael@0 | 222 | if (id > 0) { |
michael@0 | 223 | GrBufferObj* buffer = look_up(id); |
michael@0 | 224 | SkASSERT(buffer->mapped()); |
michael@0 | 225 | buffer->setMapped(false); |
michael@0 | 226 | return GR_GL_TRUE; |
michael@0 | 227 | } |
michael@0 | 228 | |
michael@0 | 229 | GrAlwaysAssert(false); |
michael@0 | 230 | return GR_GL_FALSE; // GR_GL_INVALID_OPERATION; |
michael@0 | 231 | } |
michael@0 | 232 | |
michael@0 | 233 | GrGLvoid GR_GL_FUNCTION_TYPE nullGLGetBufferParameteriv(GrGLenum target, GrGLenum pname, GrGLint* params) { |
michael@0 | 234 | switch (pname) { |
michael@0 | 235 | case GR_GL_BUFFER_MAPPED: { |
michael@0 | 236 | *params = GR_GL_FALSE; |
michael@0 | 237 | GrGLuint id = 0; |
michael@0 | 238 | switch (target) { |
michael@0 | 239 | case GR_GL_ARRAY_BUFFER: |
michael@0 | 240 | id = gCurrArrayBuffer; |
michael@0 | 241 | break; |
michael@0 | 242 | case GR_GL_ELEMENT_ARRAY_BUFFER: |
michael@0 | 243 | id = gCurrElementArrayBuffer; |
michael@0 | 244 | break; |
michael@0 | 245 | } |
michael@0 | 246 | if (id > 0) { |
michael@0 | 247 | GrBufferObj* buffer = look_up(id); |
michael@0 | 248 | if (buffer->mapped()) { |
michael@0 | 249 | *params = GR_GL_TRUE; |
michael@0 | 250 | } |
michael@0 | 251 | } |
michael@0 | 252 | break; } |
michael@0 | 253 | default: |
michael@0 | 254 | GrCrash("Unexpected pname to GetBufferParamateriv"); |
michael@0 | 255 | break; |
michael@0 | 256 | } |
michael@0 | 257 | }; |
michael@0 | 258 | |
michael@0 | 259 | } // end anonymous namespace |
michael@0 | 260 | |
michael@0 | 261 | const GrGLInterface* GrGLCreateNullInterface() { |
michael@0 | 262 | GrGLInterface* interface = SkNEW(GrGLInterface); |
michael@0 | 263 | |
michael@0 | 264 | interface->fStandard = kGL_GrGLStandard; |
michael@0 | 265 | |
michael@0 | 266 | GrGLInterface::Functions* functions = &interface->fFunctions; |
michael@0 | 267 | functions->fActiveTexture = nullGLActiveTexture; |
michael@0 | 268 | functions->fAttachShader = nullGLAttachShader; |
michael@0 | 269 | functions->fBeginQuery = nullGLBeginQuery; |
michael@0 | 270 | functions->fBindAttribLocation = nullGLBindAttribLocation; |
michael@0 | 271 | functions->fBindBuffer = nullGLBindBuffer; |
michael@0 | 272 | functions->fBindFragDataLocation = noOpGLBindFragDataLocation; |
michael@0 | 273 | functions->fBindTexture = nullGLBindTexture; |
michael@0 | 274 | functions->fBindVertexArray = nullGLBindVertexArray; |
michael@0 | 275 | functions->fBlendColor = noOpGLBlendColor; |
michael@0 | 276 | functions->fBlendFunc = noOpGLBlendFunc; |
michael@0 | 277 | functions->fBufferData = nullGLBufferData; |
michael@0 | 278 | functions->fBufferSubData = noOpGLBufferSubData; |
michael@0 | 279 | functions->fClear = noOpGLClear; |
michael@0 | 280 | functions->fClearColor = noOpGLClearColor; |
michael@0 | 281 | functions->fClearStencil = noOpGLClearStencil; |
michael@0 | 282 | functions->fColorMask = noOpGLColorMask; |
michael@0 | 283 | functions->fCompileShader = noOpGLCompileShader; |
michael@0 | 284 | functions->fCompressedTexImage2D = noOpGLCompressedTexImage2D; |
michael@0 | 285 | functions->fCopyTexSubImage2D = noOpGLCopyTexSubImage2D; |
michael@0 | 286 | functions->fCreateProgram = nullGLCreateProgram; |
michael@0 | 287 | functions->fCreateShader = nullGLCreateShader; |
michael@0 | 288 | functions->fCullFace = noOpGLCullFace; |
michael@0 | 289 | functions->fDeleteBuffers = nullGLDeleteBuffers; |
michael@0 | 290 | functions->fDeleteProgram = nullGLDelete; |
michael@0 | 291 | functions->fDeleteQueries = noOpGLDeleteIds; |
michael@0 | 292 | functions->fDeleteShader = nullGLDelete; |
michael@0 | 293 | functions->fDeleteTextures = noOpGLDeleteIds; |
michael@0 | 294 | functions->fDeleteVertexArrays = noOpGLDeleteIds; |
michael@0 | 295 | functions->fDepthMask = noOpGLDepthMask; |
michael@0 | 296 | functions->fDisable = noOpGLDisable; |
michael@0 | 297 | functions->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray; |
michael@0 | 298 | functions->fDrawArrays = noOpGLDrawArrays; |
michael@0 | 299 | functions->fDrawBuffer = noOpGLDrawBuffer; |
michael@0 | 300 | functions->fDrawBuffers = noOpGLDrawBuffers; |
michael@0 | 301 | functions->fDrawElements = noOpGLDrawElements; |
michael@0 | 302 | functions->fEnable = noOpGLEnable; |
michael@0 | 303 | functions->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray; |
michael@0 | 304 | functions->fEndQuery = noOpGLEndQuery; |
michael@0 | 305 | functions->fFinish = noOpGLFinish; |
michael@0 | 306 | functions->fFlush = noOpGLFlush; |
michael@0 | 307 | functions->fFrontFace = noOpGLFrontFace; |
michael@0 | 308 | functions->fGenBuffers = nullGLGenBuffers; |
michael@0 | 309 | functions->fGenerateMipmap = nullGLGenerateMipmap; |
michael@0 | 310 | functions->fGenQueries = noOpGLGenIds; |
michael@0 | 311 | functions->fGenTextures = noOpGLGenIds; |
michael@0 | 312 | functions->fGenVertexArrays = noOpGLGenIds; |
michael@0 | 313 | functions->fGetBufferParameteriv = nullGLGetBufferParameteriv; |
michael@0 | 314 | functions->fGetError = noOpGLGetError; |
michael@0 | 315 | functions->fGetIntegerv = noOpGLGetIntegerv; |
michael@0 | 316 | functions->fGetQueryObjecti64v = noOpGLGetQueryObjecti64v; |
michael@0 | 317 | functions->fGetQueryObjectiv = noOpGLGetQueryObjectiv; |
michael@0 | 318 | functions->fGetQueryObjectui64v = noOpGLGetQueryObjectui64v; |
michael@0 | 319 | functions->fGetQueryObjectuiv = noOpGLGetQueryObjectuiv; |
michael@0 | 320 | functions->fGetQueryiv = noOpGLGetQueryiv; |
michael@0 | 321 | functions->fGetProgramInfoLog = noOpGLGetInfoLog; |
michael@0 | 322 | functions->fGetProgramiv = noOpGLGetShaderOrProgramiv; |
michael@0 | 323 | functions->fGetShaderInfoLog = noOpGLGetInfoLog; |
michael@0 | 324 | functions->fGetShaderiv = noOpGLGetShaderOrProgramiv; |
michael@0 | 325 | functions->fGetString = noOpGLGetString; |
michael@0 | 326 | functions->fGetStringi = noOpGLGetStringi; |
michael@0 | 327 | functions->fGetTexLevelParameteriv = noOpGLGetTexLevelParameteriv; |
michael@0 | 328 | functions->fGetUniformLocation = noOpGLGetUniformLocation; |
michael@0 | 329 | functions->fInsertEventMarker = noOpGLInsertEventMarker; |
michael@0 | 330 | functions->fLoadIdentity = noOpGLLoadIdentity; |
michael@0 | 331 | functions->fLoadMatrixf = noOpGLLoadMatrixf; |
michael@0 | 332 | functions->fLineWidth = noOpGLLineWidth; |
michael@0 | 333 | functions->fLinkProgram = noOpGLLinkProgram; |
michael@0 | 334 | functions->fMatrixMode = noOpGLMatrixMode; |
michael@0 | 335 | functions->fPixelStorei = nullGLPixelStorei; |
michael@0 | 336 | functions->fPopGroupMarker = noOpGLPopGroupMarker; |
michael@0 | 337 | functions->fPushGroupMarker = noOpGLPushGroupMarker; |
michael@0 | 338 | functions->fQueryCounter = noOpGLQueryCounter; |
michael@0 | 339 | functions->fReadBuffer = noOpGLReadBuffer; |
michael@0 | 340 | functions->fReadPixels = nullGLReadPixels; |
michael@0 | 341 | functions->fScissor = noOpGLScissor; |
michael@0 | 342 | functions->fShaderSource = noOpGLShaderSource; |
michael@0 | 343 | functions->fStencilFunc = noOpGLStencilFunc; |
michael@0 | 344 | functions->fStencilFuncSeparate = noOpGLStencilFuncSeparate; |
michael@0 | 345 | functions->fStencilMask = noOpGLStencilMask; |
michael@0 | 346 | functions->fStencilMaskSeparate = noOpGLStencilMaskSeparate; |
michael@0 | 347 | functions->fStencilOp = noOpGLStencilOp; |
michael@0 | 348 | functions->fStencilOpSeparate = noOpGLStencilOpSeparate; |
michael@0 | 349 | functions->fTexGenfv = noOpGLTexGenfv; |
michael@0 | 350 | functions->fTexGeni = noOpGLTexGeni; |
michael@0 | 351 | functions->fTexImage2D = noOpGLTexImage2D; |
michael@0 | 352 | functions->fTexParameteri = noOpGLTexParameteri; |
michael@0 | 353 | functions->fTexParameteriv = noOpGLTexParameteriv; |
michael@0 | 354 | functions->fTexSubImage2D = noOpGLTexSubImage2D; |
michael@0 | 355 | functions->fTexStorage2D = noOpGLTexStorage2D; |
michael@0 | 356 | functions->fDiscardFramebuffer = noOpGLDiscardFramebuffer; |
michael@0 | 357 | functions->fUniform1f = noOpGLUniform1f; |
michael@0 | 358 | functions->fUniform1i = noOpGLUniform1i; |
michael@0 | 359 | functions->fUniform1fv = noOpGLUniform1fv; |
michael@0 | 360 | functions->fUniform1iv = noOpGLUniform1iv; |
michael@0 | 361 | functions->fUniform2f = noOpGLUniform2f; |
michael@0 | 362 | functions->fUniform2i = noOpGLUniform2i; |
michael@0 | 363 | functions->fUniform2fv = noOpGLUniform2fv; |
michael@0 | 364 | functions->fUniform2iv = noOpGLUniform2iv; |
michael@0 | 365 | functions->fUniform3f = noOpGLUniform3f; |
michael@0 | 366 | functions->fUniform3i = noOpGLUniform3i; |
michael@0 | 367 | functions->fUniform3fv = noOpGLUniform3fv; |
michael@0 | 368 | functions->fUniform3iv = noOpGLUniform3iv; |
michael@0 | 369 | functions->fUniform4f = noOpGLUniform4f; |
michael@0 | 370 | functions->fUniform4i = noOpGLUniform4i; |
michael@0 | 371 | functions->fUniform4fv = noOpGLUniform4fv; |
michael@0 | 372 | functions->fUniform4iv = noOpGLUniform4iv; |
michael@0 | 373 | functions->fUniformMatrix2fv = noOpGLUniformMatrix2fv; |
michael@0 | 374 | functions->fUniformMatrix3fv = noOpGLUniformMatrix3fv; |
michael@0 | 375 | functions->fUniformMatrix4fv = noOpGLUniformMatrix4fv; |
michael@0 | 376 | functions->fUseProgram = nullGLUseProgram; |
michael@0 | 377 | functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv; |
michael@0 | 378 | functions->fVertexAttribPointer = noOpGLVertexAttribPointer; |
michael@0 | 379 | functions->fViewport = nullGLViewport; |
michael@0 | 380 | functions->fBindFramebuffer = nullGLBindFramebuffer; |
michael@0 | 381 | functions->fBindRenderbuffer = nullGLBindRenderbuffer; |
michael@0 | 382 | functions->fCheckFramebufferStatus = noOpGLCheckFramebufferStatus; |
michael@0 | 383 | functions->fDeleteFramebuffers = nullGLDeleteFramebuffers; |
michael@0 | 384 | functions->fDeleteRenderbuffers = nullGLDeleteRenderbuffers; |
michael@0 | 385 | functions->fFramebufferRenderbuffer = nullGLFramebufferRenderbuffer; |
michael@0 | 386 | functions->fFramebufferTexture2D = nullGLFramebufferTexture2D; |
michael@0 | 387 | functions->fGenFramebuffers = noOpGLGenIds; |
michael@0 | 388 | functions->fGenRenderbuffers = noOpGLGenIds; |
michael@0 | 389 | functions->fGetFramebufferAttachmentParameteriv = noOpGLGetFramebufferAttachmentParameteriv; |
michael@0 | 390 | functions->fGetRenderbufferParameteriv = noOpGLGetRenderbufferParameteriv; |
michael@0 | 391 | functions->fRenderbufferStorage = noOpGLRenderbufferStorage; |
michael@0 | 392 | functions->fRenderbufferStorageMultisample = noOpGLRenderbufferStorageMultisample; |
michael@0 | 393 | functions->fBlitFramebuffer = noOpGLBlitFramebuffer; |
michael@0 | 394 | functions->fResolveMultisampleFramebuffer = noOpGLResolveMultisampleFramebuffer; |
michael@0 | 395 | functions->fMapBuffer = nullGLMapBuffer; |
michael@0 | 396 | functions->fUnmapBuffer = nullGLUnmapBuffer; |
michael@0 | 397 | functions->fBindFragDataLocationIndexed = noOpGLBindFragDataLocationIndexed; |
michael@0 | 398 | |
michael@0 | 399 | interface->fExtensions.init(kGL_GrGLStandard, functions->fGetString, functions->fGetStringi, |
michael@0 | 400 | functions->fGetIntegerv); |
michael@0 | 401 | return interface; |
michael@0 | 402 | } |