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 2013 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 | #include "GrGLNoOpInterface.h" |
michael@0 | 9 | #include "SkString.h" |
michael@0 | 10 | #include "SkThread.h" |
michael@0 | 11 | |
michael@0 | 12 | // the OpenGLES 2.0 spec says this must be >= 128 |
michael@0 | 13 | static const GrGLint kDefaultMaxVertexUniformVectors = 128; |
michael@0 | 14 | |
michael@0 | 15 | // the OpenGLES 2.0 spec says this must be >=16 |
michael@0 | 16 | static const GrGLint kDefaultMaxFragmentUniformVectors = 16; |
michael@0 | 17 | |
michael@0 | 18 | // the OpenGLES 2.0 spec says this must be >= 8 |
michael@0 | 19 | static const GrGLint kDefaultMaxVertexAttribs = 8; |
michael@0 | 20 | |
michael@0 | 21 | // the OpenGLES 2.0 spec says this must be >= 8 |
michael@0 | 22 | static const GrGLint kDefaultMaxVaryingVectors = 8; |
michael@0 | 23 | |
michael@0 | 24 | static const char* kExtensions[] = { |
michael@0 | 25 | "GL_ARB_framebuffer_object", |
michael@0 | 26 | "GL_ARB_blend_func_extended", |
michael@0 | 27 | "GL_ARB_timer_query", |
michael@0 | 28 | "GL_ARB_draw_buffers", |
michael@0 | 29 | "GL_ARB_occlusion_query", |
michael@0 | 30 | "GL_EXT_blend_color", |
michael@0 | 31 | "GL_EXT_stencil_wrap" |
michael@0 | 32 | }; |
michael@0 | 33 | |
michael@0 | 34 | namespace { |
michael@0 | 35 | const GrGLubyte* combined_extensions_string() { |
michael@0 | 36 | static SkString gExtString; |
michael@0 | 37 | static SkMutex gMutex; |
michael@0 | 38 | gMutex.acquire(); |
michael@0 | 39 | if (0 == gExtString.size()) { |
michael@0 | 40 | for (size_t i = 0; i < GR_ARRAY_COUNT(kExtensions) - 1; ++i) { |
michael@0 | 41 | gExtString.append(kExtensions[i]); |
michael@0 | 42 | gExtString.append(" "); |
michael@0 | 43 | } |
michael@0 | 44 | gExtString.append(kExtensions[GR_ARRAY_COUNT(kExtensions) - 1]); |
michael@0 | 45 | } |
michael@0 | 46 | gMutex.release(); |
michael@0 | 47 | return (const GrGLubyte*) gExtString.c_str(); |
michael@0 | 48 | } |
michael@0 | 49 | } |
michael@0 | 50 | |
michael@0 | 51 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendColor(GrGLclampf red, |
michael@0 | 52 | GrGLclampf green, |
michael@0 | 53 | GrGLclampf blue, |
michael@0 | 54 | GrGLclampf alpha) { |
michael@0 | 55 | } |
michael@0 | 56 | |
michael@0 | 57 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBindFragDataLocation(GrGLuint program, |
michael@0 | 58 | GrGLuint colorNumber, |
michael@0 | 59 | const GrGLchar* name) { |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlendFunc(GrGLenum sfactor, |
michael@0 | 63 | GrGLenum dfactor) { |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBufferSubData(GrGLenum target, |
michael@0 | 67 | GrGLintptr offset, |
michael@0 | 68 | GrGLsizeiptr size, |
michael@0 | 69 | const GrGLvoid* data) { |
michael@0 | 70 | } |
michael@0 | 71 | |
michael@0 | 72 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLClear(GrGLbitfield mask) { |
michael@0 | 73 | } |
michael@0 | 74 | |
michael@0 | 75 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLClearColor(GrGLclampf red, |
michael@0 | 76 | GrGLclampf green, |
michael@0 | 77 | GrGLclampf blue, |
michael@0 | 78 | GrGLclampf alpha) { |
michael@0 | 79 | } |
michael@0 | 80 | |
michael@0 | 81 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLClearStencil(GrGLint s) { |
michael@0 | 82 | } |
michael@0 | 83 | |
michael@0 | 84 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLColorMask(GrGLboolean red, |
michael@0 | 85 | GrGLboolean green, |
michael@0 | 86 | GrGLboolean blue, |
michael@0 | 87 | GrGLboolean alpha) { |
michael@0 | 88 | } |
michael@0 | 89 | |
michael@0 | 90 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCompileShader(GrGLuint shader) { |
michael@0 | 91 | } |
michael@0 | 92 | |
michael@0 | 93 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCompressedTexImage2D(GrGLenum target, |
michael@0 | 94 | GrGLint level, |
michael@0 | 95 | GrGLenum internalformat, |
michael@0 | 96 | GrGLsizei width, |
michael@0 | 97 | GrGLsizei height, |
michael@0 | 98 | GrGLint border, |
michael@0 | 99 | GrGLsizei imageSize, |
michael@0 | 100 | const GrGLvoid* data) { |
michael@0 | 101 | } |
michael@0 | 102 | |
michael@0 | 103 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCopyTexSubImage2D(GrGLenum target, |
michael@0 | 104 | GrGLint level, |
michael@0 | 105 | GrGLint xoffset, |
michael@0 | 106 | GrGLint yoffset, |
michael@0 | 107 | GrGLint x, |
michael@0 | 108 | GrGLint y, |
michael@0 | 109 | GrGLsizei width, |
michael@0 | 110 | GrGLsizei height) { |
michael@0 | 111 | } |
michael@0 | 112 | |
michael@0 | 113 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLCullFace(GrGLenum mode) { |
michael@0 | 114 | } |
michael@0 | 115 | |
michael@0 | 116 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDepthMask(GrGLboolean flag) { |
michael@0 | 117 | } |
michael@0 | 118 | |
michael@0 | 119 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisable(GrGLenum cap) { |
michael@0 | 120 | } |
michael@0 | 121 | |
michael@0 | 122 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisableVertexAttribArray(GrGLuint index) { |
michael@0 | 123 | } |
michael@0 | 124 | |
michael@0 | 125 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawArrays(GrGLenum mode, |
michael@0 | 126 | GrGLint first, |
michael@0 | 127 | GrGLsizei count) { |
michael@0 | 128 | } |
michael@0 | 129 | |
michael@0 | 130 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawBuffer(GrGLenum mode) { |
michael@0 | 131 | } |
michael@0 | 132 | |
michael@0 | 133 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawBuffers(GrGLsizei n, |
michael@0 | 134 | const GrGLenum* bufs) { |
michael@0 | 135 | } |
michael@0 | 136 | |
michael@0 | 137 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawElements(GrGLenum mode, |
michael@0 | 138 | GrGLsizei count, |
michael@0 | 139 | GrGLenum type, |
michael@0 | 140 | const GrGLvoid* indices) { |
michael@0 | 141 | } |
michael@0 | 142 | |
michael@0 | 143 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnable(GrGLenum cap) { |
michael@0 | 144 | } |
michael@0 | 145 | |
michael@0 | 146 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnableVertexAttribArray(GrGLuint index) { |
michael@0 | 147 | } |
michael@0 | 148 | |
michael@0 | 149 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEndQuery(GrGLenum target) { |
michael@0 | 150 | } |
michael@0 | 151 | |
michael@0 | 152 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLFinish() { |
michael@0 | 153 | } |
michael@0 | 154 | |
michael@0 | 155 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLFlush() { |
michael@0 | 156 | } |
michael@0 | 157 | |
michael@0 | 158 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLFrontFace(GrGLenum mode) { |
michael@0 | 159 | } |
michael@0 | 160 | |
michael@0 | 161 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLLineWidth(GrGLfloat width) { |
michael@0 | 162 | } |
michael@0 | 163 | |
michael@0 | 164 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLLinkProgram(GrGLuint program) { |
michael@0 | 165 | } |
michael@0 | 166 | |
michael@0 | 167 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLLoadIdentity() { |
michael@0 | 168 | } |
michael@0 | 169 | |
michael@0 | 170 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLLoadMatrixf(const GrGLfloat*) { |
michael@0 | 171 | } |
michael@0 | 172 | |
michael@0 | 173 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLMatrixMode(GrGLenum) { |
michael@0 | 174 | } |
michael@0 | 175 | |
michael@0 | 176 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLQueryCounter(GrGLuint id, GrGLenum target) { |
michael@0 | 177 | } |
michael@0 | 178 | |
michael@0 | 179 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLReadBuffer(GrGLenum src) { |
michael@0 | 180 | } |
michael@0 | 181 | |
michael@0 | 182 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLScissor(GrGLint x, |
michael@0 | 183 | GrGLint y, |
michael@0 | 184 | GrGLsizei width, |
michael@0 | 185 | GrGLsizei height) { |
michael@0 | 186 | } |
michael@0 | 187 | |
michael@0 | 188 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLShaderSource(GrGLuint shader, |
michael@0 | 189 | GrGLsizei count, |
michael@0 | 190 | #if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE |
michael@0 | 191 | const char* const * str, |
michael@0 | 192 | #else |
michael@0 | 193 | const char** str, |
michael@0 | 194 | #endif |
michael@0 | 195 | const GrGLint* length) { |
michael@0 | 196 | } |
michael@0 | 197 | |
michael@0 | 198 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilFunc(GrGLenum func, GrGLint ref, GrGLuint mask) { |
michael@0 | 199 | } |
michael@0 | 200 | |
michael@0 | 201 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilFuncSeparate(GrGLenum face, |
michael@0 | 202 | GrGLenum func, |
michael@0 | 203 | GrGLint ref, |
michael@0 | 204 | GrGLuint mask) { |
michael@0 | 205 | } |
michael@0 | 206 | |
michael@0 | 207 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilMask(GrGLuint mask) { |
michael@0 | 208 | } |
michael@0 | 209 | |
michael@0 | 210 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilMaskSeparate(GrGLenum face, GrGLuint mask) { |
michael@0 | 211 | } |
michael@0 | 212 | |
michael@0 | 213 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilOp(GrGLenum fail, GrGLenum zfail, GrGLenum zpass) { |
michael@0 | 214 | } |
michael@0 | 215 | |
michael@0 | 216 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLStencilOpSeparate(GrGLenum face, |
michael@0 | 217 | GrGLenum fail, |
michael@0 | 218 | GrGLenum zfail, |
michael@0 | 219 | GrGLenum zpass) { |
michael@0 | 220 | } |
michael@0 | 221 | |
michael@0 | 222 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexGenf(GrGLenum, GrGLenum, float) { |
michael@0 | 223 | } |
michael@0 | 224 | |
michael@0 | 225 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexGenfv(GrGLenum, GrGLenum, const float*) { |
michael@0 | 226 | } |
michael@0 | 227 | |
michael@0 | 228 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexGeni(GrGLenum, GrGLenum, GrGLint) { |
michael@0 | 229 | } |
michael@0 | 230 | |
michael@0 | 231 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexImage2D(GrGLenum target, |
michael@0 | 232 | GrGLint level, |
michael@0 | 233 | GrGLint internalformat, |
michael@0 | 234 | GrGLsizei width, |
michael@0 | 235 | GrGLsizei height, |
michael@0 | 236 | GrGLint border, |
michael@0 | 237 | GrGLenum format, |
michael@0 | 238 | GrGLenum type, |
michael@0 | 239 | const GrGLvoid* pixels) { |
michael@0 | 240 | } |
michael@0 | 241 | |
michael@0 | 242 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexParameteri(GrGLenum target, |
michael@0 | 243 | GrGLenum pname, |
michael@0 | 244 | GrGLint param) { |
michael@0 | 245 | } |
michael@0 | 246 | |
michael@0 | 247 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexParameteriv(GrGLenum target, |
michael@0 | 248 | GrGLenum pname, |
michael@0 | 249 | const GrGLint* params) { |
michael@0 | 250 | } |
michael@0 | 251 | |
michael@0 | 252 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexStorage2D(GrGLenum target, |
michael@0 | 253 | GrGLsizei levels, |
michael@0 | 254 | GrGLenum internalformat, |
michael@0 | 255 | GrGLsizei width, |
michael@0 | 256 | GrGLsizei height) { |
michael@0 | 257 | } |
michael@0 | 258 | |
michael@0 | 259 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDiscardFramebuffer(GrGLenum target, |
michael@0 | 260 | GrGLsizei numAttachments, |
michael@0 | 261 | const GrGLenum* attachments) { |
michael@0 | 262 | } |
michael@0 | 263 | |
michael@0 | 264 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexSubImage2D(GrGLenum target, |
michael@0 | 265 | GrGLint level, |
michael@0 | 266 | GrGLint xoffset, |
michael@0 | 267 | GrGLint yoffset, |
michael@0 | 268 | GrGLsizei width, |
michael@0 | 269 | GrGLsizei height, |
michael@0 | 270 | GrGLenum format, |
michael@0 | 271 | GrGLenum type, |
michael@0 | 272 | const GrGLvoid* pixels) { |
michael@0 | 273 | } |
michael@0 | 274 | |
michael@0 | 275 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1f(GrGLint location, GrGLfloat v0) { |
michael@0 | 276 | } |
michael@0 | 277 | |
michael@0 | 278 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1i(GrGLint location, GrGLint v0) { |
michael@0 | 279 | } |
michael@0 | 280 | |
michael@0 | 281 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1fv(GrGLint location, |
michael@0 | 282 | GrGLsizei count, |
michael@0 | 283 | const GrGLfloat* v) { |
michael@0 | 284 | } |
michael@0 | 285 | |
michael@0 | 286 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform1iv(GrGLint location, |
michael@0 | 287 | GrGLsizei count, |
michael@0 | 288 | const GrGLint* v) { |
michael@0 | 289 | } |
michael@0 | 290 | |
michael@0 | 291 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2f(GrGLint location, GrGLfloat v0, GrGLfloat v1) { |
michael@0 | 292 | } |
michael@0 | 293 | |
michael@0 | 294 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2i(GrGLint location, GrGLint v0, GrGLint v1) { |
michael@0 | 295 | } |
michael@0 | 296 | |
michael@0 | 297 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2fv(GrGLint location, |
michael@0 | 298 | GrGLsizei count, |
michael@0 | 299 | const GrGLfloat* v) { |
michael@0 | 300 | } |
michael@0 | 301 | |
michael@0 | 302 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform2iv(GrGLint location, |
michael@0 | 303 | GrGLsizei count, |
michael@0 | 304 | const GrGLint* v) { |
michael@0 | 305 | } |
michael@0 | 306 | |
michael@0 | 307 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3f(GrGLint location, |
michael@0 | 308 | GrGLfloat v0, |
michael@0 | 309 | GrGLfloat v1, |
michael@0 | 310 | GrGLfloat v2) { |
michael@0 | 311 | } |
michael@0 | 312 | |
michael@0 | 313 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3i(GrGLint location, |
michael@0 | 314 | GrGLint v0, |
michael@0 | 315 | GrGLint v1, |
michael@0 | 316 | GrGLint v2) { |
michael@0 | 317 | } |
michael@0 | 318 | |
michael@0 | 319 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3fv(GrGLint location, |
michael@0 | 320 | GrGLsizei count, |
michael@0 | 321 | const GrGLfloat* v) { |
michael@0 | 322 | } |
michael@0 | 323 | |
michael@0 | 324 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform3iv(GrGLint location, |
michael@0 | 325 | GrGLsizei count, |
michael@0 | 326 | const GrGLint* v) { |
michael@0 | 327 | } |
michael@0 | 328 | |
michael@0 | 329 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4f(GrGLint location, |
michael@0 | 330 | GrGLfloat v0, |
michael@0 | 331 | GrGLfloat v1, |
michael@0 | 332 | GrGLfloat v2, |
michael@0 | 333 | GrGLfloat v3) { |
michael@0 | 334 | } |
michael@0 | 335 | |
michael@0 | 336 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4i(GrGLint location, |
michael@0 | 337 | GrGLint v0, |
michael@0 | 338 | GrGLint v1, |
michael@0 | 339 | GrGLint v2, |
michael@0 | 340 | GrGLint v3) { |
michael@0 | 341 | } |
michael@0 | 342 | |
michael@0 | 343 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4fv(GrGLint location, |
michael@0 | 344 | GrGLsizei count, |
michael@0 | 345 | const GrGLfloat* v) { |
michael@0 | 346 | } |
michael@0 | 347 | |
michael@0 | 348 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniform4iv(GrGLint location, |
michael@0 | 349 | GrGLsizei count, |
michael@0 | 350 | const GrGLint* v) { |
michael@0 | 351 | } |
michael@0 | 352 | |
michael@0 | 353 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniformMatrix2fv(GrGLint location, |
michael@0 | 354 | GrGLsizei count, |
michael@0 | 355 | GrGLboolean transpose, |
michael@0 | 356 | const GrGLfloat* value) { |
michael@0 | 357 | } |
michael@0 | 358 | |
michael@0 | 359 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniformMatrix3fv(GrGLint location, |
michael@0 | 360 | GrGLsizei count, |
michael@0 | 361 | GrGLboolean transpose, |
michael@0 | 362 | const GrGLfloat* value) { |
michael@0 | 363 | } |
michael@0 | 364 | |
michael@0 | 365 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLUniformMatrix4fv(GrGLint location, |
michael@0 | 366 | GrGLsizei count, |
michael@0 | 367 | GrGLboolean transpose, |
michael@0 | 368 | const GrGLfloat* value) { |
michael@0 | 369 | } |
michael@0 | 370 | |
michael@0 | 371 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLVertexAttrib4fv(GrGLuint indx, const GrGLfloat* values) { |
michael@0 | 372 | } |
michael@0 | 373 | |
michael@0 | 374 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLVertexAttribPointer(GrGLuint indx, |
michael@0 | 375 | GrGLint size, |
michael@0 | 376 | GrGLenum type, |
michael@0 | 377 | GrGLboolean normalized, |
michael@0 | 378 | GrGLsizei stride, |
michael@0 | 379 | const GrGLvoid* ptr) { |
michael@0 | 380 | } |
michael@0 | 381 | |
michael@0 | 382 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLViewport(GrGLint x, |
michael@0 | 383 | GrGLint y, |
michael@0 | 384 | GrGLsizei width, |
michael@0 | 385 | GrGLsizei height) { |
michael@0 | 386 | } |
michael@0 | 387 | |
michael@0 | 388 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetFramebufferAttachmentParameteriv(GrGLenum target, |
michael@0 | 389 | GrGLenum attachment, |
michael@0 | 390 | GrGLenum pname, |
michael@0 | 391 | GrGLint* params) { |
michael@0 | 392 | } |
michael@0 | 393 | |
michael@0 | 394 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetRenderbufferParameteriv(GrGLenum target, |
michael@0 | 395 | GrGLenum pname, |
michael@0 | 396 | GrGLint* params) { |
michael@0 | 397 | } |
michael@0 | 398 | |
michael@0 | 399 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLRenderbufferStorage(GrGLenum target, |
michael@0 | 400 | GrGLenum internalformat, |
michael@0 | 401 | GrGLsizei width, |
michael@0 | 402 | GrGLsizei height) { |
michael@0 | 403 | } |
michael@0 | 404 | |
michael@0 | 405 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLRenderbufferStorageMultisample(GrGLenum target, |
michael@0 | 406 | GrGLsizei samples, |
michael@0 | 407 | GrGLenum internalformat, |
michael@0 | 408 | GrGLsizei width, |
michael@0 | 409 | GrGLsizei height) { |
michael@0 | 410 | } |
michael@0 | 411 | |
michael@0 | 412 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBlitFramebuffer(GrGLint srcX0, |
michael@0 | 413 | GrGLint srcY0, |
michael@0 | 414 | GrGLint srcX1, |
michael@0 | 415 | GrGLint srcY1, |
michael@0 | 416 | GrGLint dstX0, |
michael@0 | 417 | GrGLint dstY0, |
michael@0 | 418 | GrGLint dstX1, |
michael@0 | 419 | GrGLint dstY1, |
michael@0 | 420 | GrGLbitfield mask, |
michael@0 | 421 | GrGLenum filter) { |
michael@0 | 422 | } |
michael@0 | 423 | |
michael@0 | 424 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLResolveMultisampleFramebuffer() { |
michael@0 | 425 | } |
michael@0 | 426 | |
michael@0 | 427 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLBindFragDataLocationIndexed(GrGLuint program, |
michael@0 | 428 | GrGLuint colorNumber, |
michael@0 | 429 | GrGLuint index, |
michael@0 | 430 | const GrGLchar * name) { |
michael@0 | 431 | } |
michael@0 | 432 | |
michael@0 | 433 | GrGLenum GR_GL_FUNCTION_TYPE noOpGLCheckFramebufferStatus(GrGLenum target) { |
michael@0 | 434 | |
michael@0 | 435 | GrAlwaysAssert(GR_GL_FRAMEBUFFER == target); |
michael@0 | 436 | |
michael@0 | 437 | return GR_GL_FRAMEBUFFER_COMPLETE; |
michael@0 | 438 | } |
michael@0 | 439 | |
michael@0 | 440 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGenIds(GrGLsizei n, GrGLuint* ids) { |
michael@0 | 441 | static int gCurrID = 1; |
michael@0 | 442 | for (int i = 0; i < n; ++i) { |
michael@0 | 443 | ids[i] = ++gCurrID; |
michael@0 | 444 | } |
michael@0 | 445 | } |
michael@0 | 446 | |
michael@0 | 447 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDeleteIds(GrGLsizei n, const GrGLuint* ids) { |
michael@0 | 448 | } |
michael@0 | 449 | |
michael@0 | 450 | GrGLenum GR_GL_FUNCTION_TYPE noOpGLGetError() { |
michael@0 | 451 | return GR_GL_NO_ERROR; |
michael@0 | 452 | } |
michael@0 | 453 | |
michael@0 | 454 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetIntegerv(GrGLenum pname, GrGLint* params) { |
michael@0 | 455 | // TODO: remove from Ganesh the #defines for gets we don't use. |
michael@0 | 456 | // We would like to minimize gets overall due to performance issues |
michael@0 | 457 | switch (pname) { |
michael@0 | 458 | case GR_GL_CONTEXT_PROFILE_MASK: |
michael@0 | 459 | *params = GR_GL_CONTEXT_COMPATIBILITY_PROFILE_BIT; |
michael@0 | 460 | break; |
michael@0 | 461 | case GR_GL_STENCIL_BITS: |
michael@0 | 462 | *params = 8; |
michael@0 | 463 | break; |
michael@0 | 464 | case GR_GL_SAMPLES: |
michael@0 | 465 | *params = 1; |
michael@0 | 466 | break; |
michael@0 | 467 | case GR_GL_FRAMEBUFFER_BINDING: |
michael@0 | 468 | *params = 0; |
michael@0 | 469 | break; |
michael@0 | 470 | case GR_GL_VIEWPORT: |
michael@0 | 471 | params[0] = 0; |
michael@0 | 472 | params[1] = 0; |
michael@0 | 473 | params[2] = 800; |
michael@0 | 474 | params[3] = 600; |
michael@0 | 475 | break; |
michael@0 | 476 | case GR_GL_MAX_TEXTURE_IMAGE_UNITS: |
michael@0 | 477 | *params = 8; |
michael@0 | 478 | break; |
michael@0 | 479 | case GR_GL_MAX_TEXTURE_COORDS: |
michael@0 | 480 | *params = 8; |
michael@0 | 481 | break; |
michael@0 | 482 | case GR_GL_MAX_VERTEX_UNIFORM_VECTORS: |
michael@0 | 483 | *params = kDefaultMaxVertexUniformVectors; |
michael@0 | 484 | break; |
michael@0 | 485 | case GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS: |
michael@0 | 486 | *params = kDefaultMaxFragmentUniformVectors; |
michael@0 | 487 | break; |
michael@0 | 488 | case GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS: |
michael@0 | 489 | *params = 16 * 4; |
michael@0 | 490 | break; |
michael@0 | 491 | case GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
michael@0 | 492 | *params = 0; |
michael@0 | 493 | break; |
michael@0 | 494 | case GR_GL_COMPRESSED_TEXTURE_FORMATS: |
michael@0 | 495 | break; |
michael@0 | 496 | case GR_GL_MAX_TEXTURE_SIZE: |
michael@0 | 497 | *params = 8192; |
michael@0 | 498 | break; |
michael@0 | 499 | case GR_GL_MAX_RENDERBUFFER_SIZE: |
michael@0 | 500 | *params = 8192; |
michael@0 | 501 | break; |
michael@0 | 502 | case GR_GL_MAX_SAMPLES: |
michael@0 | 503 | *params = 32; |
michael@0 | 504 | break; |
michael@0 | 505 | case GR_GL_MAX_VERTEX_ATTRIBS: |
michael@0 | 506 | *params = kDefaultMaxVertexAttribs; |
michael@0 | 507 | break; |
michael@0 | 508 | case GR_GL_MAX_VARYING_VECTORS: |
michael@0 | 509 | *params = kDefaultMaxVaryingVectors; |
michael@0 | 510 | break; |
michael@0 | 511 | case GR_GL_NUM_EXTENSIONS: |
michael@0 | 512 | *params = GR_ARRAY_COUNT(kExtensions); |
michael@0 | 513 | break; |
michael@0 | 514 | default: |
michael@0 | 515 | GrCrash("Unexpected pname to GetIntegerv"); |
michael@0 | 516 | } |
michael@0 | 517 | } |
michael@0 | 518 | |
michael@0 | 519 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetInfoLog(GrGLuint program, |
michael@0 | 520 | GrGLsizei bufsize, |
michael@0 | 521 | GrGLsizei* length, |
michael@0 | 522 | char* infolog) { |
michael@0 | 523 | if (length) { |
michael@0 | 524 | *length = 0; |
michael@0 | 525 | } |
michael@0 | 526 | if (bufsize > 0) { |
michael@0 | 527 | *infolog = 0; |
michael@0 | 528 | } |
michael@0 | 529 | } |
michael@0 | 530 | |
michael@0 | 531 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetShaderOrProgramiv(GrGLuint program, |
michael@0 | 532 | GrGLenum pname, |
michael@0 | 533 | GrGLint* params) { |
michael@0 | 534 | switch (pname) { |
michael@0 | 535 | case GR_GL_LINK_STATUS: // fallthru |
michael@0 | 536 | case GR_GL_COMPILE_STATUS: |
michael@0 | 537 | *params = GR_GL_TRUE; |
michael@0 | 538 | break; |
michael@0 | 539 | case GR_GL_INFO_LOG_LENGTH: |
michael@0 | 540 | *params = 0; |
michael@0 | 541 | break; |
michael@0 | 542 | // we don't expect any other pnames |
michael@0 | 543 | default: |
michael@0 | 544 | GrCrash("Unexpected pname to GetProgramiv"); |
michael@0 | 545 | break; |
michael@0 | 546 | } |
michael@0 | 547 | } |
michael@0 | 548 | |
michael@0 | 549 | namespace { |
michael@0 | 550 | template <typename T> |
michael@0 | 551 | void query_result(GrGLenum GLtarget, GrGLenum pname, T *params) { |
michael@0 | 552 | switch (pname) { |
michael@0 | 553 | case GR_GL_QUERY_RESULT_AVAILABLE: |
michael@0 | 554 | *params = GR_GL_TRUE; |
michael@0 | 555 | break; |
michael@0 | 556 | case GR_GL_QUERY_RESULT: |
michael@0 | 557 | *params = 0; |
michael@0 | 558 | break; |
michael@0 | 559 | default: |
michael@0 | 560 | GrCrash("Unexpected pname passed to GetQueryObject."); |
michael@0 | 561 | break; |
michael@0 | 562 | } |
michael@0 | 563 | } |
michael@0 | 564 | } |
michael@0 | 565 | |
michael@0 | 566 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryiv(GrGLenum GLtarget, |
michael@0 | 567 | GrGLenum pname, |
michael@0 | 568 | GrGLint *params) { |
michael@0 | 569 | switch (pname) { |
michael@0 | 570 | case GR_GL_CURRENT_QUERY: |
michael@0 | 571 | *params = 0; |
michael@0 | 572 | break; |
michael@0 | 573 | case GR_GL_QUERY_COUNTER_BITS: |
michael@0 | 574 | *params = 32; |
michael@0 | 575 | break; |
michael@0 | 576 | default: |
michael@0 | 577 | GrCrash("Unexpected pname passed GetQueryiv."); |
michael@0 | 578 | } |
michael@0 | 579 | } |
michael@0 | 580 | |
michael@0 | 581 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjecti64v(GrGLuint id, |
michael@0 | 582 | GrGLenum pname, |
michael@0 | 583 | GrGLint64 *params) { |
michael@0 | 584 | query_result(id, pname, params); |
michael@0 | 585 | } |
michael@0 | 586 | |
michael@0 | 587 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectiv(GrGLuint id, |
michael@0 | 588 | GrGLenum pname, |
michael@0 | 589 | GrGLint *params) { |
michael@0 | 590 | query_result(id, pname, params); |
michael@0 | 591 | } |
michael@0 | 592 | |
michael@0 | 593 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectui64v(GrGLuint id, |
michael@0 | 594 | GrGLenum pname, |
michael@0 | 595 | GrGLuint64 *params) { |
michael@0 | 596 | query_result(id, pname, params); |
michael@0 | 597 | } |
michael@0 | 598 | |
michael@0 | 599 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetQueryObjectuiv(GrGLuint id, |
michael@0 | 600 | GrGLenum pname, |
michael@0 | 601 | GrGLuint *params) { |
michael@0 | 602 | query_result(id, pname, params); |
michael@0 | 603 | } |
michael@0 | 604 | |
michael@0 | 605 | const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetString(GrGLenum name) { |
michael@0 | 606 | switch (name) { |
michael@0 | 607 | case GR_GL_EXTENSIONS: |
michael@0 | 608 | return combined_extensions_string(); |
michael@0 | 609 | case GR_GL_VERSION: |
michael@0 | 610 | return (const GrGLubyte*)"4.0 Debug GL"; |
michael@0 | 611 | case GR_GL_SHADING_LANGUAGE_VERSION: |
michael@0 | 612 | return (const GrGLubyte*)"4.20.8 Debug GLSL"; |
michael@0 | 613 | case GR_GL_VENDOR: |
michael@0 | 614 | return (const GrGLubyte*)"Debug Vendor"; |
michael@0 | 615 | case GR_GL_RENDERER: |
michael@0 | 616 | return (const GrGLubyte*)"The Debug (Non-)Renderer"; |
michael@0 | 617 | default: |
michael@0 | 618 | GrCrash("Unexpected name passed to GetString"); |
michael@0 | 619 | return NULL; |
michael@0 | 620 | } |
michael@0 | 621 | } |
michael@0 | 622 | |
michael@0 | 623 | const GrGLubyte* GR_GL_FUNCTION_TYPE noOpGLGetStringi(GrGLenum name, GrGLuint i) { |
michael@0 | 624 | switch (name) { |
michael@0 | 625 | case GR_GL_EXTENSIONS: |
michael@0 | 626 | if (static_cast<size_t>(i) <= GR_ARRAY_COUNT(kExtensions)) { |
michael@0 | 627 | return (const GrGLubyte*) kExtensions[i]; |
michael@0 | 628 | } else { |
michael@0 | 629 | return NULL; |
michael@0 | 630 | } |
michael@0 | 631 | default: |
michael@0 | 632 | GrCrash("Unexpected name passed to GetStringi"); |
michael@0 | 633 | return NULL; |
michael@0 | 634 | } |
michael@0 | 635 | } |
michael@0 | 636 | |
michael@0 | 637 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLGetTexLevelParameteriv(GrGLenum target, |
michael@0 | 638 | GrGLint level, |
michael@0 | 639 | GrGLenum pname, |
michael@0 | 640 | GrGLint* params) { |
michael@0 | 641 | // we used to use this to query stuff about externally created textures, |
michael@0 | 642 | // now we just require clients to tell us everything about the texture. |
michael@0 | 643 | GrCrash("Should never query texture parameters."); |
michael@0 | 644 | } |
michael@0 | 645 | |
michael@0 | 646 | GrGLint GR_GL_FUNCTION_TYPE noOpGLGetUniformLocation(GrGLuint program, const char* name) { |
michael@0 | 647 | static int gUniLocation = 0; |
michael@0 | 648 | return ++gUniLocation; |
michael@0 | 649 | } |
michael@0 | 650 | |
michael@0 | 651 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLInsertEventMarker(GrGLsizei length, const char* marker) { |
michael@0 | 652 | } |
michael@0 | 653 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLPushGroupMarker(GrGLsizei length , const char* marker) { |
michael@0 | 654 | } |
michael@0 | 655 | GrGLvoid GR_GL_FUNCTION_TYPE noOpGLPopGroupMarker() { |
michael@0 | 656 | } |