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