1 // Generated Code - DO NOT EDIT !!
2 // generated by 'emugen'
3 
4 
5 #include <string.h>
6 #include "gl_opcodes.h"
7 
8 #include "gl_enc.h"
9 
10 
11 #include <vector>
12 
13 #include <stdio.h>
14 
15 namespace {
16 
enc_unsupported()17 void enc_unsupported()
18 {
19 	ALOGE("Function is unsupported\n");
20 }
21 
glAlphaFunc_enc(void * self,GLenum func,GLclampf ref)22 void glAlphaFunc_enc(void *self , GLenum func, GLclampf ref)
23 {
24 
25 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
26 	IOStream *stream = ctx->m_stream;
27 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
28 	bool useChecksum = checksumCalculator->getVersion() > 0;
29 
30 	 unsigned char *ptr;
31 	 unsigned char *buf;
32 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
33 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
34 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
35 	buf = stream->alloc(totalSize);
36 	ptr = buf;
37 	int tmp = OP_glAlphaFunc;memcpy(ptr, &tmp, 4); ptr += 4;
38 	memcpy(ptr, &totalSize, 4);  ptr += 4;
39 
40 		memcpy(ptr, &func, 4); ptr += 4;
41 		memcpy(ptr, &ref, 4); ptr += 4;
42 
43 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
44 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
45 
46 }
47 
glClearColor_enc(void * self,GLclampf red,GLclampf green,GLclampf blue,GLclampf alpha)48 void glClearColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
49 {
50 
51 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
52 	IOStream *stream = ctx->m_stream;
53 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
54 	bool useChecksum = checksumCalculator->getVersion() > 0;
55 
56 	 unsigned char *ptr;
57 	 unsigned char *buf;
58 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
59 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
60 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
61 	buf = stream->alloc(totalSize);
62 	ptr = buf;
63 	int tmp = OP_glClearColor;memcpy(ptr, &tmp, 4); ptr += 4;
64 	memcpy(ptr, &totalSize, 4);  ptr += 4;
65 
66 		memcpy(ptr, &red, 4); ptr += 4;
67 		memcpy(ptr, &green, 4); ptr += 4;
68 		memcpy(ptr, &blue, 4); ptr += 4;
69 		memcpy(ptr, &alpha, 4); ptr += 4;
70 
71 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
72 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
73 
74 }
75 
glClearDepthf_enc(void * self,GLclampf depth)76 void glClearDepthf_enc(void *self , GLclampf depth)
77 {
78 
79 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
80 	IOStream *stream = ctx->m_stream;
81 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
82 	bool useChecksum = checksumCalculator->getVersion() > 0;
83 
84 	 unsigned char *ptr;
85 	 unsigned char *buf;
86 	 const size_t sizeWithoutChecksum = 8 + 4;
87 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
88 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
89 	buf = stream->alloc(totalSize);
90 	ptr = buf;
91 	int tmp = OP_glClearDepthf;memcpy(ptr, &tmp, 4); ptr += 4;
92 	memcpy(ptr, &totalSize, 4);  ptr += 4;
93 
94 		memcpy(ptr, &depth, 4); ptr += 4;
95 
96 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
97 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
98 
99 }
100 
glClipPlanef_enc(void * self,GLenum plane,const GLfloat * equation)101 void glClipPlanef_enc(void *self , GLenum plane, const GLfloat* equation)
102 {
103 
104 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
105 	IOStream *stream = ctx->m_stream;
106 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
107 	bool useChecksum = checksumCalculator->getVersion() > 0;
108 
109 	const unsigned int __size_equation =  (4 * sizeof(float));
110 	 unsigned char *ptr;
111 	 unsigned char *buf;
112 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
113 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
114 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
115 	buf = stream->alloc(totalSize);
116 	ptr = buf;
117 	int tmp = OP_glClipPlanef;memcpy(ptr, &tmp, 4); ptr += 4;
118 	memcpy(ptr, &totalSize, 4);  ptr += 4;
119 
120 		memcpy(ptr, &plane, 4); ptr += 4;
121 	*(unsigned int *)(ptr) = __size_equation; ptr += 4;
122 	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
123 
124 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
125 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
126 
127 }
128 
glColor4f_enc(void * self,GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)129 void glColor4f_enc(void *self , GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
130 {
131 
132 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
133 	IOStream *stream = ctx->m_stream;
134 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
135 	bool useChecksum = checksumCalculator->getVersion() > 0;
136 
137 	 unsigned char *ptr;
138 	 unsigned char *buf;
139 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
140 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
141 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
142 	buf = stream->alloc(totalSize);
143 	ptr = buf;
144 	int tmp = OP_glColor4f;memcpy(ptr, &tmp, 4); ptr += 4;
145 	memcpy(ptr, &totalSize, 4);  ptr += 4;
146 
147 		memcpy(ptr, &red, 4); ptr += 4;
148 		memcpy(ptr, &green, 4); ptr += 4;
149 		memcpy(ptr, &blue, 4); ptr += 4;
150 		memcpy(ptr, &alpha, 4); ptr += 4;
151 
152 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
153 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
154 
155 }
156 
glDepthRangef_enc(void * self,GLclampf zNear,GLclampf zFar)157 void glDepthRangef_enc(void *self , GLclampf zNear, GLclampf zFar)
158 {
159 
160 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
161 	IOStream *stream = ctx->m_stream;
162 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
163 	bool useChecksum = checksumCalculator->getVersion() > 0;
164 
165 	 unsigned char *ptr;
166 	 unsigned char *buf;
167 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
168 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
169 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
170 	buf = stream->alloc(totalSize);
171 	ptr = buf;
172 	int tmp = OP_glDepthRangef;memcpy(ptr, &tmp, 4); ptr += 4;
173 	memcpy(ptr, &totalSize, 4);  ptr += 4;
174 
175 		memcpy(ptr, &zNear, 4); ptr += 4;
176 		memcpy(ptr, &zFar, 4); ptr += 4;
177 
178 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
179 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
180 
181 }
182 
glFogf_enc(void * self,GLenum pname,GLfloat param)183 void glFogf_enc(void *self , GLenum pname, GLfloat param)
184 {
185 
186 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
187 	IOStream *stream = ctx->m_stream;
188 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
189 	bool useChecksum = checksumCalculator->getVersion() > 0;
190 
191 	 unsigned char *ptr;
192 	 unsigned char *buf;
193 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
194 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
195 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
196 	buf = stream->alloc(totalSize);
197 	ptr = buf;
198 	int tmp = OP_glFogf;memcpy(ptr, &tmp, 4); ptr += 4;
199 	memcpy(ptr, &totalSize, 4);  ptr += 4;
200 
201 		memcpy(ptr, &pname, 4); ptr += 4;
202 		memcpy(ptr, &param, 4); ptr += 4;
203 
204 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
205 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
206 
207 }
208 
glFogfv_enc(void * self,GLenum pname,const GLfloat * params)209 void glFogfv_enc(void *self , GLenum pname, const GLfloat* params)
210 {
211 
212 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
213 	IOStream *stream = ctx->m_stream;
214 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
215 	bool useChecksum = checksumCalculator->getVersion() > 0;
216 
217 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
218 	 unsigned char *ptr;
219 	 unsigned char *buf;
220 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
221 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
222 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
223 	buf = stream->alloc(totalSize);
224 	ptr = buf;
225 	int tmp = OP_glFogfv;memcpy(ptr, &tmp, 4); ptr += 4;
226 	memcpy(ptr, &totalSize, 4);  ptr += 4;
227 
228 		memcpy(ptr, &pname, 4); ptr += 4;
229 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
230 	memcpy(ptr, params, __size_params);ptr += __size_params;
231 
232 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
233 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
234 
235 }
236 
glFrustumf_enc(void * self,GLfloat left,GLfloat right,GLfloat bottom,GLfloat top,GLfloat zNear,GLfloat zFar)237 void glFrustumf_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
238 {
239 
240 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
241 	IOStream *stream = ctx->m_stream;
242 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
243 	bool useChecksum = checksumCalculator->getVersion() > 0;
244 
245 	 unsigned char *ptr;
246 	 unsigned char *buf;
247 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
248 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
249 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
250 	buf = stream->alloc(totalSize);
251 	ptr = buf;
252 	int tmp = OP_glFrustumf;memcpy(ptr, &tmp, 4); ptr += 4;
253 	memcpy(ptr, &totalSize, 4);  ptr += 4;
254 
255 		memcpy(ptr, &left, 4); ptr += 4;
256 		memcpy(ptr, &right, 4); ptr += 4;
257 		memcpy(ptr, &bottom, 4); ptr += 4;
258 		memcpy(ptr, &top, 4); ptr += 4;
259 		memcpy(ptr, &zNear, 4); ptr += 4;
260 		memcpy(ptr, &zFar, 4); ptr += 4;
261 
262 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
263 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
264 
265 }
266 
glGetClipPlanef_enc(void * self,GLenum pname,GLfloat * eqn)267 void glGetClipPlanef_enc(void *self , GLenum pname, GLfloat* eqn)
268 {
269 
270 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
271 	IOStream *stream = ctx->m_stream;
272 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
273 	bool useChecksum = checksumCalculator->getVersion() > 0;
274 
275 	const unsigned int __size_eqn =  (4 * sizeof(GLfloat));
276 	 unsigned char *ptr;
277 	 unsigned char *buf;
278 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
279 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
280 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
281 	buf = stream->alloc(totalSize);
282 	ptr = buf;
283 	int tmp = OP_glGetClipPlanef;memcpy(ptr, &tmp, 4); ptr += 4;
284 	memcpy(ptr, &totalSize, 4);  ptr += 4;
285 
286 		memcpy(ptr, &pname, 4); ptr += 4;
287 	*(unsigned int *)(ptr) = __size_eqn; ptr += 4;
288 
289 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
290 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
291 
292 	stream->readback(eqn, __size_eqn);
293 	if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
294 	if (useChecksum) {
295 		unsigned char *checksumBufPtr = NULL;
296 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
297 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
298 		stream->readback(checksumBufPtr, checksumSize);
299 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
300 			ALOGE("glGetClipPlanef: GL communication error, please report this issue to b.android.com.\n");
301 			abort();
302 		}
303 	}
304 }
305 
glGetFloatv_enc(void * self,GLenum pname,GLfloat * params)306 void glGetFloatv_enc(void *self , GLenum pname, GLfloat* params)
307 {
308 
309 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
310 	IOStream *stream = ctx->m_stream;
311 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
312 	bool useChecksum = checksumCalculator->getVersion() > 0;
313 
314 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
315 	 unsigned char *ptr;
316 	 unsigned char *buf;
317 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
318 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
319 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
320 	buf = stream->alloc(totalSize);
321 	ptr = buf;
322 	int tmp = OP_glGetFloatv;memcpy(ptr, &tmp, 4); ptr += 4;
323 	memcpy(ptr, &totalSize, 4);  ptr += 4;
324 
325 		memcpy(ptr, &pname, 4); ptr += 4;
326 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
327 
328 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
329 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
330 
331 	stream->readback(params, __size_params);
332 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
333 	if (useChecksum) {
334 		unsigned char *checksumBufPtr = NULL;
335 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
336 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
337 		stream->readback(checksumBufPtr, checksumSize);
338 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
339 			ALOGE("glGetFloatv: GL communication error, please report this issue to b.android.com.\n");
340 			abort();
341 		}
342 	}
343 }
344 
glGetLightfv_enc(void * self,GLenum light,GLenum pname,GLfloat * params)345 void glGetLightfv_enc(void *self , GLenum light, GLenum pname, GLfloat* params)
346 {
347 
348 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
349 	IOStream *stream = ctx->m_stream;
350 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
351 	bool useChecksum = checksumCalculator->getVersion() > 0;
352 
353 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
354 	 unsigned char *ptr;
355 	 unsigned char *buf;
356 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
357 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
358 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
359 	buf = stream->alloc(totalSize);
360 	ptr = buf;
361 	int tmp = OP_glGetLightfv;memcpy(ptr, &tmp, 4); ptr += 4;
362 	memcpy(ptr, &totalSize, 4);  ptr += 4;
363 
364 		memcpy(ptr, &light, 4); ptr += 4;
365 		memcpy(ptr, &pname, 4); ptr += 4;
366 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
367 
368 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
369 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
370 
371 	stream->readback(params, __size_params);
372 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
373 	if (useChecksum) {
374 		unsigned char *checksumBufPtr = NULL;
375 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
376 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
377 		stream->readback(checksumBufPtr, checksumSize);
378 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
379 			ALOGE("glGetLightfv: GL communication error, please report this issue to b.android.com.\n");
380 			abort();
381 		}
382 	}
383 }
384 
glGetMaterialfv_enc(void * self,GLenum face,GLenum pname,GLfloat * params)385 void glGetMaterialfv_enc(void *self , GLenum face, GLenum pname, GLfloat* params)
386 {
387 
388 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
389 	IOStream *stream = ctx->m_stream;
390 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
391 	bool useChecksum = checksumCalculator->getVersion() > 0;
392 
393 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
394 	 unsigned char *ptr;
395 	 unsigned char *buf;
396 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
397 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
398 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
399 	buf = stream->alloc(totalSize);
400 	ptr = buf;
401 	int tmp = OP_glGetMaterialfv;memcpy(ptr, &tmp, 4); ptr += 4;
402 	memcpy(ptr, &totalSize, 4);  ptr += 4;
403 
404 		memcpy(ptr, &face, 4); ptr += 4;
405 		memcpy(ptr, &pname, 4); ptr += 4;
406 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
407 
408 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
409 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
410 
411 	stream->readback(params, __size_params);
412 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
413 	if (useChecksum) {
414 		unsigned char *checksumBufPtr = NULL;
415 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
416 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
417 		stream->readback(checksumBufPtr, checksumSize);
418 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
419 			ALOGE("glGetMaterialfv: GL communication error, please report this issue to b.android.com.\n");
420 			abort();
421 		}
422 	}
423 }
424 
glGetTexEnvfv_enc(void * self,GLenum env,GLenum pname,GLfloat * params)425 void glGetTexEnvfv_enc(void *self , GLenum env, GLenum pname, GLfloat* params)
426 {
427 
428 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
429 	IOStream *stream = ctx->m_stream;
430 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
431 	bool useChecksum = checksumCalculator->getVersion() > 0;
432 
433 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
434 	 unsigned char *ptr;
435 	 unsigned char *buf;
436 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
437 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
438 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
439 	buf = stream->alloc(totalSize);
440 	ptr = buf;
441 	int tmp = OP_glGetTexEnvfv;memcpy(ptr, &tmp, 4); ptr += 4;
442 	memcpy(ptr, &totalSize, 4);  ptr += 4;
443 
444 		memcpy(ptr, &env, 4); ptr += 4;
445 		memcpy(ptr, &pname, 4); ptr += 4;
446 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
447 
448 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
449 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
450 
451 	stream->readback(params, __size_params);
452 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
453 	if (useChecksum) {
454 		unsigned char *checksumBufPtr = NULL;
455 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
456 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
457 		stream->readback(checksumBufPtr, checksumSize);
458 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
459 			ALOGE("glGetTexEnvfv: GL communication error, please report this issue to b.android.com.\n");
460 			abort();
461 		}
462 	}
463 }
464 
glGetTexParameterfv_enc(void * self,GLenum target,GLenum pname,GLfloat * params)465 void glGetTexParameterfv_enc(void *self , GLenum target, GLenum pname, GLfloat* params)
466 {
467 
468 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
469 	IOStream *stream = ctx->m_stream;
470 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
471 	bool useChecksum = checksumCalculator->getVersion() > 0;
472 
473 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
474 	 unsigned char *ptr;
475 	 unsigned char *buf;
476 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
477 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
478 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
479 	buf = stream->alloc(totalSize);
480 	ptr = buf;
481 	int tmp = OP_glGetTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
482 	memcpy(ptr, &totalSize, 4);  ptr += 4;
483 
484 		memcpy(ptr, &target, 4); ptr += 4;
485 		memcpy(ptr, &pname, 4); ptr += 4;
486 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
487 
488 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
489 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
490 
491 	stream->readback(params, __size_params);
492 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
493 	if (useChecksum) {
494 		unsigned char *checksumBufPtr = NULL;
495 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
496 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
497 		stream->readback(checksumBufPtr, checksumSize);
498 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
499 			ALOGE("glGetTexParameterfv: GL communication error, please report this issue to b.android.com.\n");
500 			abort();
501 		}
502 	}
503 }
504 
glLightModelf_enc(void * self,GLenum pname,GLfloat param)505 void glLightModelf_enc(void *self , GLenum pname, GLfloat param)
506 {
507 
508 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
509 	IOStream *stream = ctx->m_stream;
510 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
511 	bool useChecksum = checksumCalculator->getVersion() > 0;
512 
513 	 unsigned char *ptr;
514 	 unsigned char *buf;
515 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
516 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
517 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
518 	buf = stream->alloc(totalSize);
519 	ptr = buf;
520 	int tmp = OP_glLightModelf;memcpy(ptr, &tmp, 4); ptr += 4;
521 	memcpy(ptr, &totalSize, 4);  ptr += 4;
522 
523 		memcpy(ptr, &pname, 4); ptr += 4;
524 		memcpy(ptr, &param, 4); ptr += 4;
525 
526 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
527 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
528 
529 }
530 
glLightModelfv_enc(void * self,GLenum pname,const GLfloat * params)531 void glLightModelfv_enc(void *self , GLenum pname, const GLfloat* params)
532 {
533 
534 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
535 	IOStream *stream = ctx->m_stream;
536 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
537 	bool useChecksum = checksumCalculator->getVersion() > 0;
538 
539 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
540 	 unsigned char *ptr;
541 	 unsigned char *buf;
542 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
543 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
544 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
545 	buf = stream->alloc(totalSize);
546 	ptr = buf;
547 	int tmp = OP_glLightModelfv;memcpy(ptr, &tmp, 4); ptr += 4;
548 	memcpy(ptr, &totalSize, 4);  ptr += 4;
549 
550 		memcpy(ptr, &pname, 4); ptr += 4;
551 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
552 	memcpy(ptr, params, __size_params);ptr += __size_params;
553 
554 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
555 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
556 
557 }
558 
glLightf_enc(void * self,GLenum light,GLenum pname,GLfloat param)559 void glLightf_enc(void *self , GLenum light, GLenum pname, GLfloat param)
560 {
561 
562 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
563 	IOStream *stream = ctx->m_stream;
564 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
565 	bool useChecksum = checksumCalculator->getVersion() > 0;
566 
567 	 unsigned char *ptr;
568 	 unsigned char *buf;
569 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
570 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
571 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
572 	buf = stream->alloc(totalSize);
573 	ptr = buf;
574 	int tmp = OP_glLightf;memcpy(ptr, &tmp, 4); ptr += 4;
575 	memcpy(ptr, &totalSize, 4);  ptr += 4;
576 
577 		memcpy(ptr, &light, 4); ptr += 4;
578 		memcpy(ptr, &pname, 4); ptr += 4;
579 		memcpy(ptr, &param, 4); ptr += 4;
580 
581 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
582 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
583 
584 }
585 
glLightfv_enc(void * self,GLenum light,GLenum pname,const GLfloat * params)586 void glLightfv_enc(void *self , GLenum light, GLenum pname, const GLfloat* params)
587 {
588 
589 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
590 	IOStream *stream = ctx->m_stream;
591 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
592 	bool useChecksum = checksumCalculator->getVersion() > 0;
593 
594 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
595 	 unsigned char *ptr;
596 	 unsigned char *buf;
597 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
598 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
599 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
600 	buf = stream->alloc(totalSize);
601 	ptr = buf;
602 	int tmp = OP_glLightfv;memcpy(ptr, &tmp, 4); ptr += 4;
603 	memcpy(ptr, &totalSize, 4);  ptr += 4;
604 
605 		memcpy(ptr, &light, 4); ptr += 4;
606 		memcpy(ptr, &pname, 4); ptr += 4;
607 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
608 	memcpy(ptr, params, __size_params);ptr += __size_params;
609 
610 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
611 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
612 
613 }
614 
glLineWidth_enc(void * self,GLfloat width)615 void glLineWidth_enc(void *self , GLfloat width)
616 {
617 
618 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
619 	IOStream *stream = ctx->m_stream;
620 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
621 	bool useChecksum = checksumCalculator->getVersion() > 0;
622 
623 	 unsigned char *ptr;
624 	 unsigned char *buf;
625 	 const size_t sizeWithoutChecksum = 8 + 4;
626 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
627 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
628 	buf = stream->alloc(totalSize);
629 	ptr = buf;
630 	int tmp = OP_glLineWidth;memcpy(ptr, &tmp, 4); ptr += 4;
631 	memcpy(ptr, &totalSize, 4);  ptr += 4;
632 
633 		memcpy(ptr, &width, 4); ptr += 4;
634 
635 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
636 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
637 
638 }
639 
glLoadMatrixf_enc(void * self,const GLfloat * m)640 void glLoadMatrixf_enc(void *self , const GLfloat* m)
641 {
642 
643 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
644 	IOStream *stream = ctx->m_stream;
645 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
646 	bool useChecksum = checksumCalculator->getVersion() > 0;
647 
648 	const unsigned int __size_m =  (16 * sizeof(GLfloat));
649 	 unsigned char *ptr;
650 	 unsigned char *buf;
651 	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
652 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
653 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
654 	buf = stream->alloc(totalSize);
655 	ptr = buf;
656 	int tmp = OP_glLoadMatrixf;memcpy(ptr, &tmp, 4); ptr += 4;
657 	memcpy(ptr, &totalSize, 4);  ptr += 4;
658 
659 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
660 	memcpy(ptr, m, __size_m);ptr += __size_m;
661 
662 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
663 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
664 
665 }
666 
glMaterialf_enc(void * self,GLenum face,GLenum pname,GLfloat param)667 void glMaterialf_enc(void *self , GLenum face, GLenum pname, GLfloat param)
668 {
669 
670 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
671 	IOStream *stream = ctx->m_stream;
672 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
673 	bool useChecksum = checksumCalculator->getVersion() > 0;
674 
675 	 unsigned char *ptr;
676 	 unsigned char *buf;
677 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
678 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
679 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
680 	buf = stream->alloc(totalSize);
681 	ptr = buf;
682 	int tmp = OP_glMaterialf;memcpy(ptr, &tmp, 4); ptr += 4;
683 	memcpy(ptr, &totalSize, 4);  ptr += 4;
684 
685 		memcpy(ptr, &face, 4); ptr += 4;
686 		memcpy(ptr, &pname, 4); ptr += 4;
687 		memcpy(ptr, &param, 4); ptr += 4;
688 
689 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
690 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
691 
692 }
693 
glMaterialfv_enc(void * self,GLenum face,GLenum pname,const GLfloat * params)694 void glMaterialfv_enc(void *self , GLenum face, GLenum pname, const GLfloat* params)
695 {
696 
697 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
698 	IOStream *stream = ctx->m_stream;
699 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
700 	bool useChecksum = checksumCalculator->getVersion() > 0;
701 
702 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
703 	 unsigned char *ptr;
704 	 unsigned char *buf;
705 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
706 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
707 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
708 	buf = stream->alloc(totalSize);
709 	ptr = buf;
710 	int tmp = OP_glMaterialfv;memcpy(ptr, &tmp, 4); ptr += 4;
711 	memcpy(ptr, &totalSize, 4);  ptr += 4;
712 
713 		memcpy(ptr, &face, 4); ptr += 4;
714 		memcpy(ptr, &pname, 4); ptr += 4;
715 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
716 	memcpy(ptr, params, __size_params);ptr += __size_params;
717 
718 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
719 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
720 
721 }
722 
glMultMatrixf_enc(void * self,const GLfloat * m)723 void glMultMatrixf_enc(void *self , const GLfloat* m)
724 {
725 
726 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
727 	IOStream *stream = ctx->m_stream;
728 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
729 	bool useChecksum = checksumCalculator->getVersion() > 0;
730 
731 	const unsigned int __size_m =  (16 * sizeof(GLfloat));
732 	 unsigned char *ptr;
733 	 unsigned char *buf;
734 	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
735 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
736 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
737 	buf = stream->alloc(totalSize);
738 	ptr = buf;
739 	int tmp = OP_glMultMatrixf;memcpy(ptr, &tmp, 4); ptr += 4;
740 	memcpy(ptr, &totalSize, 4);  ptr += 4;
741 
742 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
743 	memcpy(ptr, m, __size_m);ptr += __size_m;
744 
745 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
746 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
747 
748 }
749 
glMultiTexCoord4f_enc(void * self,GLenum target,GLfloat s,GLfloat t,GLfloat r,GLfloat q)750 void glMultiTexCoord4f_enc(void *self , GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
751 {
752 
753 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
754 	IOStream *stream = ctx->m_stream;
755 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
756 	bool useChecksum = checksumCalculator->getVersion() > 0;
757 
758 	 unsigned char *ptr;
759 	 unsigned char *buf;
760 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
761 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
762 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
763 	buf = stream->alloc(totalSize);
764 	ptr = buf;
765 	int tmp = OP_glMultiTexCoord4f;memcpy(ptr, &tmp, 4); ptr += 4;
766 	memcpy(ptr, &totalSize, 4);  ptr += 4;
767 
768 		memcpy(ptr, &target, 4); ptr += 4;
769 		memcpy(ptr, &s, 4); ptr += 4;
770 		memcpy(ptr, &t, 4); ptr += 4;
771 		memcpy(ptr, &r, 4); ptr += 4;
772 		memcpy(ptr, &q, 4); ptr += 4;
773 
774 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
775 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
776 
777 }
778 
glNormal3f_enc(void * self,GLfloat nx,GLfloat ny,GLfloat nz)779 void glNormal3f_enc(void *self , GLfloat nx, GLfloat ny, GLfloat nz)
780 {
781 
782 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
783 	IOStream *stream = ctx->m_stream;
784 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
785 	bool useChecksum = checksumCalculator->getVersion() > 0;
786 
787 	 unsigned char *ptr;
788 	 unsigned char *buf;
789 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
790 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
791 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
792 	buf = stream->alloc(totalSize);
793 	ptr = buf;
794 	int tmp = OP_glNormal3f;memcpy(ptr, &tmp, 4); ptr += 4;
795 	memcpy(ptr, &totalSize, 4);  ptr += 4;
796 
797 		memcpy(ptr, &nx, 4); ptr += 4;
798 		memcpy(ptr, &ny, 4); ptr += 4;
799 		memcpy(ptr, &nz, 4); ptr += 4;
800 
801 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
802 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
803 
804 }
805 
glOrthof_enc(void * self,GLfloat left,GLfloat right,GLfloat bottom,GLfloat top,GLfloat zNear,GLfloat zFar)806 void glOrthof_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
807 {
808 
809 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
810 	IOStream *stream = ctx->m_stream;
811 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
812 	bool useChecksum = checksumCalculator->getVersion() > 0;
813 
814 	 unsigned char *ptr;
815 	 unsigned char *buf;
816 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
817 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
818 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
819 	buf = stream->alloc(totalSize);
820 	ptr = buf;
821 	int tmp = OP_glOrthof;memcpy(ptr, &tmp, 4); ptr += 4;
822 	memcpy(ptr, &totalSize, 4);  ptr += 4;
823 
824 		memcpy(ptr, &left, 4); ptr += 4;
825 		memcpy(ptr, &right, 4); ptr += 4;
826 		memcpy(ptr, &bottom, 4); ptr += 4;
827 		memcpy(ptr, &top, 4); ptr += 4;
828 		memcpy(ptr, &zNear, 4); ptr += 4;
829 		memcpy(ptr, &zFar, 4); ptr += 4;
830 
831 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
832 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
833 
834 }
835 
glPointParameterf_enc(void * self,GLenum pname,GLfloat param)836 void glPointParameterf_enc(void *self , GLenum pname, GLfloat param)
837 {
838 
839 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
840 	IOStream *stream = ctx->m_stream;
841 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
842 	bool useChecksum = checksumCalculator->getVersion() > 0;
843 
844 	 unsigned char *ptr;
845 	 unsigned char *buf;
846 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
847 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
848 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
849 	buf = stream->alloc(totalSize);
850 	ptr = buf;
851 	int tmp = OP_glPointParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
852 	memcpy(ptr, &totalSize, 4);  ptr += 4;
853 
854 		memcpy(ptr, &pname, 4); ptr += 4;
855 		memcpy(ptr, &param, 4); ptr += 4;
856 
857 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
858 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
859 
860 }
861 
glPointParameterfv_enc(void * self,GLenum pname,const GLfloat * params)862 void glPointParameterfv_enc(void *self , GLenum pname, const GLfloat* params)
863 {
864 
865 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
866 	IOStream *stream = ctx->m_stream;
867 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
868 	bool useChecksum = checksumCalculator->getVersion() > 0;
869 
870 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
871 	 unsigned char *ptr;
872 	 unsigned char *buf;
873 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
874 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
875 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
876 	buf = stream->alloc(totalSize);
877 	ptr = buf;
878 	int tmp = OP_glPointParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
879 	memcpy(ptr, &totalSize, 4);  ptr += 4;
880 
881 		memcpy(ptr, &pname, 4); ptr += 4;
882 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
883 	memcpy(ptr, params, __size_params);ptr += __size_params;
884 
885 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
886 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
887 
888 }
889 
glPointSize_enc(void * self,GLfloat size)890 void glPointSize_enc(void *self , GLfloat size)
891 {
892 
893 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
894 	IOStream *stream = ctx->m_stream;
895 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
896 	bool useChecksum = checksumCalculator->getVersion() > 0;
897 
898 	 unsigned char *ptr;
899 	 unsigned char *buf;
900 	 const size_t sizeWithoutChecksum = 8 + 4;
901 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
902 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
903 	buf = stream->alloc(totalSize);
904 	ptr = buf;
905 	int tmp = OP_glPointSize;memcpy(ptr, &tmp, 4); ptr += 4;
906 	memcpy(ptr, &totalSize, 4);  ptr += 4;
907 
908 		memcpy(ptr, &size, 4); ptr += 4;
909 
910 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
911 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
912 
913 }
914 
glPolygonOffset_enc(void * self,GLfloat factor,GLfloat units)915 void glPolygonOffset_enc(void *self , GLfloat factor, GLfloat units)
916 {
917 
918 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
919 	IOStream *stream = ctx->m_stream;
920 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
921 	bool useChecksum = checksumCalculator->getVersion() > 0;
922 
923 	 unsigned char *ptr;
924 	 unsigned char *buf;
925 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
926 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
927 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
928 	buf = stream->alloc(totalSize);
929 	ptr = buf;
930 	int tmp = OP_glPolygonOffset;memcpy(ptr, &tmp, 4); ptr += 4;
931 	memcpy(ptr, &totalSize, 4);  ptr += 4;
932 
933 		memcpy(ptr, &factor, 4); ptr += 4;
934 		memcpy(ptr, &units, 4); ptr += 4;
935 
936 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
937 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
938 
939 }
940 
glRotatef_enc(void * self,GLfloat angle,GLfloat x,GLfloat y,GLfloat z)941 void glRotatef_enc(void *self , GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
942 {
943 
944 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
945 	IOStream *stream = ctx->m_stream;
946 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
947 	bool useChecksum = checksumCalculator->getVersion() > 0;
948 
949 	 unsigned char *ptr;
950 	 unsigned char *buf;
951 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
952 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
953 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
954 	buf = stream->alloc(totalSize);
955 	ptr = buf;
956 	int tmp = OP_glRotatef;memcpy(ptr, &tmp, 4); ptr += 4;
957 	memcpy(ptr, &totalSize, 4);  ptr += 4;
958 
959 		memcpy(ptr, &angle, 4); ptr += 4;
960 		memcpy(ptr, &x, 4); ptr += 4;
961 		memcpy(ptr, &y, 4); ptr += 4;
962 		memcpy(ptr, &z, 4); ptr += 4;
963 
964 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
965 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
966 
967 }
968 
glScalef_enc(void * self,GLfloat x,GLfloat y,GLfloat z)969 void glScalef_enc(void *self , GLfloat x, GLfloat y, GLfloat z)
970 {
971 
972 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
973 	IOStream *stream = ctx->m_stream;
974 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
975 	bool useChecksum = checksumCalculator->getVersion() > 0;
976 
977 	 unsigned char *ptr;
978 	 unsigned char *buf;
979 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
980 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
981 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
982 	buf = stream->alloc(totalSize);
983 	ptr = buf;
984 	int tmp = OP_glScalef;memcpy(ptr, &tmp, 4); ptr += 4;
985 	memcpy(ptr, &totalSize, 4);  ptr += 4;
986 
987 		memcpy(ptr, &x, 4); ptr += 4;
988 		memcpy(ptr, &y, 4); ptr += 4;
989 		memcpy(ptr, &z, 4); ptr += 4;
990 
991 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
992 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
993 
994 }
995 
glTexEnvf_enc(void * self,GLenum target,GLenum pname,GLfloat param)996 void glTexEnvf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
997 {
998 
999 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1000 	IOStream *stream = ctx->m_stream;
1001 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1002 	bool useChecksum = checksumCalculator->getVersion() > 0;
1003 
1004 	 unsigned char *ptr;
1005 	 unsigned char *buf;
1006 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
1007 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1008 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1009 	buf = stream->alloc(totalSize);
1010 	ptr = buf;
1011 	int tmp = OP_glTexEnvf;memcpy(ptr, &tmp, 4); ptr += 4;
1012 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1013 
1014 		memcpy(ptr, &target, 4); ptr += 4;
1015 		memcpy(ptr, &pname, 4); ptr += 4;
1016 		memcpy(ptr, &param, 4); ptr += 4;
1017 
1018 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1019 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1020 
1021 }
1022 
glTexEnvfv_enc(void * self,GLenum target,GLenum pname,const GLfloat * params)1023 void glTexEnvfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
1024 {
1025 
1026 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1027 	IOStream *stream = ctx->m_stream;
1028 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1029 	bool useChecksum = checksumCalculator->getVersion() > 0;
1030 
1031 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
1032 	 unsigned char *ptr;
1033 	 unsigned char *buf;
1034 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
1035 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1036 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1037 	buf = stream->alloc(totalSize);
1038 	ptr = buf;
1039 	int tmp = OP_glTexEnvfv;memcpy(ptr, &tmp, 4); ptr += 4;
1040 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1041 
1042 		memcpy(ptr, &target, 4); ptr += 4;
1043 		memcpy(ptr, &pname, 4); ptr += 4;
1044 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1045 	memcpy(ptr, params, __size_params);ptr += __size_params;
1046 
1047 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1048 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1049 
1050 }
1051 
glTexParameterf_enc(void * self,GLenum target,GLenum pname,GLfloat param)1052 void glTexParameterf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
1053 {
1054 
1055 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1056 	IOStream *stream = ctx->m_stream;
1057 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1058 	bool useChecksum = checksumCalculator->getVersion() > 0;
1059 
1060 	 unsigned char *ptr;
1061 	 unsigned char *buf;
1062 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
1063 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1064 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1065 	buf = stream->alloc(totalSize);
1066 	ptr = buf;
1067 	int tmp = OP_glTexParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
1068 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1069 
1070 		memcpy(ptr, &target, 4); ptr += 4;
1071 		memcpy(ptr, &pname, 4); ptr += 4;
1072 		memcpy(ptr, &param, 4); ptr += 4;
1073 
1074 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1075 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1076 
1077 }
1078 
glTexParameterfv_enc(void * self,GLenum target,GLenum pname,const GLfloat * params)1079 void glTexParameterfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
1080 {
1081 
1082 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1083 	IOStream *stream = ctx->m_stream;
1084 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1085 	bool useChecksum = checksumCalculator->getVersion() > 0;
1086 
1087 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
1088 	 unsigned char *ptr;
1089 	 unsigned char *buf;
1090 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
1091 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1092 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1093 	buf = stream->alloc(totalSize);
1094 	ptr = buf;
1095 	int tmp = OP_glTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
1096 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1097 
1098 		memcpy(ptr, &target, 4); ptr += 4;
1099 		memcpy(ptr, &pname, 4); ptr += 4;
1100 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1101 	memcpy(ptr, params, __size_params);ptr += __size_params;
1102 
1103 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1104 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1105 
1106 }
1107 
glTranslatef_enc(void * self,GLfloat x,GLfloat y,GLfloat z)1108 void glTranslatef_enc(void *self , GLfloat x, GLfloat y, GLfloat z)
1109 {
1110 
1111 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1112 	IOStream *stream = ctx->m_stream;
1113 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1114 	bool useChecksum = checksumCalculator->getVersion() > 0;
1115 
1116 	 unsigned char *ptr;
1117 	 unsigned char *buf;
1118 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
1119 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1120 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1121 	buf = stream->alloc(totalSize);
1122 	ptr = buf;
1123 	int tmp = OP_glTranslatef;memcpy(ptr, &tmp, 4); ptr += 4;
1124 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1125 
1126 		memcpy(ptr, &x, 4); ptr += 4;
1127 		memcpy(ptr, &y, 4); ptr += 4;
1128 		memcpy(ptr, &z, 4); ptr += 4;
1129 
1130 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1131 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1132 
1133 }
1134 
glActiveTexture_enc(void * self,GLenum texture)1135 void glActiveTexture_enc(void *self , GLenum texture)
1136 {
1137 
1138 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1139 	IOStream *stream = ctx->m_stream;
1140 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1141 	bool useChecksum = checksumCalculator->getVersion() > 0;
1142 
1143 	 unsigned char *ptr;
1144 	 unsigned char *buf;
1145 	 const size_t sizeWithoutChecksum = 8 + 4;
1146 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1147 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1148 	buf = stream->alloc(totalSize);
1149 	ptr = buf;
1150 	int tmp = OP_glActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
1151 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1152 
1153 		memcpy(ptr, &texture, 4); ptr += 4;
1154 
1155 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1156 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1157 
1158 }
1159 
glAlphaFuncx_enc(void * self,GLenum func,GLclampx ref)1160 void glAlphaFuncx_enc(void *self , GLenum func, GLclampx ref)
1161 {
1162 
1163 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1164 	IOStream *stream = ctx->m_stream;
1165 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1166 	bool useChecksum = checksumCalculator->getVersion() > 0;
1167 
1168 	 unsigned char *ptr;
1169 	 unsigned char *buf;
1170 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
1171 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1172 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1173 	buf = stream->alloc(totalSize);
1174 	ptr = buf;
1175 	int tmp = OP_glAlphaFuncx;memcpy(ptr, &tmp, 4); ptr += 4;
1176 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1177 
1178 		memcpy(ptr, &func, 4); ptr += 4;
1179 		memcpy(ptr, &ref, 4); ptr += 4;
1180 
1181 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1182 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1183 
1184 }
1185 
glBindBuffer_enc(void * self,GLenum target,GLuint buffer)1186 void glBindBuffer_enc(void *self , GLenum target, GLuint buffer)
1187 {
1188 
1189 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1190 	IOStream *stream = ctx->m_stream;
1191 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1192 	bool useChecksum = checksumCalculator->getVersion() > 0;
1193 
1194 	 unsigned char *ptr;
1195 	 unsigned char *buf;
1196 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
1197 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1198 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1199 	buf = stream->alloc(totalSize);
1200 	ptr = buf;
1201 	int tmp = OP_glBindBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
1202 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1203 
1204 		memcpy(ptr, &target, 4); ptr += 4;
1205 		memcpy(ptr, &buffer, 4); ptr += 4;
1206 
1207 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1208 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1209 
1210 }
1211 
glBindTexture_enc(void * self,GLenum target,GLuint texture)1212 void glBindTexture_enc(void *self , GLenum target, GLuint texture)
1213 {
1214 
1215 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1216 	IOStream *stream = ctx->m_stream;
1217 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1218 	bool useChecksum = checksumCalculator->getVersion() > 0;
1219 
1220 	 unsigned char *ptr;
1221 	 unsigned char *buf;
1222 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
1223 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1224 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1225 	buf = stream->alloc(totalSize);
1226 	ptr = buf;
1227 	int tmp = OP_glBindTexture;memcpy(ptr, &tmp, 4); ptr += 4;
1228 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1229 
1230 		memcpy(ptr, &target, 4); ptr += 4;
1231 		memcpy(ptr, &texture, 4); ptr += 4;
1232 
1233 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1234 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1235 
1236 }
1237 
glBlendFunc_enc(void * self,GLenum sfactor,GLenum dfactor)1238 void glBlendFunc_enc(void *self , GLenum sfactor, GLenum dfactor)
1239 {
1240 
1241 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1242 	IOStream *stream = ctx->m_stream;
1243 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1244 	bool useChecksum = checksumCalculator->getVersion() > 0;
1245 
1246 	 unsigned char *ptr;
1247 	 unsigned char *buf;
1248 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
1249 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1250 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1251 	buf = stream->alloc(totalSize);
1252 	ptr = buf;
1253 	int tmp = OP_glBlendFunc;memcpy(ptr, &tmp, 4); ptr += 4;
1254 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1255 
1256 		memcpy(ptr, &sfactor, 4); ptr += 4;
1257 		memcpy(ptr, &dfactor, 4); ptr += 4;
1258 
1259 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1260 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1261 
1262 }
1263 
glBufferData_enc(void * self,GLenum target,GLsizeiptr size,const GLvoid * data,GLenum usage)1264 void glBufferData_enc(void *self , GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
1265 {
1266 
1267 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1268 	IOStream *stream = ctx->m_stream;
1269 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1270 	bool useChecksum = checksumCalculator->getVersion() > 0;
1271 
1272 	const unsigned int __size_data = ((data != NULL) ?  size : 0);
1273 	 unsigned char *ptr;
1274 	 unsigned char *buf;
1275 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
1276 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1277 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1278 	buf = stream->alloc(totalSize);
1279 	ptr = buf;
1280 	int tmp = OP_glBufferData;memcpy(ptr, &tmp, 4); ptr += 4;
1281 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1282 
1283 		memcpy(ptr, &target, 4); ptr += 4;
1284 		memcpy(ptr, &size, 4); ptr += 4;
1285 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
1286 	if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
1287 		memcpy(ptr, &usage, 4); ptr += 4;
1288 
1289 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1290 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1291 
1292 }
1293 
glBufferSubData_enc(void * self,GLenum target,GLintptr offset,GLsizeiptr size,const GLvoid * data)1294 void glBufferSubData_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
1295 {
1296 
1297 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1298 	IOStream *stream = ctx->m_stream;
1299 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1300 	bool useChecksum = checksumCalculator->getVersion() > 0;
1301 
1302 	const unsigned int __size_data = ((data != NULL) ?  size : 0);
1303 	 unsigned char *ptr;
1304 	 unsigned char *buf;
1305 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 1*4;
1306 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1307 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1308 	buf = stream->alloc(totalSize);
1309 	ptr = buf;
1310 	int tmp = OP_glBufferSubData;memcpy(ptr, &tmp, 4); ptr += 4;
1311 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1312 
1313 		memcpy(ptr, &target, 4); ptr += 4;
1314 		memcpy(ptr, &offset, 4); ptr += 4;
1315 		memcpy(ptr, &size, 4); ptr += 4;
1316 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
1317 	if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
1318 
1319 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1320 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1321 
1322 }
1323 
glClear_enc(void * self,GLbitfield mask)1324 void glClear_enc(void *self , GLbitfield mask)
1325 {
1326 
1327 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1328 	IOStream *stream = ctx->m_stream;
1329 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1330 	bool useChecksum = checksumCalculator->getVersion() > 0;
1331 
1332 	 unsigned char *ptr;
1333 	 unsigned char *buf;
1334 	 const size_t sizeWithoutChecksum = 8 + 4;
1335 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1336 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1337 	buf = stream->alloc(totalSize);
1338 	ptr = buf;
1339 	int tmp = OP_glClear;memcpy(ptr, &tmp, 4); ptr += 4;
1340 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1341 
1342 		memcpy(ptr, &mask, 4); ptr += 4;
1343 
1344 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1345 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1346 
1347 }
1348 
glClearColorx_enc(void * self,GLclampx red,GLclampx green,GLclampx blue,GLclampx alpha)1349 void glClearColorx_enc(void *self , GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
1350 {
1351 
1352 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1353 	IOStream *stream = ctx->m_stream;
1354 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1355 	bool useChecksum = checksumCalculator->getVersion() > 0;
1356 
1357 	 unsigned char *ptr;
1358 	 unsigned char *buf;
1359 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
1360 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1361 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1362 	buf = stream->alloc(totalSize);
1363 	ptr = buf;
1364 	int tmp = OP_glClearColorx;memcpy(ptr, &tmp, 4); ptr += 4;
1365 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1366 
1367 		memcpy(ptr, &red, 4); ptr += 4;
1368 		memcpy(ptr, &green, 4); ptr += 4;
1369 		memcpy(ptr, &blue, 4); ptr += 4;
1370 		memcpy(ptr, &alpha, 4); ptr += 4;
1371 
1372 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1373 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1374 
1375 }
1376 
glClearDepthx_enc(void * self,GLclampx depth)1377 void glClearDepthx_enc(void *self , GLclampx depth)
1378 {
1379 
1380 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1381 	IOStream *stream = ctx->m_stream;
1382 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1383 	bool useChecksum = checksumCalculator->getVersion() > 0;
1384 
1385 	 unsigned char *ptr;
1386 	 unsigned char *buf;
1387 	 const size_t sizeWithoutChecksum = 8 + 4;
1388 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1389 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1390 	buf = stream->alloc(totalSize);
1391 	ptr = buf;
1392 	int tmp = OP_glClearDepthx;memcpy(ptr, &tmp, 4); ptr += 4;
1393 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1394 
1395 		memcpy(ptr, &depth, 4); ptr += 4;
1396 
1397 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1398 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1399 
1400 }
1401 
glClearStencil_enc(void * self,GLint s)1402 void glClearStencil_enc(void *self , GLint s)
1403 {
1404 
1405 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1406 	IOStream *stream = ctx->m_stream;
1407 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1408 	bool useChecksum = checksumCalculator->getVersion() > 0;
1409 
1410 	 unsigned char *ptr;
1411 	 unsigned char *buf;
1412 	 const size_t sizeWithoutChecksum = 8 + 4;
1413 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1414 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1415 	buf = stream->alloc(totalSize);
1416 	ptr = buf;
1417 	int tmp = OP_glClearStencil;memcpy(ptr, &tmp, 4); ptr += 4;
1418 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1419 
1420 		memcpy(ptr, &s, 4); ptr += 4;
1421 
1422 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1423 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1424 
1425 }
1426 
glClientActiveTexture_enc(void * self,GLenum texture)1427 void glClientActiveTexture_enc(void *self , GLenum texture)
1428 {
1429 
1430 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1431 	IOStream *stream = ctx->m_stream;
1432 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1433 	bool useChecksum = checksumCalculator->getVersion() > 0;
1434 
1435 	 unsigned char *ptr;
1436 	 unsigned char *buf;
1437 	 const size_t sizeWithoutChecksum = 8 + 4;
1438 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1439 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1440 	buf = stream->alloc(totalSize);
1441 	ptr = buf;
1442 	int tmp = OP_glClientActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
1443 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1444 
1445 		memcpy(ptr, &texture, 4); ptr += 4;
1446 
1447 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1448 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1449 
1450 }
1451 
glColor4ub_enc(void * self,GLubyte red,GLubyte green,GLubyte blue,GLubyte alpha)1452 void glColor4ub_enc(void *self , GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
1453 {
1454 
1455 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1456 	IOStream *stream = ctx->m_stream;
1457 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1458 	bool useChecksum = checksumCalculator->getVersion() > 0;
1459 
1460 	 unsigned char *ptr;
1461 	 unsigned char *buf;
1462 	 const size_t sizeWithoutChecksum = 8 + 1 + 1 + 1 + 1;
1463 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1464 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1465 	buf = stream->alloc(totalSize);
1466 	ptr = buf;
1467 	int tmp = OP_glColor4ub;memcpy(ptr, &tmp, 4); ptr += 4;
1468 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1469 
1470 		memcpy(ptr, &red, 1); ptr += 1;
1471 		memcpy(ptr, &green, 1); ptr += 1;
1472 		memcpy(ptr, &blue, 1); ptr += 1;
1473 		memcpy(ptr, &alpha, 1); ptr += 1;
1474 
1475 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1476 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1477 
1478 }
1479 
glColor4x_enc(void * self,GLfixed red,GLfixed green,GLfixed blue,GLfixed alpha)1480 void glColor4x_enc(void *self , GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
1481 {
1482 
1483 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1484 	IOStream *stream = ctx->m_stream;
1485 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1486 	bool useChecksum = checksumCalculator->getVersion() > 0;
1487 
1488 	 unsigned char *ptr;
1489 	 unsigned char *buf;
1490 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
1491 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1492 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1493 	buf = stream->alloc(totalSize);
1494 	ptr = buf;
1495 	int tmp = OP_glColor4x;memcpy(ptr, &tmp, 4); ptr += 4;
1496 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1497 
1498 		memcpy(ptr, &red, 4); ptr += 4;
1499 		memcpy(ptr, &green, 4); ptr += 4;
1500 		memcpy(ptr, &blue, 4); ptr += 4;
1501 		memcpy(ptr, &alpha, 4); ptr += 4;
1502 
1503 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1504 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1505 
1506 }
1507 
glColorMask_enc(void * self,GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)1508 void glColorMask_enc(void *self , GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
1509 {
1510 
1511 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1512 	IOStream *stream = ctx->m_stream;
1513 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1514 	bool useChecksum = checksumCalculator->getVersion() > 0;
1515 
1516 	 unsigned char *ptr;
1517 	 unsigned char *buf;
1518 	 const size_t sizeWithoutChecksum = 8 + 1 + 1 + 1 + 1;
1519 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1520 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1521 	buf = stream->alloc(totalSize);
1522 	ptr = buf;
1523 	int tmp = OP_glColorMask;memcpy(ptr, &tmp, 4); ptr += 4;
1524 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1525 
1526 		memcpy(ptr, &red, 1); ptr += 1;
1527 		memcpy(ptr, &green, 1); ptr += 1;
1528 		memcpy(ptr, &blue, 1); ptr += 1;
1529 		memcpy(ptr, &alpha, 1); ptr += 1;
1530 
1531 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1532 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1533 
1534 }
1535 
glCompressedTexImage2D_enc(void * self,GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const GLvoid * data)1536 void glCompressedTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
1537 {
1538 
1539 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1540 	IOStream *stream = ctx->m_stream;
1541 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1542 	bool useChecksum = checksumCalculator->getVersion() > 0;
1543 
1544 	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
1545 	 unsigned char *ptr;
1546 	 unsigned char *buf;
1547 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
1548 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1549 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1550 	buf = stream->alloc(totalSize);
1551 	ptr = buf;
1552 	int tmp = OP_glCompressedTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
1553 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1554 
1555 		memcpy(ptr, &target, 4); ptr += 4;
1556 		memcpy(ptr, &level, 4); ptr += 4;
1557 		memcpy(ptr, &internalformat, 4); ptr += 4;
1558 		memcpy(ptr, &width, 4); ptr += 4;
1559 		memcpy(ptr, &height, 4); ptr += 4;
1560 		memcpy(ptr, &border, 4); ptr += 4;
1561 		memcpy(ptr, &imageSize, 4); ptr += 4;
1562 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
1563 	if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
1564 
1565 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1566 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1567 
1568 }
1569 
glCompressedTexSubImage2D_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const GLvoid * data)1570 void glCompressedTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
1571 {
1572 
1573 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1574 	IOStream *stream = ctx->m_stream;
1575 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1576 	bool useChecksum = checksumCalculator->getVersion() > 0;
1577 
1578 	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
1579 	 unsigned char *ptr;
1580 	 unsigned char *buf;
1581 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
1582 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1583 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1584 	buf = stream->alloc(totalSize);
1585 	ptr = buf;
1586 	int tmp = OP_glCompressedTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
1587 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1588 
1589 		memcpy(ptr, &target, 4); ptr += 4;
1590 		memcpy(ptr, &level, 4); ptr += 4;
1591 		memcpy(ptr, &xoffset, 4); ptr += 4;
1592 		memcpy(ptr, &yoffset, 4); ptr += 4;
1593 		memcpy(ptr, &width, 4); ptr += 4;
1594 		memcpy(ptr, &height, 4); ptr += 4;
1595 		memcpy(ptr, &format, 4); ptr += 4;
1596 		memcpy(ptr, &imageSize, 4); ptr += 4;
1597 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
1598 	if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
1599 
1600 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1601 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1602 
1603 }
1604 
glCopyTexImage2D_enc(void * self,GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)1605 void glCopyTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
1606 {
1607 
1608 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1609 	IOStream *stream = ctx->m_stream;
1610 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1611 	bool useChecksum = checksumCalculator->getVersion() > 0;
1612 
1613 	 unsigned char *ptr;
1614 	 unsigned char *buf;
1615 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
1616 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1617 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1618 	buf = stream->alloc(totalSize);
1619 	ptr = buf;
1620 	int tmp = OP_glCopyTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
1621 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1622 
1623 		memcpy(ptr, &target, 4); ptr += 4;
1624 		memcpy(ptr, &level, 4); ptr += 4;
1625 		memcpy(ptr, &internalformat, 4); ptr += 4;
1626 		memcpy(ptr, &x, 4); ptr += 4;
1627 		memcpy(ptr, &y, 4); ptr += 4;
1628 		memcpy(ptr, &width, 4); ptr += 4;
1629 		memcpy(ptr, &height, 4); ptr += 4;
1630 		memcpy(ptr, &border, 4); ptr += 4;
1631 
1632 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1633 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1634 
1635 }
1636 
glCopyTexSubImage2D_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLsizei height)1637 void glCopyTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
1638 {
1639 
1640 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1641 	IOStream *stream = ctx->m_stream;
1642 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1643 	bool useChecksum = checksumCalculator->getVersion() > 0;
1644 
1645 	 unsigned char *ptr;
1646 	 unsigned char *buf;
1647 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
1648 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1649 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1650 	buf = stream->alloc(totalSize);
1651 	ptr = buf;
1652 	int tmp = OP_glCopyTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
1653 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1654 
1655 		memcpy(ptr, &target, 4); ptr += 4;
1656 		memcpy(ptr, &level, 4); ptr += 4;
1657 		memcpy(ptr, &xoffset, 4); ptr += 4;
1658 		memcpy(ptr, &yoffset, 4); ptr += 4;
1659 		memcpy(ptr, &x, 4); ptr += 4;
1660 		memcpy(ptr, &y, 4); ptr += 4;
1661 		memcpy(ptr, &width, 4); ptr += 4;
1662 		memcpy(ptr, &height, 4); ptr += 4;
1663 
1664 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1665 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1666 
1667 }
1668 
glCullFace_enc(void * self,GLenum mode)1669 void glCullFace_enc(void *self , GLenum mode)
1670 {
1671 
1672 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1673 	IOStream *stream = ctx->m_stream;
1674 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1675 	bool useChecksum = checksumCalculator->getVersion() > 0;
1676 
1677 	 unsigned char *ptr;
1678 	 unsigned char *buf;
1679 	 const size_t sizeWithoutChecksum = 8 + 4;
1680 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1681 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1682 	buf = stream->alloc(totalSize);
1683 	ptr = buf;
1684 	int tmp = OP_glCullFace;memcpy(ptr, &tmp, 4); ptr += 4;
1685 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1686 
1687 		memcpy(ptr, &mode, 4); ptr += 4;
1688 
1689 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1690 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1691 
1692 }
1693 
glDeleteBuffers_enc(void * self,GLsizei n,const GLuint * buffers)1694 void glDeleteBuffers_enc(void *self , GLsizei n, const GLuint* buffers)
1695 {
1696 
1697 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1698 	IOStream *stream = ctx->m_stream;
1699 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1700 	bool useChecksum = checksumCalculator->getVersion() > 0;
1701 
1702 	const unsigned int __size_buffers =  (n * sizeof(GLuint));
1703 	 unsigned char *ptr;
1704 	 unsigned char *buf;
1705 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_buffers + 1*4;
1706 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1707 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1708 	buf = stream->alloc(totalSize);
1709 	ptr = buf;
1710 	int tmp = OP_glDeleteBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
1711 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1712 
1713 		memcpy(ptr, &n, 4); ptr += 4;
1714 	*(unsigned int *)(ptr) = __size_buffers; ptr += 4;
1715 	memcpy(ptr, buffers, __size_buffers);ptr += __size_buffers;
1716 
1717 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1718 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1719 
1720 }
1721 
glDeleteTextures_enc(void * self,GLsizei n,const GLuint * textures)1722 void glDeleteTextures_enc(void *self , GLsizei n, const GLuint* textures)
1723 {
1724 
1725 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1726 	IOStream *stream = ctx->m_stream;
1727 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1728 	bool useChecksum = checksumCalculator->getVersion() > 0;
1729 
1730 	const unsigned int __size_textures =  (n * sizeof(GLuint));
1731 	 unsigned char *ptr;
1732 	 unsigned char *buf;
1733 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_textures + 1*4;
1734 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1735 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1736 	buf = stream->alloc(totalSize);
1737 	ptr = buf;
1738 	int tmp = OP_glDeleteTextures;memcpy(ptr, &tmp, 4); ptr += 4;
1739 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1740 
1741 		memcpy(ptr, &n, 4); ptr += 4;
1742 	*(unsigned int *)(ptr) = __size_textures; ptr += 4;
1743 	memcpy(ptr, textures, __size_textures);ptr += __size_textures;
1744 
1745 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1746 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1747 
1748 }
1749 
glDepthFunc_enc(void * self,GLenum func)1750 void glDepthFunc_enc(void *self , GLenum func)
1751 {
1752 
1753 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1754 	IOStream *stream = ctx->m_stream;
1755 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1756 	bool useChecksum = checksumCalculator->getVersion() > 0;
1757 
1758 	 unsigned char *ptr;
1759 	 unsigned char *buf;
1760 	 const size_t sizeWithoutChecksum = 8 + 4;
1761 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1762 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1763 	buf = stream->alloc(totalSize);
1764 	ptr = buf;
1765 	int tmp = OP_glDepthFunc;memcpy(ptr, &tmp, 4); ptr += 4;
1766 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1767 
1768 		memcpy(ptr, &func, 4); ptr += 4;
1769 
1770 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1771 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1772 
1773 }
1774 
glDepthMask_enc(void * self,GLboolean flag)1775 void glDepthMask_enc(void *self , GLboolean flag)
1776 {
1777 
1778 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1779 	IOStream *stream = ctx->m_stream;
1780 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1781 	bool useChecksum = checksumCalculator->getVersion() > 0;
1782 
1783 	 unsigned char *ptr;
1784 	 unsigned char *buf;
1785 	 const size_t sizeWithoutChecksum = 8 + 1;
1786 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1787 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1788 	buf = stream->alloc(totalSize);
1789 	ptr = buf;
1790 	int tmp = OP_glDepthMask;memcpy(ptr, &tmp, 4); ptr += 4;
1791 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1792 
1793 		memcpy(ptr, &flag, 1); ptr += 1;
1794 
1795 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1796 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1797 
1798 }
1799 
glDepthRangex_enc(void * self,GLclampx zNear,GLclampx zFar)1800 void glDepthRangex_enc(void *self , GLclampx zNear, GLclampx zFar)
1801 {
1802 
1803 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1804 	IOStream *stream = ctx->m_stream;
1805 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1806 	bool useChecksum = checksumCalculator->getVersion() > 0;
1807 
1808 	 unsigned char *ptr;
1809 	 unsigned char *buf;
1810 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
1811 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1812 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1813 	buf = stream->alloc(totalSize);
1814 	ptr = buf;
1815 	int tmp = OP_glDepthRangex;memcpy(ptr, &tmp, 4); ptr += 4;
1816 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1817 
1818 		memcpy(ptr, &zNear, 4); ptr += 4;
1819 		memcpy(ptr, &zFar, 4); ptr += 4;
1820 
1821 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1822 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1823 
1824 }
1825 
glDisable_enc(void * self,GLenum cap)1826 void glDisable_enc(void *self , GLenum cap)
1827 {
1828 
1829 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1830 	IOStream *stream = ctx->m_stream;
1831 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1832 	bool useChecksum = checksumCalculator->getVersion() > 0;
1833 
1834 	 unsigned char *ptr;
1835 	 unsigned char *buf;
1836 	 const size_t sizeWithoutChecksum = 8 + 4;
1837 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1838 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1839 	buf = stream->alloc(totalSize);
1840 	ptr = buf;
1841 	int tmp = OP_glDisable;memcpy(ptr, &tmp, 4); ptr += 4;
1842 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1843 
1844 		memcpy(ptr, &cap, 4); ptr += 4;
1845 
1846 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1847 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1848 
1849 }
1850 
glDisableClientState_enc(void * self,GLenum array)1851 void glDisableClientState_enc(void *self , GLenum array)
1852 {
1853 
1854 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1855 	IOStream *stream = ctx->m_stream;
1856 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1857 	bool useChecksum = checksumCalculator->getVersion() > 0;
1858 
1859 	 unsigned char *ptr;
1860 	 unsigned char *buf;
1861 	 const size_t sizeWithoutChecksum = 8 + 4;
1862 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1863 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1864 	buf = stream->alloc(totalSize);
1865 	ptr = buf;
1866 	int tmp = OP_glDisableClientState;memcpy(ptr, &tmp, 4); ptr += 4;
1867 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1868 
1869 		memcpy(ptr, &array, 4); ptr += 4;
1870 
1871 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1872 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1873 
1874 }
1875 
glDrawArrays_enc(void * self,GLenum mode,GLint first,GLsizei count)1876 void glDrawArrays_enc(void *self , GLenum mode, GLint first, GLsizei count)
1877 {
1878 
1879 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1880 	IOStream *stream = ctx->m_stream;
1881 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1882 	bool useChecksum = checksumCalculator->getVersion() > 0;
1883 
1884 	 unsigned char *ptr;
1885 	 unsigned char *buf;
1886 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
1887 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1888 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1889 	buf = stream->alloc(totalSize);
1890 	ptr = buf;
1891 	int tmp = OP_glDrawArrays;memcpy(ptr, &tmp, 4); ptr += 4;
1892 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1893 
1894 		memcpy(ptr, &mode, 4); ptr += 4;
1895 		memcpy(ptr, &first, 4); ptr += 4;
1896 		memcpy(ptr, &count, 4); ptr += 4;
1897 
1898 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1899 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1900 
1901 }
1902 
glEnable_enc(void * self,GLenum cap)1903 void glEnable_enc(void *self , GLenum cap)
1904 {
1905 
1906 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1907 	IOStream *stream = ctx->m_stream;
1908 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1909 	bool useChecksum = checksumCalculator->getVersion() > 0;
1910 
1911 	 unsigned char *ptr;
1912 	 unsigned char *buf;
1913 	 const size_t sizeWithoutChecksum = 8 + 4;
1914 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1915 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1916 	buf = stream->alloc(totalSize);
1917 	ptr = buf;
1918 	int tmp = OP_glEnable;memcpy(ptr, &tmp, 4); ptr += 4;
1919 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1920 
1921 		memcpy(ptr, &cap, 4); ptr += 4;
1922 
1923 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1924 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1925 
1926 }
1927 
glEnableClientState_enc(void * self,GLenum array)1928 void glEnableClientState_enc(void *self , GLenum array)
1929 {
1930 
1931 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1932 	IOStream *stream = ctx->m_stream;
1933 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1934 	bool useChecksum = checksumCalculator->getVersion() > 0;
1935 
1936 	 unsigned char *ptr;
1937 	 unsigned char *buf;
1938 	 const size_t sizeWithoutChecksum = 8 + 4;
1939 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1940 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1941 	buf = stream->alloc(totalSize);
1942 	ptr = buf;
1943 	int tmp = OP_glEnableClientState;memcpy(ptr, &tmp, 4); ptr += 4;
1944 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1945 
1946 		memcpy(ptr, &array, 4); ptr += 4;
1947 
1948 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1949 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1950 
1951 }
1952 
glFinish_enc(void * self)1953 void glFinish_enc(void *self )
1954 {
1955 
1956 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1957 	IOStream *stream = ctx->m_stream;
1958 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1959 	bool useChecksum = checksumCalculator->getVersion() > 0;
1960 
1961 	 unsigned char *ptr;
1962 	 unsigned char *buf;
1963 	 const size_t sizeWithoutChecksum = 8;
1964 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1965 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1966 	buf = stream->alloc(totalSize);
1967 	ptr = buf;
1968 	int tmp = OP_glFinish;memcpy(ptr, &tmp, 4); ptr += 4;
1969 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1970 
1971 
1972 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1973 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1974 
1975 }
1976 
glFlush_enc(void * self)1977 void glFlush_enc(void *self )
1978 {
1979 
1980 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1981 	IOStream *stream = ctx->m_stream;
1982 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
1983 	bool useChecksum = checksumCalculator->getVersion() > 0;
1984 
1985 	 unsigned char *ptr;
1986 	 unsigned char *buf;
1987 	 const size_t sizeWithoutChecksum = 8;
1988 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
1989 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
1990 	buf = stream->alloc(totalSize);
1991 	ptr = buf;
1992 	int tmp = OP_glFlush;memcpy(ptr, &tmp, 4); ptr += 4;
1993 	memcpy(ptr, &totalSize, 4);  ptr += 4;
1994 
1995 
1996 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
1997 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
1998 
1999 }
2000 
glFogx_enc(void * self,GLenum pname,GLfixed param)2001 void glFogx_enc(void *self , GLenum pname, GLfixed param)
2002 {
2003 
2004 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2005 	IOStream *stream = ctx->m_stream;
2006 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2007 	bool useChecksum = checksumCalculator->getVersion() > 0;
2008 
2009 	 unsigned char *ptr;
2010 	 unsigned char *buf;
2011 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
2012 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2013 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2014 	buf = stream->alloc(totalSize);
2015 	ptr = buf;
2016 	int tmp = OP_glFogx;memcpy(ptr, &tmp, 4); ptr += 4;
2017 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2018 
2019 		memcpy(ptr, &pname, 4); ptr += 4;
2020 		memcpy(ptr, &param, 4); ptr += 4;
2021 
2022 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2023 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2024 
2025 }
2026 
glFogxv_enc(void * self,GLenum pname,const GLfixed * params)2027 void glFogxv_enc(void *self , GLenum pname, const GLfixed* params)
2028 {
2029 
2030 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2031 	IOStream *stream = ctx->m_stream;
2032 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2033 	bool useChecksum = checksumCalculator->getVersion() > 0;
2034 
2035 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
2036 	 unsigned char *ptr;
2037 	 unsigned char *buf;
2038 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
2039 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2040 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2041 	buf = stream->alloc(totalSize);
2042 	ptr = buf;
2043 	int tmp = OP_glFogxv;memcpy(ptr, &tmp, 4); ptr += 4;
2044 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2045 
2046 		memcpy(ptr, &pname, 4); ptr += 4;
2047 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2048 	memcpy(ptr, params, __size_params);ptr += __size_params;
2049 
2050 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2051 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2052 
2053 }
2054 
glFrontFace_enc(void * self,GLenum mode)2055 void glFrontFace_enc(void *self , GLenum mode)
2056 {
2057 
2058 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2059 	IOStream *stream = ctx->m_stream;
2060 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2061 	bool useChecksum = checksumCalculator->getVersion() > 0;
2062 
2063 	 unsigned char *ptr;
2064 	 unsigned char *buf;
2065 	 const size_t sizeWithoutChecksum = 8 + 4;
2066 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2067 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2068 	buf = stream->alloc(totalSize);
2069 	ptr = buf;
2070 	int tmp = OP_glFrontFace;memcpy(ptr, &tmp, 4); ptr += 4;
2071 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2072 
2073 		memcpy(ptr, &mode, 4); ptr += 4;
2074 
2075 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2076 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2077 
2078 }
2079 
glFrustumx_enc(void * self,GLfixed left,GLfixed right,GLfixed bottom,GLfixed top,GLfixed zNear,GLfixed zFar)2080 void glFrustumx_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
2081 {
2082 
2083 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2084 	IOStream *stream = ctx->m_stream;
2085 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2086 	bool useChecksum = checksumCalculator->getVersion() > 0;
2087 
2088 	 unsigned char *ptr;
2089 	 unsigned char *buf;
2090 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
2091 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2092 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2093 	buf = stream->alloc(totalSize);
2094 	ptr = buf;
2095 	int tmp = OP_glFrustumx;memcpy(ptr, &tmp, 4); ptr += 4;
2096 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2097 
2098 		memcpy(ptr, &left, 4); ptr += 4;
2099 		memcpy(ptr, &right, 4); ptr += 4;
2100 		memcpy(ptr, &bottom, 4); ptr += 4;
2101 		memcpy(ptr, &top, 4); ptr += 4;
2102 		memcpy(ptr, &zNear, 4); ptr += 4;
2103 		memcpy(ptr, &zFar, 4); ptr += 4;
2104 
2105 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2106 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2107 
2108 }
2109 
glGetBooleanv_enc(void * self,GLenum pname,GLboolean * params)2110 void glGetBooleanv_enc(void *self , GLenum pname, GLboolean* params)
2111 {
2112 
2113 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2114 	IOStream *stream = ctx->m_stream;
2115 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2116 	bool useChecksum = checksumCalculator->getVersion() > 0;
2117 
2118 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLboolean));
2119 	 unsigned char *ptr;
2120 	 unsigned char *buf;
2121 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
2122 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2123 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2124 	buf = stream->alloc(totalSize);
2125 	ptr = buf;
2126 	int tmp = OP_glGetBooleanv;memcpy(ptr, &tmp, 4); ptr += 4;
2127 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2128 
2129 		memcpy(ptr, &pname, 4); ptr += 4;
2130 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2131 
2132 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2133 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2134 
2135 	stream->readback(params, __size_params);
2136 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
2137 	if (useChecksum) {
2138 		unsigned char *checksumBufPtr = NULL;
2139 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2140 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2141 		stream->readback(checksumBufPtr, checksumSize);
2142 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2143 			ALOGE("glGetBooleanv: GL communication error, please report this issue to b.android.com.\n");
2144 			abort();
2145 		}
2146 	}
2147 }
2148 
glGetBufferParameteriv_enc(void * self,GLenum target,GLenum pname,GLint * params)2149 void glGetBufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
2150 {
2151 
2152 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2153 	IOStream *stream = ctx->m_stream;
2154 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2155 	bool useChecksum = checksumCalculator->getVersion() > 0;
2156 
2157 	const unsigned int __size_params =  (sizeof(GLint));
2158 	 unsigned char *ptr;
2159 	 unsigned char *buf;
2160 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
2161 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2162 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2163 	buf = stream->alloc(totalSize);
2164 	ptr = buf;
2165 	int tmp = OP_glGetBufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
2166 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2167 
2168 		memcpy(ptr, &target, 4); ptr += 4;
2169 		memcpy(ptr, &pname, 4); ptr += 4;
2170 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2171 
2172 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2173 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2174 
2175 	stream->readback(params, __size_params);
2176 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
2177 	if (useChecksum) {
2178 		unsigned char *checksumBufPtr = NULL;
2179 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2180 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2181 		stream->readback(checksumBufPtr, checksumSize);
2182 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2183 			ALOGE("glGetBufferParameteriv: GL communication error, please report this issue to b.android.com.\n");
2184 			abort();
2185 		}
2186 	}
2187 }
2188 
glClipPlanex_enc(void * self,GLenum pname,const GLfixed * eqn)2189 void glClipPlanex_enc(void *self , GLenum pname, const GLfixed* eqn)
2190 {
2191 
2192 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2193 	IOStream *stream = ctx->m_stream;
2194 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2195 	bool useChecksum = checksumCalculator->getVersion() > 0;
2196 
2197 	const unsigned int __size_eqn =  (4 * sizeof(GLfixed));
2198 	 unsigned char *ptr;
2199 	 unsigned char *buf;
2200 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_eqn + 1*4;
2201 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2202 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2203 	buf = stream->alloc(totalSize);
2204 	ptr = buf;
2205 	int tmp = OP_glClipPlanex;memcpy(ptr, &tmp, 4); ptr += 4;
2206 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2207 
2208 		memcpy(ptr, &pname, 4); ptr += 4;
2209 	*(unsigned int *)(ptr) = __size_eqn; ptr += 4;
2210 	memcpy(ptr, eqn, __size_eqn);ptr += __size_eqn;
2211 
2212 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2213 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2214 
2215 }
2216 
glGenBuffers_enc(void * self,GLsizei n,GLuint * buffers)2217 void glGenBuffers_enc(void *self , GLsizei n, GLuint* buffers)
2218 {
2219 
2220 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2221 	IOStream *stream = ctx->m_stream;
2222 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2223 	bool useChecksum = checksumCalculator->getVersion() > 0;
2224 
2225 	const unsigned int __size_buffers =  (n * sizeof(GLuint));
2226 	 unsigned char *ptr;
2227 	 unsigned char *buf;
2228 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
2229 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2230 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2231 	buf = stream->alloc(totalSize);
2232 	ptr = buf;
2233 	int tmp = OP_glGenBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
2234 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2235 
2236 		memcpy(ptr, &n, 4); ptr += 4;
2237 	*(unsigned int *)(ptr) = __size_buffers; ptr += 4;
2238 
2239 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2240 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2241 
2242 	stream->readback(buffers, __size_buffers);
2243 	if (useChecksum) checksumCalculator->addBuffer(buffers, __size_buffers);
2244 	if (useChecksum) {
2245 		unsigned char *checksumBufPtr = NULL;
2246 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2247 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2248 		stream->readback(checksumBufPtr, checksumSize);
2249 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2250 			ALOGE("glGenBuffers: GL communication error, please report this issue to b.android.com.\n");
2251 			abort();
2252 		}
2253 	}
2254 }
2255 
glGenTextures_enc(void * self,GLsizei n,GLuint * textures)2256 void glGenTextures_enc(void *self , GLsizei n, GLuint* textures)
2257 {
2258 
2259 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2260 	IOStream *stream = ctx->m_stream;
2261 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2262 	bool useChecksum = checksumCalculator->getVersion() > 0;
2263 
2264 	const unsigned int __size_textures =  (n * sizeof(GLuint));
2265 	 unsigned char *ptr;
2266 	 unsigned char *buf;
2267 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
2268 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2269 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2270 	buf = stream->alloc(totalSize);
2271 	ptr = buf;
2272 	int tmp = OP_glGenTextures;memcpy(ptr, &tmp, 4); ptr += 4;
2273 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2274 
2275 		memcpy(ptr, &n, 4); ptr += 4;
2276 	*(unsigned int *)(ptr) = __size_textures; ptr += 4;
2277 
2278 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2279 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2280 
2281 	stream->readback(textures, __size_textures);
2282 	if (useChecksum) checksumCalculator->addBuffer(textures, __size_textures);
2283 	if (useChecksum) {
2284 		unsigned char *checksumBufPtr = NULL;
2285 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2286 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2287 		stream->readback(checksumBufPtr, checksumSize);
2288 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2289 			ALOGE("glGenTextures: GL communication error, please report this issue to b.android.com.\n");
2290 			abort();
2291 		}
2292 	}
2293 }
2294 
glGetError_enc(void * self)2295 GLenum glGetError_enc(void *self )
2296 {
2297 
2298 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2299 	IOStream *stream = ctx->m_stream;
2300 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2301 	bool useChecksum = checksumCalculator->getVersion() > 0;
2302 
2303 	 unsigned char *ptr;
2304 	 unsigned char *buf;
2305 	 const size_t sizeWithoutChecksum = 8;
2306 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2307 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2308 	buf = stream->alloc(totalSize);
2309 	ptr = buf;
2310 	int tmp = OP_glGetError;memcpy(ptr, &tmp, 4); ptr += 4;
2311 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2312 
2313 
2314 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2315 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2316 
2317 
2318 	GLenum retval;
2319 	stream->readback(&retval, 4);
2320 	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
2321 	if (useChecksum) {
2322 		unsigned char *checksumBufPtr = NULL;
2323 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2324 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2325 		stream->readback(checksumBufPtr, checksumSize);
2326 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2327 			ALOGE("glGetError: GL communication error, please report this issue to b.android.com.\n");
2328 			abort();
2329 		}
2330 	}
2331 	return retval;
2332 }
2333 
glGetFixedv_enc(void * self,GLenum pname,GLfixed * params)2334 void glGetFixedv_enc(void *self , GLenum pname, GLfixed* params)
2335 {
2336 
2337 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2338 	IOStream *stream = ctx->m_stream;
2339 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2340 	bool useChecksum = checksumCalculator->getVersion() > 0;
2341 
2342 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
2343 	 unsigned char *ptr;
2344 	 unsigned char *buf;
2345 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
2346 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2347 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2348 	buf = stream->alloc(totalSize);
2349 	ptr = buf;
2350 	int tmp = OP_glGetFixedv;memcpy(ptr, &tmp, 4); ptr += 4;
2351 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2352 
2353 		memcpy(ptr, &pname, 4); ptr += 4;
2354 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2355 
2356 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2357 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2358 
2359 	stream->readback(params, __size_params);
2360 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
2361 	if (useChecksum) {
2362 		unsigned char *checksumBufPtr = NULL;
2363 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2364 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2365 		stream->readback(checksumBufPtr, checksumSize);
2366 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2367 			ALOGE("glGetFixedv: GL communication error, please report this issue to b.android.com.\n");
2368 			abort();
2369 		}
2370 	}
2371 }
2372 
glGetIntegerv_enc(void * self,GLenum pname,GLint * params)2373 void glGetIntegerv_enc(void *self , GLenum pname, GLint* params)
2374 {
2375 
2376 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2377 	IOStream *stream = ctx->m_stream;
2378 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2379 	bool useChecksum = checksumCalculator->getVersion() > 0;
2380 
2381 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
2382 	 unsigned char *ptr;
2383 	 unsigned char *buf;
2384 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
2385 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2386 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2387 	buf = stream->alloc(totalSize);
2388 	ptr = buf;
2389 	int tmp = OP_glGetIntegerv;memcpy(ptr, &tmp, 4); ptr += 4;
2390 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2391 
2392 		memcpy(ptr, &pname, 4); ptr += 4;
2393 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2394 
2395 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2396 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2397 
2398 	stream->readback(params, __size_params);
2399 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
2400 	if (useChecksum) {
2401 		unsigned char *checksumBufPtr = NULL;
2402 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2403 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2404 		stream->readback(checksumBufPtr, checksumSize);
2405 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2406 			ALOGE("glGetIntegerv: GL communication error, please report this issue to b.android.com.\n");
2407 			abort();
2408 		}
2409 	}
2410 }
2411 
glGetLightxv_enc(void * self,GLenum light,GLenum pname,GLfixed * params)2412 void glGetLightxv_enc(void *self , GLenum light, GLenum pname, GLfixed* params)
2413 {
2414 
2415 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2416 	IOStream *stream = ctx->m_stream;
2417 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2418 	bool useChecksum = checksumCalculator->getVersion() > 0;
2419 
2420 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
2421 	 unsigned char *ptr;
2422 	 unsigned char *buf;
2423 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
2424 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2425 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2426 	buf = stream->alloc(totalSize);
2427 	ptr = buf;
2428 	int tmp = OP_glGetLightxv;memcpy(ptr, &tmp, 4); ptr += 4;
2429 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2430 
2431 		memcpy(ptr, &light, 4); ptr += 4;
2432 		memcpy(ptr, &pname, 4); ptr += 4;
2433 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2434 
2435 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2436 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2437 
2438 	stream->readback(params, __size_params);
2439 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
2440 	if (useChecksum) {
2441 		unsigned char *checksumBufPtr = NULL;
2442 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2443 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2444 		stream->readback(checksumBufPtr, checksumSize);
2445 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2446 			ALOGE("glGetLightxv: GL communication error, please report this issue to b.android.com.\n");
2447 			abort();
2448 		}
2449 	}
2450 }
2451 
glGetMaterialxv_enc(void * self,GLenum face,GLenum pname,GLfixed * params)2452 void glGetMaterialxv_enc(void *self , GLenum face, GLenum pname, GLfixed* params)
2453 {
2454 
2455 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2456 	IOStream *stream = ctx->m_stream;
2457 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2458 	bool useChecksum = checksumCalculator->getVersion() > 0;
2459 
2460 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
2461 	 unsigned char *ptr;
2462 	 unsigned char *buf;
2463 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
2464 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2465 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2466 	buf = stream->alloc(totalSize);
2467 	ptr = buf;
2468 	int tmp = OP_glGetMaterialxv;memcpy(ptr, &tmp, 4); ptr += 4;
2469 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2470 
2471 		memcpy(ptr, &face, 4); ptr += 4;
2472 		memcpy(ptr, &pname, 4); ptr += 4;
2473 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2474 
2475 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2476 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2477 
2478 	stream->readback(params, __size_params);
2479 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
2480 	if (useChecksum) {
2481 		unsigned char *checksumBufPtr = NULL;
2482 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2483 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2484 		stream->readback(checksumBufPtr, checksumSize);
2485 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2486 			ALOGE("glGetMaterialxv: GL communication error, please report this issue to b.android.com.\n");
2487 			abort();
2488 		}
2489 	}
2490 }
2491 
glGetTexEnviv_enc(void * self,GLenum env,GLenum pname,GLint * params)2492 void glGetTexEnviv_enc(void *self , GLenum env, GLenum pname, GLint* params)
2493 {
2494 
2495 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2496 	IOStream *stream = ctx->m_stream;
2497 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2498 	bool useChecksum = checksumCalculator->getVersion() > 0;
2499 
2500 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
2501 	 unsigned char *ptr;
2502 	 unsigned char *buf;
2503 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
2504 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2505 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2506 	buf = stream->alloc(totalSize);
2507 	ptr = buf;
2508 	int tmp = OP_glGetTexEnviv;memcpy(ptr, &tmp, 4); ptr += 4;
2509 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2510 
2511 		memcpy(ptr, &env, 4); ptr += 4;
2512 		memcpy(ptr, &pname, 4); ptr += 4;
2513 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2514 
2515 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2516 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2517 
2518 	stream->readback(params, __size_params);
2519 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
2520 	if (useChecksum) {
2521 		unsigned char *checksumBufPtr = NULL;
2522 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2523 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2524 		stream->readback(checksumBufPtr, checksumSize);
2525 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2526 			ALOGE("glGetTexEnviv: GL communication error, please report this issue to b.android.com.\n");
2527 			abort();
2528 		}
2529 	}
2530 }
2531 
glGetTexEnvxv_enc(void * self,GLenum env,GLenum pname,GLfixed * params)2532 void glGetTexEnvxv_enc(void *self , GLenum env, GLenum pname, GLfixed* params)
2533 {
2534 
2535 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2536 	IOStream *stream = ctx->m_stream;
2537 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2538 	bool useChecksum = checksumCalculator->getVersion() > 0;
2539 
2540 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
2541 	 unsigned char *ptr;
2542 	 unsigned char *buf;
2543 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
2544 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2545 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2546 	buf = stream->alloc(totalSize);
2547 	ptr = buf;
2548 	int tmp = OP_glGetTexEnvxv;memcpy(ptr, &tmp, 4); ptr += 4;
2549 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2550 
2551 		memcpy(ptr, &env, 4); ptr += 4;
2552 		memcpy(ptr, &pname, 4); ptr += 4;
2553 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2554 
2555 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2556 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2557 
2558 	stream->readback(params, __size_params);
2559 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
2560 	if (useChecksum) {
2561 		unsigned char *checksumBufPtr = NULL;
2562 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2563 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2564 		stream->readback(checksumBufPtr, checksumSize);
2565 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2566 			ALOGE("glGetTexEnvxv: GL communication error, please report this issue to b.android.com.\n");
2567 			abort();
2568 		}
2569 	}
2570 }
2571 
glGetTexParameteriv_enc(void * self,GLenum target,GLenum pname,GLint * params)2572 void glGetTexParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
2573 {
2574 
2575 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2576 	IOStream *stream = ctx->m_stream;
2577 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2578 	bool useChecksum = checksumCalculator->getVersion() > 0;
2579 
2580 	const unsigned int __size_params =  (sizeof(GLint));
2581 	 unsigned char *ptr;
2582 	 unsigned char *buf;
2583 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
2584 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2585 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2586 	buf = stream->alloc(totalSize);
2587 	ptr = buf;
2588 	int tmp = OP_glGetTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
2589 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2590 
2591 		memcpy(ptr, &target, 4); ptr += 4;
2592 		memcpy(ptr, &pname, 4); ptr += 4;
2593 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2594 
2595 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2596 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2597 
2598 	stream->readback(params, __size_params);
2599 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
2600 	if (useChecksum) {
2601 		unsigned char *checksumBufPtr = NULL;
2602 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2603 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2604 		stream->readback(checksumBufPtr, checksumSize);
2605 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2606 			ALOGE("glGetTexParameteriv: GL communication error, please report this issue to b.android.com.\n");
2607 			abort();
2608 		}
2609 	}
2610 }
2611 
glGetTexParameterxv_enc(void * self,GLenum target,GLenum pname,GLfixed * params)2612 void glGetTexParameterxv_enc(void *self , GLenum target, GLenum pname, GLfixed* params)
2613 {
2614 
2615 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2616 	IOStream *stream = ctx->m_stream;
2617 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2618 	bool useChecksum = checksumCalculator->getVersion() > 0;
2619 
2620 	const unsigned int __size_params =  (sizeof(GLfixed));
2621 	 unsigned char *ptr;
2622 	 unsigned char *buf;
2623 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
2624 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2625 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2626 	buf = stream->alloc(totalSize);
2627 	ptr = buf;
2628 	int tmp = OP_glGetTexParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
2629 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2630 
2631 		memcpy(ptr, &target, 4); ptr += 4;
2632 		memcpy(ptr, &pname, 4); ptr += 4;
2633 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2634 
2635 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2636 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2637 
2638 	stream->readback(params, __size_params);
2639 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
2640 	if (useChecksum) {
2641 		unsigned char *checksumBufPtr = NULL;
2642 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2643 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2644 		stream->readback(checksumBufPtr, checksumSize);
2645 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2646 			ALOGE("glGetTexParameterxv: GL communication error, please report this issue to b.android.com.\n");
2647 			abort();
2648 		}
2649 	}
2650 }
2651 
glHint_enc(void * self,GLenum target,GLenum mode)2652 void glHint_enc(void *self , GLenum target, GLenum mode)
2653 {
2654 
2655 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2656 	IOStream *stream = ctx->m_stream;
2657 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2658 	bool useChecksum = checksumCalculator->getVersion() > 0;
2659 
2660 	 unsigned char *ptr;
2661 	 unsigned char *buf;
2662 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
2663 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2664 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2665 	buf = stream->alloc(totalSize);
2666 	ptr = buf;
2667 	int tmp = OP_glHint;memcpy(ptr, &tmp, 4); ptr += 4;
2668 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2669 
2670 		memcpy(ptr, &target, 4); ptr += 4;
2671 		memcpy(ptr, &mode, 4); ptr += 4;
2672 
2673 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2674 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2675 
2676 }
2677 
glIsBuffer_enc(void * self,GLuint buffer)2678 GLboolean glIsBuffer_enc(void *self , GLuint buffer)
2679 {
2680 
2681 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2682 	IOStream *stream = ctx->m_stream;
2683 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2684 	bool useChecksum = checksumCalculator->getVersion() > 0;
2685 
2686 	 unsigned char *ptr;
2687 	 unsigned char *buf;
2688 	 const size_t sizeWithoutChecksum = 8 + 4;
2689 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2690 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2691 	buf = stream->alloc(totalSize);
2692 	ptr = buf;
2693 	int tmp = OP_glIsBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
2694 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2695 
2696 		memcpy(ptr, &buffer, 4); ptr += 4;
2697 
2698 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2699 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2700 
2701 
2702 	GLboolean retval;
2703 	stream->readback(&retval, 1);
2704 	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
2705 	if (useChecksum) {
2706 		unsigned char *checksumBufPtr = NULL;
2707 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2708 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2709 		stream->readback(checksumBufPtr, checksumSize);
2710 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2711 			ALOGE("glIsBuffer: GL communication error, please report this issue to b.android.com.\n");
2712 			abort();
2713 		}
2714 	}
2715 	return retval;
2716 }
2717 
glIsEnabled_enc(void * self,GLenum cap)2718 GLboolean glIsEnabled_enc(void *self , GLenum cap)
2719 {
2720 
2721 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2722 	IOStream *stream = ctx->m_stream;
2723 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2724 	bool useChecksum = checksumCalculator->getVersion() > 0;
2725 
2726 	 unsigned char *ptr;
2727 	 unsigned char *buf;
2728 	 const size_t sizeWithoutChecksum = 8 + 4;
2729 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2730 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2731 	buf = stream->alloc(totalSize);
2732 	ptr = buf;
2733 	int tmp = OP_glIsEnabled;memcpy(ptr, &tmp, 4); ptr += 4;
2734 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2735 
2736 		memcpy(ptr, &cap, 4); ptr += 4;
2737 
2738 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2739 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2740 
2741 
2742 	GLboolean retval;
2743 	stream->readback(&retval, 1);
2744 	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
2745 	if (useChecksum) {
2746 		unsigned char *checksumBufPtr = NULL;
2747 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2748 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2749 		stream->readback(checksumBufPtr, checksumSize);
2750 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2751 			ALOGE("glIsEnabled: GL communication error, please report this issue to b.android.com.\n");
2752 			abort();
2753 		}
2754 	}
2755 	return retval;
2756 }
2757 
glIsTexture_enc(void * self,GLuint texture)2758 GLboolean glIsTexture_enc(void *self , GLuint texture)
2759 {
2760 
2761 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2762 	IOStream *stream = ctx->m_stream;
2763 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2764 	bool useChecksum = checksumCalculator->getVersion() > 0;
2765 
2766 	 unsigned char *ptr;
2767 	 unsigned char *buf;
2768 	 const size_t sizeWithoutChecksum = 8 + 4;
2769 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2770 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2771 	buf = stream->alloc(totalSize);
2772 	ptr = buf;
2773 	int tmp = OP_glIsTexture;memcpy(ptr, &tmp, 4); ptr += 4;
2774 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2775 
2776 		memcpy(ptr, &texture, 4); ptr += 4;
2777 
2778 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2779 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2780 
2781 
2782 	GLboolean retval;
2783 	stream->readback(&retval, 1);
2784 	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
2785 	if (useChecksum) {
2786 		unsigned char *checksumBufPtr = NULL;
2787 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
2788 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
2789 		stream->readback(checksumBufPtr, checksumSize);
2790 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
2791 			ALOGE("glIsTexture: GL communication error, please report this issue to b.android.com.\n");
2792 			abort();
2793 		}
2794 	}
2795 	return retval;
2796 }
2797 
glLightModelx_enc(void * self,GLenum pname,GLfixed param)2798 void glLightModelx_enc(void *self , GLenum pname, GLfixed param)
2799 {
2800 
2801 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2802 	IOStream *stream = ctx->m_stream;
2803 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2804 	bool useChecksum = checksumCalculator->getVersion() > 0;
2805 
2806 	 unsigned char *ptr;
2807 	 unsigned char *buf;
2808 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
2809 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2810 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2811 	buf = stream->alloc(totalSize);
2812 	ptr = buf;
2813 	int tmp = OP_glLightModelx;memcpy(ptr, &tmp, 4); ptr += 4;
2814 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2815 
2816 		memcpy(ptr, &pname, 4); ptr += 4;
2817 		memcpy(ptr, &param, 4); ptr += 4;
2818 
2819 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2820 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2821 
2822 }
2823 
glLightModelxv_enc(void * self,GLenum pname,const GLfixed * params)2824 void glLightModelxv_enc(void *self , GLenum pname, const GLfixed* params)
2825 {
2826 
2827 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2828 	IOStream *stream = ctx->m_stream;
2829 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2830 	bool useChecksum = checksumCalculator->getVersion() > 0;
2831 
2832 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
2833 	 unsigned char *ptr;
2834 	 unsigned char *buf;
2835 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
2836 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2837 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2838 	buf = stream->alloc(totalSize);
2839 	ptr = buf;
2840 	int tmp = OP_glLightModelxv;memcpy(ptr, &tmp, 4); ptr += 4;
2841 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2842 
2843 		memcpy(ptr, &pname, 4); ptr += 4;
2844 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2845 	memcpy(ptr, params, __size_params);ptr += __size_params;
2846 
2847 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2848 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2849 
2850 }
2851 
glLightx_enc(void * self,GLenum light,GLenum pname,GLfixed param)2852 void glLightx_enc(void *self , GLenum light, GLenum pname, GLfixed param)
2853 {
2854 
2855 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2856 	IOStream *stream = ctx->m_stream;
2857 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2858 	bool useChecksum = checksumCalculator->getVersion() > 0;
2859 
2860 	 unsigned char *ptr;
2861 	 unsigned char *buf;
2862 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
2863 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2864 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2865 	buf = stream->alloc(totalSize);
2866 	ptr = buf;
2867 	int tmp = OP_glLightx;memcpy(ptr, &tmp, 4); ptr += 4;
2868 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2869 
2870 		memcpy(ptr, &light, 4); ptr += 4;
2871 		memcpy(ptr, &pname, 4); ptr += 4;
2872 		memcpy(ptr, &param, 4); ptr += 4;
2873 
2874 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2875 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2876 
2877 }
2878 
glLightxv_enc(void * self,GLenum light,GLenum pname,const GLfixed * params)2879 void glLightxv_enc(void *self , GLenum light, GLenum pname, const GLfixed* params)
2880 {
2881 
2882 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2883 	IOStream *stream = ctx->m_stream;
2884 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2885 	bool useChecksum = checksumCalculator->getVersion() > 0;
2886 
2887 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
2888 	 unsigned char *ptr;
2889 	 unsigned char *buf;
2890 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
2891 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2892 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2893 	buf = stream->alloc(totalSize);
2894 	ptr = buf;
2895 	int tmp = OP_glLightxv;memcpy(ptr, &tmp, 4); ptr += 4;
2896 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2897 
2898 		memcpy(ptr, &light, 4); ptr += 4;
2899 		memcpy(ptr, &pname, 4); ptr += 4;
2900 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2901 	memcpy(ptr, params, __size_params);ptr += __size_params;
2902 
2903 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2904 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2905 
2906 }
2907 
glLineWidthx_enc(void * self,GLfixed width)2908 void glLineWidthx_enc(void *self , GLfixed width)
2909 {
2910 
2911 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2912 	IOStream *stream = ctx->m_stream;
2913 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2914 	bool useChecksum = checksumCalculator->getVersion() > 0;
2915 
2916 	 unsigned char *ptr;
2917 	 unsigned char *buf;
2918 	 const size_t sizeWithoutChecksum = 8 + 4;
2919 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2920 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2921 	buf = stream->alloc(totalSize);
2922 	ptr = buf;
2923 	int tmp = OP_glLineWidthx;memcpy(ptr, &tmp, 4); ptr += 4;
2924 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2925 
2926 		memcpy(ptr, &width, 4); ptr += 4;
2927 
2928 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2929 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2930 
2931 }
2932 
glLoadIdentity_enc(void * self)2933 void glLoadIdentity_enc(void *self )
2934 {
2935 
2936 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2937 	IOStream *stream = ctx->m_stream;
2938 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2939 	bool useChecksum = checksumCalculator->getVersion() > 0;
2940 
2941 	 unsigned char *ptr;
2942 	 unsigned char *buf;
2943 	 const size_t sizeWithoutChecksum = 8;
2944 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2945 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2946 	buf = stream->alloc(totalSize);
2947 	ptr = buf;
2948 	int tmp = OP_glLoadIdentity;memcpy(ptr, &tmp, 4); ptr += 4;
2949 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2950 
2951 
2952 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2953 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2954 
2955 }
2956 
glLoadMatrixx_enc(void * self,const GLfixed * m)2957 void glLoadMatrixx_enc(void *self , const GLfixed* m)
2958 {
2959 
2960 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2961 	IOStream *stream = ctx->m_stream;
2962 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2963 	bool useChecksum = checksumCalculator->getVersion() > 0;
2964 
2965 	const unsigned int __size_m =  (16 * sizeof(GLfixed));
2966 	 unsigned char *ptr;
2967 	 unsigned char *buf;
2968 	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
2969 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2970 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2971 	buf = stream->alloc(totalSize);
2972 	ptr = buf;
2973 	int tmp = OP_glLoadMatrixx;memcpy(ptr, &tmp, 4); ptr += 4;
2974 	memcpy(ptr, &totalSize, 4);  ptr += 4;
2975 
2976 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
2977 	memcpy(ptr, m, __size_m);ptr += __size_m;
2978 
2979 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
2980 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
2981 
2982 }
2983 
glLogicOp_enc(void * self,GLenum opcode)2984 void glLogicOp_enc(void *self , GLenum opcode)
2985 {
2986 
2987 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2988 	IOStream *stream = ctx->m_stream;
2989 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
2990 	bool useChecksum = checksumCalculator->getVersion() > 0;
2991 
2992 	 unsigned char *ptr;
2993 	 unsigned char *buf;
2994 	 const size_t sizeWithoutChecksum = 8 + 4;
2995 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
2996 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
2997 	buf = stream->alloc(totalSize);
2998 	ptr = buf;
2999 	int tmp = OP_glLogicOp;memcpy(ptr, &tmp, 4); ptr += 4;
3000 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3001 
3002 		memcpy(ptr, &opcode, 4); ptr += 4;
3003 
3004 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3005 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3006 
3007 }
3008 
glMaterialx_enc(void * self,GLenum face,GLenum pname,GLfixed param)3009 void glMaterialx_enc(void *self , GLenum face, GLenum pname, GLfixed param)
3010 {
3011 
3012 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3013 	IOStream *stream = ctx->m_stream;
3014 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3015 	bool useChecksum = checksumCalculator->getVersion() > 0;
3016 
3017 	 unsigned char *ptr;
3018 	 unsigned char *buf;
3019 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
3020 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3021 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3022 	buf = stream->alloc(totalSize);
3023 	ptr = buf;
3024 	int tmp = OP_glMaterialx;memcpy(ptr, &tmp, 4); ptr += 4;
3025 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3026 
3027 		memcpy(ptr, &face, 4); ptr += 4;
3028 		memcpy(ptr, &pname, 4); ptr += 4;
3029 		memcpy(ptr, &param, 4); ptr += 4;
3030 
3031 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3032 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3033 
3034 }
3035 
glMaterialxv_enc(void * self,GLenum face,GLenum pname,const GLfixed * params)3036 void glMaterialxv_enc(void *self , GLenum face, GLenum pname, const GLfixed* params)
3037 {
3038 
3039 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3040 	IOStream *stream = ctx->m_stream;
3041 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3042 	bool useChecksum = checksumCalculator->getVersion() > 0;
3043 
3044 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3045 	 unsigned char *ptr;
3046 	 unsigned char *buf;
3047 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
3048 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3049 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3050 	buf = stream->alloc(totalSize);
3051 	ptr = buf;
3052 	int tmp = OP_glMaterialxv;memcpy(ptr, &tmp, 4); ptr += 4;
3053 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3054 
3055 		memcpy(ptr, &face, 4); ptr += 4;
3056 		memcpy(ptr, &pname, 4); ptr += 4;
3057 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3058 	memcpy(ptr, params, __size_params);ptr += __size_params;
3059 
3060 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3061 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3062 
3063 }
3064 
glMatrixMode_enc(void * self,GLenum mode)3065 void glMatrixMode_enc(void *self , GLenum mode)
3066 {
3067 
3068 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3069 	IOStream *stream = ctx->m_stream;
3070 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3071 	bool useChecksum = checksumCalculator->getVersion() > 0;
3072 
3073 	 unsigned char *ptr;
3074 	 unsigned char *buf;
3075 	 const size_t sizeWithoutChecksum = 8 + 4;
3076 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3077 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3078 	buf = stream->alloc(totalSize);
3079 	ptr = buf;
3080 	int tmp = OP_glMatrixMode;memcpy(ptr, &tmp, 4); ptr += 4;
3081 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3082 
3083 		memcpy(ptr, &mode, 4); ptr += 4;
3084 
3085 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3086 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3087 
3088 }
3089 
glMultMatrixx_enc(void * self,const GLfixed * m)3090 void glMultMatrixx_enc(void *self , const GLfixed* m)
3091 {
3092 
3093 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3094 	IOStream *stream = ctx->m_stream;
3095 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3096 	bool useChecksum = checksumCalculator->getVersion() > 0;
3097 
3098 	const unsigned int __size_m =  (16 * sizeof(GLfixed));
3099 	 unsigned char *ptr;
3100 	 unsigned char *buf;
3101 	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
3102 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3103 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3104 	buf = stream->alloc(totalSize);
3105 	ptr = buf;
3106 	int tmp = OP_glMultMatrixx;memcpy(ptr, &tmp, 4); ptr += 4;
3107 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3108 
3109 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
3110 	memcpy(ptr, m, __size_m);ptr += __size_m;
3111 
3112 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3113 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3114 
3115 }
3116 
glMultiTexCoord4x_enc(void * self,GLenum target,GLfixed s,GLfixed t,GLfixed r,GLfixed q)3117 void glMultiTexCoord4x_enc(void *self , GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
3118 {
3119 
3120 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3121 	IOStream *stream = ctx->m_stream;
3122 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3123 	bool useChecksum = checksumCalculator->getVersion() > 0;
3124 
3125 	 unsigned char *ptr;
3126 	 unsigned char *buf;
3127 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
3128 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3129 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3130 	buf = stream->alloc(totalSize);
3131 	ptr = buf;
3132 	int tmp = OP_glMultiTexCoord4x;memcpy(ptr, &tmp, 4); ptr += 4;
3133 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3134 
3135 		memcpy(ptr, &target, 4); ptr += 4;
3136 		memcpy(ptr, &s, 4); ptr += 4;
3137 		memcpy(ptr, &t, 4); ptr += 4;
3138 		memcpy(ptr, &r, 4); ptr += 4;
3139 		memcpy(ptr, &q, 4); ptr += 4;
3140 
3141 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3142 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3143 
3144 }
3145 
glNormal3x_enc(void * self,GLfixed nx,GLfixed ny,GLfixed nz)3146 void glNormal3x_enc(void *self , GLfixed nx, GLfixed ny, GLfixed nz)
3147 {
3148 
3149 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3150 	IOStream *stream = ctx->m_stream;
3151 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3152 	bool useChecksum = checksumCalculator->getVersion() > 0;
3153 
3154 	 unsigned char *ptr;
3155 	 unsigned char *buf;
3156 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
3157 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3158 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3159 	buf = stream->alloc(totalSize);
3160 	ptr = buf;
3161 	int tmp = OP_glNormal3x;memcpy(ptr, &tmp, 4); ptr += 4;
3162 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3163 
3164 		memcpy(ptr, &nx, 4); ptr += 4;
3165 		memcpy(ptr, &ny, 4); ptr += 4;
3166 		memcpy(ptr, &nz, 4); ptr += 4;
3167 
3168 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3169 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3170 
3171 }
3172 
glOrthox_enc(void * self,GLfixed left,GLfixed right,GLfixed bottom,GLfixed top,GLfixed zNear,GLfixed zFar)3173 void glOrthox_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
3174 {
3175 
3176 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3177 	IOStream *stream = ctx->m_stream;
3178 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3179 	bool useChecksum = checksumCalculator->getVersion() > 0;
3180 
3181 	 unsigned char *ptr;
3182 	 unsigned char *buf;
3183 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
3184 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3185 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3186 	buf = stream->alloc(totalSize);
3187 	ptr = buf;
3188 	int tmp = OP_glOrthox;memcpy(ptr, &tmp, 4); ptr += 4;
3189 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3190 
3191 		memcpy(ptr, &left, 4); ptr += 4;
3192 		memcpy(ptr, &right, 4); ptr += 4;
3193 		memcpy(ptr, &bottom, 4); ptr += 4;
3194 		memcpy(ptr, &top, 4); ptr += 4;
3195 		memcpy(ptr, &zNear, 4); ptr += 4;
3196 		memcpy(ptr, &zFar, 4); ptr += 4;
3197 
3198 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3199 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3200 
3201 }
3202 
glPixelStorei_enc(void * self,GLenum pname,GLint param)3203 void glPixelStorei_enc(void *self , GLenum pname, GLint param)
3204 {
3205 
3206 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3207 	IOStream *stream = ctx->m_stream;
3208 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3209 	bool useChecksum = checksumCalculator->getVersion() > 0;
3210 
3211 	 unsigned char *ptr;
3212 	 unsigned char *buf;
3213 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
3214 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3215 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3216 	buf = stream->alloc(totalSize);
3217 	ptr = buf;
3218 	int tmp = OP_glPixelStorei;memcpy(ptr, &tmp, 4); ptr += 4;
3219 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3220 
3221 		memcpy(ptr, &pname, 4); ptr += 4;
3222 		memcpy(ptr, &param, 4); ptr += 4;
3223 
3224 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3225 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3226 
3227 }
3228 
glPointParameterx_enc(void * self,GLenum pname,GLfixed param)3229 void glPointParameterx_enc(void *self , GLenum pname, GLfixed param)
3230 {
3231 
3232 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3233 	IOStream *stream = ctx->m_stream;
3234 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3235 	bool useChecksum = checksumCalculator->getVersion() > 0;
3236 
3237 	 unsigned char *ptr;
3238 	 unsigned char *buf;
3239 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
3240 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3241 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3242 	buf = stream->alloc(totalSize);
3243 	ptr = buf;
3244 	int tmp = OP_glPointParameterx;memcpy(ptr, &tmp, 4); ptr += 4;
3245 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3246 
3247 		memcpy(ptr, &pname, 4); ptr += 4;
3248 		memcpy(ptr, &param, 4); ptr += 4;
3249 
3250 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3251 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3252 
3253 }
3254 
glPointParameterxv_enc(void * self,GLenum pname,const GLfixed * params)3255 void glPointParameterxv_enc(void *self , GLenum pname, const GLfixed* params)
3256 {
3257 
3258 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3259 	IOStream *stream = ctx->m_stream;
3260 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3261 	bool useChecksum = checksumCalculator->getVersion() > 0;
3262 
3263 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3264 	 unsigned char *ptr;
3265 	 unsigned char *buf;
3266 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
3267 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3268 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3269 	buf = stream->alloc(totalSize);
3270 	ptr = buf;
3271 	int tmp = OP_glPointParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
3272 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3273 
3274 		memcpy(ptr, &pname, 4); ptr += 4;
3275 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3276 	memcpy(ptr, params, __size_params);ptr += __size_params;
3277 
3278 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3279 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3280 
3281 }
3282 
glPointSizex_enc(void * self,GLfixed size)3283 void glPointSizex_enc(void *self , GLfixed size)
3284 {
3285 
3286 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3287 	IOStream *stream = ctx->m_stream;
3288 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3289 	bool useChecksum = checksumCalculator->getVersion() > 0;
3290 
3291 	 unsigned char *ptr;
3292 	 unsigned char *buf;
3293 	 const size_t sizeWithoutChecksum = 8 + 4;
3294 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3295 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3296 	buf = stream->alloc(totalSize);
3297 	ptr = buf;
3298 	int tmp = OP_glPointSizex;memcpy(ptr, &tmp, 4); ptr += 4;
3299 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3300 
3301 		memcpy(ptr, &size, 4); ptr += 4;
3302 
3303 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3304 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3305 
3306 }
3307 
glPolygonOffsetx_enc(void * self,GLfixed factor,GLfixed units)3308 void glPolygonOffsetx_enc(void *self , GLfixed factor, GLfixed units)
3309 {
3310 
3311 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3312 	IOStream *stream = ctx->m_stream;
3313 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3314 	bool useChecksum = checksumCalculator->getVersion() > 0;
3315 
3316 	 unsigned char *ptr;
3317 	 unsigned char *buf;
3318 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
3319 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3320 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3321 	buf = stream->alloc(totalSize);
3322 	ptr = buf;
3323 	int tmp = OP_glPolygonOffsetx;memcpy(ptr, &tmp, 4); ptr += 4;
3324 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3325 
3326 		memcpy(ptr, &factor, 4); ptr += 4;
3327 		memcpy(ptr, &units, 4); ptr += 4;
3328 
3329 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3330 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3331 
3332 }
3333 
glPopMatrix_enc(void * self)3334 void glPopMatrix_enc(void *self )
3335 {
3336 
3337 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3338 	IOStream *stream = ctx->m_stream;
3339 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3340 	bool useChecksum = checksumCalculator->getVersion() > 0;
3341 
3342 	 unsigned char *ptr;
3343 	 unsigned char *buf;
3344 	 const size_t sizeWithoutChecksum = 8;
3345 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3346 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3347 	buf = stream->alloc(totalSize);
3348 	ptr = buf;
3349 	int tmp = OP_glPopMatrix;memcpy(ptr, &tmp, 4); ptr += 4;
3350 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3351 
3352 
3353 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3354 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3355 
3356 }
3357 
glPushMatrix_enc(void * self)3358 void glPushMatrix_enc(void *self )
3359 {
3360 
3361 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3362 	IOStream *stream = ctx->m_stream;
3363 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3364 	bool useChecksum = checksumCalculator->getVersion() > 0;
3365 
3366 	 unsigned char *ptr;
3367 	 unsigned char *buf;
3368 	 const size_t sizeWithoutChecksum = 8;
3369 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3370 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3371 	buf = stream->alloc(totalSize);
3372 	ptr = buf;
3373 	int tmp = OP_glPushMatrix;memcpy(ptr, &tmp, 4); ptr += 4;
3374 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3375 
3376 
3377 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3378 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3379 
3380 }
3381 
glReadPixels_enc(void * self,GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,GLvoid * pixels)3382 void glReadPixels_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
3383 {
3384 
3385 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3386 	IOStream *stream = ctx->m_stream;
3387 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3388 	bool useChecksum = checksumCalculator->getVersion() > 0;
3389 
3390 	const unsigned int __size_pixels =  glesv1_enc::pixelDataSize(self, width, height, format, type, 1);
3391 	 unsigned char *ptr;
3392 	 unsigned char *buf;
3393 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 0 + 1*4;
3394 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3395 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3396 	buf = stream->alloc(totalSize);
3397 	ptr = buf;
3398 	int tmp = OP_glReadPixels;memcpy(ptr, &tmp, 4); ptr += 4;
3399 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3400 
3401 		memcpy(ptr, &x, 4); ptr += 4;
3402 		memcpy(ptr, &y, 4); ptr += 4;
3403 		memcpy(ptr, &width, 4); ptr += 4;
3404 		memcpy(ptr, &height, 4); ptr += 4;
3405 		memcpy(ptr, &format, 4); ptr += 4;
3406 		memcpy(ptr, &type, 4); ptr += 4;
3407 	*(unsigned int *)(ptr) = __size_pixels; ptr += 4;
3408 
3409 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3410 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3411 
3412 	stream->readback(pixels, __size_pixels);
3413 	if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
3414 	if (useChecksum) {
3415 		unsigned char *checksumBufPtr = NULL;
3416 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
3417 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
3418 		stream->readback(checksumBufPtr, checksumSize);
3419 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
3420 			ALOGE("glReadPixels: GL communication error, please report this issue to b.android.com.\n");
3421 			abort();
3422 		}
3423 	}
3424 }
3425 
glRotatex_enc(void * self,GLfixed angle,GLfixed x,GLfixed y,GLfixed z)3426 void glRotatex_enc(void *self , GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
3427 {
3428 
3429 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3430 	IOStream *stream = ctx->m_stream;
3431 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3432 	bool useChecksum = checksumCalculator->getVersion() > 0;
3433 
3434 	 unsigned char *ptr;
3435 	 unsigned char *buf;
3436 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
3437 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3438 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3439 	buf = stream->alloc(totalSize);
3440 	ptr = buf;
3441 	int tmp = OP_glRotatex;memcpy(ptr, &tmp, 4); ptr += 4;
3442 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3443 
3444 		memcpy(ptr, &angle, 4); ptr += 4;
3445 		memcpy(ptr, &x, 4); ptr += 4;
3446 		memcpy(ptr, &y, 4); ptr += 4;
3447 		memcpy(ptr, &z, 4); ptr += 4;
3448 
3449 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3450 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3451 
3452 }
3453 
glSampleCoverage_enc(void * self,GLclampf value,GLboolean invert)3454 void glSampleCoverage_enc(void *self , GLclampf value, GLboolean invert)
3455 {
3456 
3457 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3458 	IOStream *stream = ctx->m_stream;
3459 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3460 	bool useChecksum = checksumCalculator->getVersion() > 0;
3461 
3462 	 unsigned char *ptr;
3463 	 unsigned char *buf;
3464 	 const size_t sizeWithoutChecksum = 8 + 4 + 1;
3465 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3466 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3467 	buf = stream->alloc(totalSize);
3468 	ptr = buf;
3469 	int tmp = OP_glSampleCoverage;memcpy(ptr, &tmp, 4); ptr += 4;
3470 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3471 
3472 		memcpy(ptr, &value, 4); ptr += 4;
3473 		memcpy(ptr, &invert, 1); ptr += 1;
3474 
3475 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3476 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3477 
3478 }
3479 
glSampleCoveragex_enc(void * self,GLclampx value,GLboolean invert)3480 void glSampleCoveragex_enc(void *self , GLclampx value, GLboolean invert)
3481 {
3482 
3483 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3484 	IOStream *stream = ctx->m_stream;
3485 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3486 	bool useChecksum = checksumCalculator->getVersion() > 0;
3487 
3488 	 unsigned char *ptr;
3489 	 unsigned char *buf;
3490 	 const size_t sizeWithoutChecksum = 8 + 4 + 1;
3491 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3492 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3493 	buf = stream->alloc(totalSize);
3494 	ptr = buf;
3495 	int tmp = OP_glSampleCoveragex;memcpy(ptr, &tmp, 4); ptr += 4;
3496 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3497 
3498 		memcpy(ptr, &value, 4); ptr += 4;
3499 		memcpy(ptr, &invert, 1); ptr += 1;
3500 
3501 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3502 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3503 
3504 }
3505 
glScalex_enc(void * self,GLfixed x,GLfixed y,GLfixed z)3506 void glScalex_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
3507 {
3508 
3509 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3510 	IOStream *stream = ctx->m_stream;
3511 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3512 	bool useChecksum = checksumCalculator->getVersion() > 0;
3513 
3514 	 unsigned char *ptr;
3515 	 unsigned char *buf;
3516 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
3517 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3518 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3519 	buf = stream->alloc(totalSize);
3520 	ptr = buf;
3521 	int tmp = OP_glScalex;memcpy(ptr, &tmp, 4); ptr += 4;
3522 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3523 
3524 		memcpy(ptr, &x, 4); ptr += 4;
3525 		memcpy(ptr, &y, 4); ptr += 4;
3526 		memcpy(ptr, &z, 4); ptr += 4;
3527 
3528 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3529 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3530 
3531 }
3532 
glScissor_enc(void * self,GLint x,GLint y,GLsizei width,GLsizei height)3533 void glScissor_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
3534 {
3535 
3536 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3537 	IOStream *stream = ctx->m_stream;
3538 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3539 	bool useChecksum = checksumCalculator->getVersion() > 0;
3540 
3541 	 unsigned char *ptr;
3542 	 unsigned char *buf;
3543 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
3544 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3545 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3546 	buf = stream->alloc(totalSize);
3547 	ptr = buf;
3548 	int tmp = OP_glScissor;memcpy(ptr, &tmp, 4); ptr += 4;
3549 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3550 
3551 		memcpy(ptr, &x, 4); ptr += 4;
3552 		memcpy(ptr, &y, 4); ptr += 4;
3553 		memcpy(ptr, &width, 4); ptr += 4;
3554 		memcpy(ptr, &height, 4); ptr += 4;
3555 
3556 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3557 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3558 
3559 }
3560 
glShadeModel_enc(void * self,GLenum mode)3561 void glShadeModel_enc(void *self , GLenum mode)
3562 {
3563 
3564 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3565 	IOStream *stream = ctx->m_stream;
3566 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3567 	bool useChecksum = checksumCalculator->getVersion() > 0;
3568 
3569 	 unsigned char *ptr;
3570 	 unsigned char *buf;
3571 	 const size_t sizeWithoutChecksum = 8 + 4;
3572 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3573 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3574 	buf = stream->alloc(totalSize);
3575 	ptr = buf;
3576 	int tmp = OP_glShadeModel;memcpy(ptr, &tmp, 4); ptr += 4;
3577 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3578 
3579 		memcpy(ptr, &mode, 4); ptr += 4;
3580 
3581 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3582 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3583 
3584 }
3585 
glStencilFunc_enc(void * self,GLenum func,GLint ref,GLuint mask)3586 void glStencilFunc_enc(void *self , GLenum func, GLint ref, GLuint mask)
3587 {
3588 
3589 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3590 	IOStream *stream = ctx->m_stream;
3591 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3592 	bool useChecksum = checksumCalculator->getVersion() > 0;
3593 
3594 	 unsigned char *ptr;
3595 	 unsigned char *buf;
3596 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
3597 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3598 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3599 	buf = stream->alloc(totalSize);
3600 	ptr = buf;
3601 	int tmp = OP_glStencilFunc;memcpy(ptr, &tmp, 4); ptr += 4;
3602 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3603 
3604 		memcpy(ptr, &func, 4); ptr += 4;
3605 		memcpy(ptr, &ref, 4); ptr += 4;
3606 		memcpy(ptr, &mask, 4); ptr += 4;
3607 
3608 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3609 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3610 
3611 }
3612 
glStencilMask_enc(void * self,GLuint mask)3613 void glStencilMask_enc(void *self , GLuint mask)
3614 {
3615 
3616 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3617 	IOStream *stream = ctx->m_stream;
3618 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3619 	bool useChecksum = checksumCalculator->getVersion() > 0;
3620 
3621 	 unsigned char *ptr;
3622 	 unsigned char *buf;
3623 	 const size_t sizeWithoutChecksum = 8 + 4;
3624 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3625 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3626 	buf = stream->alloc(totalSize);
3627 	ptr = buf;
3628 	int tmp = OP_glStencilMask;memcpy(ptr, &tmp, 4); ptr += 4;
3629 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3630 
3631 		memcpy(ptr, &mask, 4); ptr += 4;
3632 
3633 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3634 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3635 
3636 }
3637 
glStencilOp_enc(void * self,GLenum fail,GLenum zfail,GLenum zpass)3638 void glStencilOp_enc(void *self , GLenum fail, GLenum zfail, GLenum zpass)
3639 {
3640 
3641 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3642 	IOStream *stream = ctx->m_stream;
3643 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3644 	bool useChecksum = checksumCalculator->getVersion() > 0;
3645 
3646 	 unsigned char *ptr;
3647 	 unsigned char *buf;
3648 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
3649 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3650 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3651 	buf = stream->alloc(totalSize);
3652 	ptr = buf;
3653 	int tmp = OP_glStencilOp;memcpy(ptr, &tmp, 4); ptr += 4;
3654 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3655 
3656 		memcpy(ptr, &fail, 4); ptr += 4;
3657 		memcpy(ptr, &zfail, 4); ptr += 4;
3658 		memcpy(ptr, &zpass, 4); ptr += 4;
3659 
3660 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3661 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3662 
3663 }
3664 
glTexEnvi_enc(void * self,GLenum target,GLenum pname,GLint param)3665 void glTexEnvi_enc(void *self , GLenum target, GLenum pname, GLint param)
3666 {
3667 
3668 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3669 	IOStream *stream = ctx->m_stream;
3670 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3671 	bool useChecksum = checksumCalculator->getVersion() > 0;
3672 
3673 	 unsigned char *ptr;
3674 	 unsigned char *buf;
3675 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
3676 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3677 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3678 	buf = stream->alloc(totalSize);
3679 	ptr = buf;
3680 	int tmp = OP_glTexEnvi;memcpy(ptr, &tmp, 4); ptr += 4;
3681 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3682 
3683 		memcpy(ptr, &target, 4); ptr += 4;
3684 		memcpy(ptr, &pname, 4); ptr += 4;
3685 		memcpy(ptr, &param, 4); ptr += 4;
3686 
3687 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3688 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3689 
3690 }
3691 
glTexEnvx_enc(void * self,GLenum target,GLenum pname,GLfixed param)3692 void glTexEnvx_enc(void *self , GLenum target, GLenum pname, GLfixed param)
3693 {
3694 
3695 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3696 	IOStream *stream = ctx->m_stream;
3697 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3698 	bool useChecksum = checksumCalculator->getVersion() > 0;
3699 
3700 	 unsigned char *ptr;
3701 	 unsigned char *buf;
3702 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
3703 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3704 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3705 	buf = stream->alloc(totalSize);
3706 	ptr = buf;
3707 	int tmp = OP_glTexEnvx;memcpy(ptr, &tmp, 4); ptr += 4;
3708 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3709 
3710 		memcpy(ptr, &target, 4); ptr += 4;
3711 		memcpy(ptr, &pname, 4); ptr += 4;
3712 		memcpy(ptr, &param, 4); ptr += 4;
3713 
3714 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3715 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3716 
3717 }
3718 
glTexEnviv_enc(void * self,GLenum target,GLenum pname,const GLint * params)3719 void glTexEnviv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
3720 {
3721 
3722 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3723 	IOStream *stream = ctx->m_stream;
3724 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3725 	bool useChecksum = checksumCalculator->getVersion() > 0;
3726 
3727 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
3728 	 unsigned char *ptr;
3729 	 unsigned char *buf;
3730 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
3731 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3732 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3733 	buf = stream->alloc(totalSize);
3734 	ptr = buf;
3735 	int tmp = OP_glTexEnviv;memcpy(ptr, &tmp, 4); ptr += 4;
3736 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3737 
3738 		memcpy(ptr, &target, 4); ptr += 4;
3739 		memcpy(ptr, &pname, 4); ptr += 4;
3740 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3741 	memcpy(ptr, params, __size_params);ptr += __size_params;
3742 
3743 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3744 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3745 
3746 }
3747 
glTexEnvxv_enc(void * self,GLenum target,GLenum pname,const GLfixed * params)3748 void glTexEnvxv_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
3749 {
3750 
3751 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3752 	IOStream *stream = ctx->m_stream;
3753 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3754 	bool useChecksum = checksumCalculator->getVersion() > 0;
3755 
3756 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3757 	 unsigned char *ptr;
3758 	 unsigned char *buf;
3759 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
3760 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3761 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3762 	buf = stream->alloc(totalSize);
3763 	ptr = buf;
3764 	int tmp = OP_glTexEnvxv;memcpy(ptr, &tmp, 4); ptr += 4;
3765 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3766 
3767 		memcpy(ptr, &target, 4); ptr += 4;
3768 		memcpy(ptr, &pname, 4); ptr += 4;
3769 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3770 	memcpy(ptr, params, __size_params);ptr += __size_params;
3771 
3772 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3773 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3774 
3775 }
3776 
glTexImage2D_enc(void * self,GLenum target,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const GLvoid * pixels)3777 void glTexImage2D_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
3778 {
3779 
3780 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3781 	IOStream *stream = ctx->m_stream;
3782 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3783 	bool useChecksum = checksumCalculator->getVersion() > 0;
3784 
3785 	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv1_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
3786 	 unsigned char *ptr;
3787 	 unsigned char *buf;
3788 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
3789 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3790 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3791 	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
3792 	ptr = buf;
3793 	int tmp = OP_glTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
3794 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3795 
3796 		memcpy(ptr, &target, 4); ptr += 4;
3797 		memcpy(ptr, &level, 4); ptr += 4;
3798 		memcpy(ptr, &internalformat, 4); ptr += 4;
3799 		memcpy(ptr, &width, 4); ptr += 4;
3800 		memcpy(ptr, &height, 4); ptr += 4;
3801 		memcpy(ptr, &border, 4); ptr += 4;
3802 		memcpy(ptr, &format, 4); ptr += 4;
3803 		memcpy(ptr, &type, 4); ptr += 4;
3804 
3805 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3806 	stream->flush();
3807 	stream->writeFully(&__size_pixels,4);
3808 	if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
3809 	if (pixels != NULL) {
3810 		stream->writeFully(pixels, __size_pixels);
3811 		if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
3812 	}
3813 	buf = stream->alloc(checksumSize);
3814 	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
3815 
3816 }
3817 
glTexParameteri_enc(void * self,GLenum target,GLenum pname,GLint param)3818 void glTexParameteri_enc(void *self , GLenum target, GLenum pname, GLint param)
3819 {
3820 
3821 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3822 	IOStream *stream = ctx->m_stream;
3823 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3824 	bool useChecksum = checksumCalculator->getVersion() > 0;
3825 
3826 	 unsigned char *ptr;
3827 	 unsigned char *buf;
3828 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
3829 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3830 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3831 	buf = stream->alloc(totalSize);
3832 	ptr = buf;
3833 	int tmp = OP_glTexParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
3834 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3835 
3836 		memcpy(ptr, &target, 4); ptr += 4;
3837 		memcpy(ptr, &pname, 4); ptr += 4;
3838 		memcpy(ptr, &param, 4); ptr += 4;
3839 
3840 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3841 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3842 
3843 }
3844 
glTexParameterx_enc(void * self,GLenum target,GLenum pname,GLfixed param)3845 void glTexParameterx_enc(void *self , GLenum target, GLenum pname, GLfixed param)
3846 {
3847 
3848 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3849 	IOStream *stream = ctx->m_stream;
3850 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3851 	bool useChecksum = checksumCalculator->getVersion() > 0;
3852 
3853 	 unsigned char *ptr;
3854 	 unsigned char *buf;
3855 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
3856 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3857 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3858 	buf = stream->alloc(totalSize);
3859 	ptr = buf;
3860 	int tmp = OP_glTexParameterx;memcpy(ptr, &tmp, 4); ptr += 4;
3861 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3862 
3863 		memcpy(ptr, &target, 4); ptr += 4;
3864 		memcpy(ptr, &pname, 4); ptr += 4;
3865 		memcpy(ptr, &param, 4); ptr += 4;
3866 
3867 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3868 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3869 
3870 }
3871 
glTexParameteriv_enc(void * self,GLenum target,GLenum pname,const GLint * params)3872 void glTexParameteriv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
3873 {
3874 
3875 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3876 	IOStream *stream = ctx->m_stream;
3877 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3878 	bool useChecksum = checksumCalculator->getVersion() > 0;
3879 
3880 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
3881 	 unsigned char *ptr;
3882 	 unsigned char *buf;
3883 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
3884 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3885 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3886 	buf = stream->alloc(totalSize);
3887 	ptr = buf;
3888 	int tmp = OP_glTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
3889 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3890 
3891 		memcpy(ptr, &target, 4); ptr += 4;
3892 		memcpy(ptr, &pname, 4); ptr += 4;
3893 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3894 	memcpy(ptr, params, __size_params);ptr += __size_params;
3895 
3896 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3897 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3898 
3899 }
3900 
glTexParameterxv_enc(void * self,GLenum target,GLenum pname,const GLfixed * params)3901 void glTexParameterxv_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
3902 {
3903 
3904 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3905 	IOStream *stream = ctx->m_stream;
3906 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3907 	bool useChecksum = checksumCalculator->getVersion() > 0;
3908 
3909 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3910 	 unsigned char *ptr;
3911 	 unsigned char *buf;
3912 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
3913 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3914 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3915 	buf = stream->alloc(totalSize);
3916 	ptr = buf;
3917 	int tmp = OP_glTexParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
3918 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3919 
3920 		memcpy(ptr, &target, 4); ptr += 4;
3921 		memcpy(ptr, &pname, 4); ptr += 4;
3922 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3923 	memcpy(ptr, params, __size_params);ptr += __size_params;
3924 
3925 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3926 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3927 
3928 }
3929 
glTexSubImage2D_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const GLvoid * pixels)3930 void glTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
3931 {
3932 
3933 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3934 	IOStream *stream = ctx->m_stream;
3935 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3936 	bool useChecksum = checksumCalculator->getVersion() > 0;
3937 
3938 	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv1_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
3939 	 unsigned char *ptr;
3940 	 unsigned char *buf;
3941 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
3942 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3943 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3944 	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
3945 	ptr = buf;
3946 	int tmp = OP_glTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
3947 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3948 
3949 		memcpy(ptr, &target, 4); ptr += 4;
3950 		memcpy(ptr, &level, 4); ptr += 4;
3951 		memcpy(ptr, &xoffset, 4); ptr += 4;
3952 		memcpy(ptr, &yoffset, 4); ptr += 4;
3953 		memcpy(ptr, &width, 4); ptr += 4;
3954 		memcpy(ptr, &height, 4); ptr += 4;
3955 		memcpy(ptr, &format, 4); ptr += 4;
3956 		memcpy(ptr, &type, 4); ptr += 4;
3957 
3958 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3959 	stream->flush();
3960 	stream->writeFully(&__size_pixels,4);
3961 	if (useChecksum) checksumCalculator->addBuffer(&__size_pixels,4);
3962 	if (pixels != NULL) {
3963 		stream->writeFully(pixels, __size_pixels);
3964 		if (useChecksum) checksumCalculator->addBuffer(pixels, __size_pixels);
3965 	}
3966 	buf = stream->alloc(checksumSize);
3967 	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
3968 
3969 }
3970 
glTranslatex_enc(void * self,GLfixed x,GLfixed y,GLfixed z)3971 void glTranslatex_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
3972 {
3973 
3974 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3975 	IOStream *stream = ctx->m_stream;
3976 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
3977 	bool useChecksum = checksumCalculator->getVersion() > 0;
3978 
3979 	 unsigned char *ptr;
3980 	 unsigned char *buf;
3981 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
3982 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
3983 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
3984 	buf = stream->alloc(totalSize);
3985 	ptr = buf;
3986 	int tmp = OP_glTranslatex;memcpy(ptr, &tmp, 4); ptr += 4;
3987 	memcpy(ptr, &totalSize, 4);  ptr += 4;
3988 
3989 		memcpy(ptr, &x, 4); ptr += 4;
3990 		memcpy(ptr, &y, 4); ptr += 4;
3991 		memcpy(ptr, &z, 4); ptr += 4;
3992 
3993 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
3994 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
3995 
3996 }
3997 
glViewport_enc(void * self,GLint x,GLint y,GLsizei width,GLsizei height)3998 void glViewport_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
3999 {
4000 
4001 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4002 	IOStream *stream = ctx->m_stream;
4003 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4004 	bool useChecksum = checksumCalculator->getVersion() > 0;
4005 
4006 	 unsigned char *ptr;
4007 	 unsigned char *buf;
4008 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
4009 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4010 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4011 	buf = stream->alloc(totalSize);
4012 	ptr = buf;
4013 	int tmp = OP_glViewport;memcpy(ptr, &tmp, 4); ptr += 4;
4014 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4015 
4016 		memcpy(ptr, &x, 4); ptr += 4;
4017 		memcpy(ptr, &y, 4); ptr += 4;
4018 		memcpy(ptr, &width, 4); ptr += 4;
4019 		memcpy(ptr, &height, 4); ptr += 4;
4020 
4021 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4022 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4023 
4024 }
4025 
glVertexPointerOffset_enc(void * self,GLint size,GLenum type,GLsizei stride,GLuint offset)4026 void glVertexPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
4027 {
4028 
4029 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4030 	IOStream *stream = ctx->m_stream;
4031 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4032 	bool useChecksum = checksumCalculator->getVersion() > 0;
4033 
4034 	 unsigned char *ptr;
4035 	 unsigned char *buf;
4036 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
4037 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4038 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4039 	buf = stream->alloc(totalSize);
4040 	ptr = buf;
4041 	int tmp = OP_glVertexPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
4042 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4043 
4044 		memcpy(ptr, &size, 4); ptr += 4;
4045 		memcpy(ptr, &type, 4); ptr += 4;
4046 		memcpy(ptr, &stride, 4); ptr += 4;
4047 		memcpy(ptr, &offset, 4); ptr += 4;
4048 
4049 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4050 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4051 
4052 }
4053 
glColorPointerOffset_enc(void * self,GLint size,GLenum type,GLsizei stride,GLuint offset)4054 void glColorPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
4055 {
4056 
4057 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4058 	IOStream *stream = ctx->m_stream;
4059 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4060 	bool useChecksum = checksumCalculator->getVersion() > 0;
4061 
4062 	 unsigned char *ptr;
4063 	 unsigned char *buf;
4064 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
4065 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4066 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4067 	buf = stream->alloc(totalSize);
4068 	ptr = buf;
4069 	int tmp = OP_glColorPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
4070 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4071 
4072 		memcpy(ptr, &size, 4); ptr += 4;
4073 		memcpy(ptr, &type, 4); ptr += 4;
4074 		memcpy(ptr, &stride, 4); ptr += 4;
4075 		memcpy(ptr, &offset, 4); ptr += 4;
4076 
4077 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4078 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4079 
4080 }
4081 
glNormalPointerOffset_enc(void * self,GLenum type,GLsizei stride,GLuint offset)4082 void glNormalPointerOffset_enc(void *self , GLenum type, GLsizei stride, GLuint offset)
4083 {
4084 
4085 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4086 	IOStream *stream = ctx->m_stream;
4087 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4088 	bool useChecksum = checksumCalculator->getVersion() > 0;
4089 
4090 	 unsigned char *ptr;
4091 	 unsigned char *buf;
4092 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
4093 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4094 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4095 	buf = stream->alloc(totalSize);
4096 	ptr = buf;
4097 	int tmp = OP_glNormalPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
4098 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4099 
4100 		memcpy(ptr, &type, 4); ptr += 4;
4101 		memcpy(ptr, &stride, 4); ptr += 4;
4102 		memcpy(ptr, &offset, 4); ptr += 4;
4103 
4104 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4105 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4106 
4107 }
4108 
glPointSizePointerOffset_enc(void * self,GLenum type,GLsizei stride,GLuint offset)4109 void glPointSizePointerOffset_enc(void *self , GLenum type, GLsizei stride, GLuint offset)
4110 {
4111 
4112 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4113 	IOStream *stream = ctx->m_stream;
4114 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4115 	bool useChecksum = checksumCalculator->getVersion() > 0;
4116 
4117 	 unsigned char *ptr;
4118 	 unsigned char *buf;
4119 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
4120 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4121 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4122 	buf = stream->alloc(totalSize);
4123 	ptr = buf;
4124 	int tmp = OP_glPointSizePointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
4125 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4126 
4127 		memcpy(ptr, &type, 4); ptr += 4;
4128 		memcpy(ptr, &stride, 4); ptr += 4;
4129 		memcpy(ptr, &offset, 4); ptr += 4;
4130 
4131 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4132 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4133 
4134 }
4135 
glTexCoordPointerOffset_enc(void * self,GLint size,GLenum type,GLsizei stride,GLuint offset)4136 void glTexCoordPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
4137 {
4138 
4139 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4140 	IOStream *stream = ctx->m_stream;
4141 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4142 	bool useChecksum = checksumCalculator->getVersion() > 0;
4143 
4144 	 unsigned char *ptr;
4145 	 unsigned char *buf;
4146 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
4147 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4148 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4149 	buf = stream->alloc(totalSize);
4150 	ptr = buf;
4151 	int tmp = OP_glTexCoordPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
4152 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4153 
4154 		memcpy(ptr, &size, 4); ptr += 4;
4155 		memcpy(ptr, &type, 4); ptr += 4;
4156 		memcpy(ptr, &stride, 4); ptr += 4;
4157 		memcpy(ptr, &offset, 4); ptr += 4;
4158 
4159 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4160 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4161 
4162 }
4163 
glWeightPointerOffset_enc(void * self,GLint size,GLenum type,GLsizei stride,GLuint offset)4164 void glWeightPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
4165 {
4166 
4167 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4168 	IOStream *stream = ctx->m_stream;
4169 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4170 	bool useChecksum = checksumCalculator->getVersion() > 0;
4171 
4172 	 unsigned char *ptr;
4173 	 unsigned char *buf;
4174 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
4175 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4176 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4177 	buf = stream->alloc(totalSize);
4178 	ptr = buf;
4179 	int tmp = OP_glWeightPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
4180 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4181 
4182 		memcpy(ptr, &size, 4); ptr += 4;
4183 		memcpy(ptr, &type, 4); ptr += 4;
4184 		memcpy(ptr, &stride, 4); ptr += 4;
4185 		memcpy(ptr, &offset, 4); ptr += 4;
4186 
4187 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4188 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4189 
4190 }
4191 
glMatrixIndexPointerOffset_enc(void * self,GLint size,GLenum type,GLsizei stride,GLuint offset)4192 void glMatrixIndexPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
4193 {
4194 
4195 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4196 	IOStream *stream = ctx->m_stream;
4197 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4198 	bool useChecksum = checksumCalculator->getVersion() > 0;
4199 
4200 	 unsigned char *ptr;
4201 	 unsigned char *buf;
4202 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
4203 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4204 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4205 	buf = stream->alloc(totalSize);
4206 	ptr = buf;
4207 	int tmp = OP_glMatrixIndexPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
4208 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4209 
4210 		memcpy(ptr, &size, 4); ptr += 4;
4211 		memcpy(ptr, &type, 4); ptr += 4;
4212 		memcpy(ptr, &stride, 4); ptr += 4;
4213 		memcpy(ptr, &offset, 4); ptr += 4;
4214 
4215 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4216 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4217 
4218 }
4219 
glVertexPointerData_enc(void * self,GLint size,GLenum type,GLsizei stride,void * data,GLuint datalen)4220 void glVertexPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
4221 {
4222 
4223 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4224 	IOStream *stream = ctx->m_stream;
4225 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4226 	bool useChecksum = checksumCalculator->getVersion() > 0;
4227 
4228 	const unsigned int __size_data =  datalen;
4229 	 unsigned char *ptr;
4230 	 unsigned char *buf;
4231 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
4232 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4233 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4234 	buf = stream->alloc(totalSize);
4235 	ptr = buf;
4236 	int tmp = OP_glVertexPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
4237 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4238 
4239 		memcpy(ptr, &size, 4); ptr += 4;
4240 		memcpy(ptr, &type, 4); ptr += 4;
4241 		memcpy(ptr, &stride, 4); ptr += 4;
4242 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
4243 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
4244 		memcpy(ptr, &datalen, 4); ptr += 4;
4245 
4246 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4247 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4248 
4249 }
4250 
glColorPointerData_enc(void * self,GLint size,GLenum type,GLsizei stride,void * data,GLuint datalen)4251 void glColorPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
4252 {
4253 
4254 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4255 	IOStream *stream = ctx->m_stream;
4256 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4257 	bool useChecksum = checksumCalculator->getVersion() > 0;
4258 
4259 	const unsigned int __size_data =  datalen;
4260 	 unsigned char *ptr;
4261 	 unsigned char *buf;
4262 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
4263 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4264 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4265 	buf = stream->alloc(totalSize);
4266 	ptr = buf;
4267 	int tmp = OP_glColorPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
4268 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4269 
4270 		memcpy(ptr, &size, 4); ptr += 4;
4271 		memcpy(ptr, &type, 4); ptr += 4;
4272 		memcpy(ptr, &stride, 4); ptr += 4;
4273 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
4274 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
4275 		memcpy(ptr, &datalen, 4); ptr += 4;
4276 
4277 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4278 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4279 
4280 }
4281 
glNormalPointerData_enc(void * self,GLenum type,GLsizei stride,void * data,GLuint datalen)4282 void glNormalPointerData_enc(void *self , GLenum type, GLsizei stride, void* data, GLuint datalen)
4283 {
4284 
4285 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4286 	IOStream *stream = ctx->m_stream;
4287 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4288 	bool useChecksum = checksumCalculator->getVersion() > 0;
4289 
4290 	const unsigned int __size_data =  datalen;
4291 	 unsigned char *ptr;
4292 	 unsigned char *buf;
4293 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
4294 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4295 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4296 	buf = stream->alloc(totalSize);
4297 	ptr = buf;
4298 	int tmp = OP_glNormalPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
4299 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4300 
4301 		memcpy(ptr, &type, 4); ptr += 4;
4302 		memcpy(ptr, &stride, 4); ptr += 4;
4303 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
4304 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, 3, type, stride, datalen);ptr += __size_data;
4305 		memcpy(ptr, &datalen, 4); ptr += 4;
4306 
4307 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4308 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4309 
4310 }
4311 
glTexCoordPointerData_enc(void * self,GLint unit,GLint size,GLenum type,GLsizei stride,void * data,GLuint datalen)4312 void glTexCoordPointerData_enc(void *self , GLint unit, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
4313 {
4314 
4315 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4316 	IOStream *stream = ctx->m_stream;
4317 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4318 	bool useChecksum = checksumCalculator->getVersion() > 0;
4319 
4320 	const unsigned int __size_data =  datalen;
4321 	 unsigned char *ptr;
4322 	 unsigned char *buf;
4323 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_data + 4 + 1*4;
4324 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4325 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4326 	buf = stream->alloc(totalSize);
4327 	ptr = buf;
4328 	int tmp = OP_glTexCoordPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
4329 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4330 
4331 		memcpy(ptr, &unit, 4); ptr += 4;
4332 		memcpy(ptr, &size, 4); ptr += 4;
4333 		memcpy(ptr, &type, 4); ptr += 4;
4334 		memcpy(ptr, &stride, 4); ptr += 4;
4335 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
4336 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
4337 		memcpy(ptr, &datalen, 4); ptr += 4;
4338 
4339 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4340 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4341 
4342 }
4343 
glPointSizePointerData_enc(void * self,GLenum type,GLsizei stride,void * data,GLuint datalen)4344 void glPointSizePointerData_enc(void *self , GLenum type, GLsizei stride, void* data, GLuint datalen)
4345 {
4346 
4347 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4348 	IOStream *stream = ctx->m_stream;
4349 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4350 	bool useChecksum = checksumCalculator->getVersion() > 0;
4351 
4352 	const unsigned int __size_data =  datalen;
4353 	 unsigned char *ptr;
4354 	 unsigned char *buf;
4355 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_data + 4 + 1*4;
4356 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4357 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4358 	buf = stream->alloc(totalSize);
4359 	ptr = buf;
4360 	int tmp = OP_glPointSizePointerData;memcpy(ptr, &tmp, 4); ptr += 4;
4361 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4362 
4363 		memcpy(ptr, &type, 4); ptr += 4;
4364 		memcpy(ptr, &stride, 4); ptr += 4;
4365 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
4366 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, 1, type, stride, datalen);ptr += __size_data;
4367 		memcpy(ptr, &datalen, 4); ptr += 4;
4368 
4369 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4370 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4371 
4372 }
4373 
glWeightPointerData_enc(void * self,GLint size,GLenum type,GLsizei stride,void * data,GLuint datalen)4374 void glWeightPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
4375 {
4376 
4377 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4378 	IOStream *stream = ctx->m_stream;
4379 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4380 	bool useChecksum = checksumCalculator->getVersion() > 0;
4381 
4382 	const unsigned int __size_data =  datalen;
4383 	 unsigned char *ptr;
4384 	 unsigned char *buf;
4385 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
4386 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4387 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4388 	buf = stream->alloc(totalSize);
4389 	ptr = buf;
4390 	int tmp = OP_glWeightPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
4391 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4392 
4393 		memcpy(ptr, &size, 4); ptr += 4;
4394 		memcpy(ptr, &type, 4); ptr += 4;
4395 		memcpy(ptr, &stride, 4); ptr += 4;
4396 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
4397 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen);ptr += __size_data;
4398 		memcpy(ptr, &datalen, 4); ptr += 4;
4399 
4400 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4401 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4402 
4403 }
4404 
glMatrixIndexPointerData_enc(void * self,GLint size,GLenum type,GLsizei stride,void * data,GLuint datalen)4405 void glMatrixIndexPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
4406 {
4407 
4408 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4409 	IOStream *stream = ctx->m_stream;
4410 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4411 	bool useChecksum = checksumCalculator->getVersion() > 0;
4412 
4413 	const unsigned int __size_data =  datalen;
4414 	 unsigned char *ptr;
4415 	 unsigned char *buf;
4416 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
4417 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4418 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4419 	buf = stream->alloc(totalSize);
4420 	ptr = buf;
4421 	int tmp = OP_glMatrixIndexPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
4422 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4423 
4424 		memcpy(ptr, &size, 4); ptr += 4;
4425 		memcpy(ptr, &type, 4); ptr += 4;
4426 		memcpy(ptr, &stride, 4); ptr += 4;
4427 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
4428 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen);ptr += __size_data;
4429 		memcpy(ptr, &datalen, 4); ptr += 4;
4430 
4431 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4432 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4433 
4434 }
4435 
glDrawElementsOffset_enc(void * self,GLenum mode,GLsizei count,GLenum type,GLuint offset)4436 void glDrawElementsOffset_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset)
4437 {
4438 
4439 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4440 	IOStream *stream = ctx->m_stream;
4441 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4442 	bool useChecksum = checksumCalculator->getVersion() > 0;
4443 
4444 	 unsigned char *ptr;
4445 	 unsigned char *buf;
4446 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
4447 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4448 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4449 	buf = stream->alloc(totalSize);
4450 	ptr = buf;
4451 	int tmp = OP_glDrawElementsOffset;memcpy(ptr, &tmp, 4); ptr += 4;
4452 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4453 
4454 		memcpy(ptr, &mode, 4); ptr += 4;
4455 		memcpy(ptr, &count, 4); ptr += 4;
4456 		memcpy(ptr, &type, 4); ptr += 4;
4457 		memcpy(ptr, &offset, 4); ptr += 4;
4458 
4459 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4460 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4461 
4462 }
4463 
glDrawElementsData_enc(void * self,GLenum mode,GLsizei count,GLenum type,void * data,GLuint datalen)4464 void glDrawElementsData_enc(void *self , GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
4465 {
4466 
4467 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4468 	IOStream *stream = ctx->m_stream;
4469 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4470 	bool useChecksum = checksumCalculator->getVersion() > 0;
4471 
4472 	const unsigned int __size_data =  datalen;
4473 	 unsigned char *ptr;
4474 	 unsigned char *buf;
4475 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
4476 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4477 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4478 	buf = stream->alloc(totalSize);
4479 	ptr = buf;
4480 	int tmp = OP_glDrawElementsData;memcpy(ptr, &tmp, 4); ptr += 4;
4481 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4482 
4483 		memcpy(ptr, &mode, 4); ptr += 4;
4484 		memcpy(ptr, &count, 4); ptr += 4;
4485 		memcpy(ptr, &type, 4); ptr += 4;
4486 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
4487 	memcpy(ptr, data, __size_data);ptr += __size_data;
4488 		memcpy(ptr, &datalen, 4); ptr += 4;
4489 
4490 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4491 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4492 
4493 }
4494 
glGetCompressedTextureFormats_enc(void * self,int count,GLint * formats)4495 void glGetCompressedTextureFormats_enc(void *self , int count, GLint* formats)
4496 {
4497 
4498 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4499 	IOStream *stream = ctx->m_stream;
4500 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4501 	bool useChecksum = checksumCalculator->getVersion() > 0;
4502 
4503 	const unsigned int __size_formats =  (count * sizeof(GLint));
4504 	 unsigned char *ptr;
4505 	 unsigned char *buf;
4506 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
4507 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4508 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4509 	buf = stream->alloc(totalSize);
4510 	ptr = buf;
4511 	int tmp = OP_glGetCompressedTextureFormats;memcpy(ptr, &tmp, 4); ptr += 4;
4512 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4513 
4514 		memcpy(ptr, &count, 4); ptr += 4;
4515 	*(unsigned int *)(ptr) = __size_formats; ptr += 4;
4516 
4517 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4518 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4519 
4520 	stream->readback(formats, __size_formats);
4521 	if (useChecksum) checksumCalculator->addBuffer(formats, __size_formats);
4522 	if (useChecksum) {
4523 		unsigned char *checksumBufPtr = NULL;
4524 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
4525 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
4526 		stream->readback(checksumBufPtr, checksumSize);
4527 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
4528 			ALOGE("glGetCompressedTextureFormats: GL communication error, please report this issue to b.android.com.\n");
4529 			abort();
4530 		}
4531 	}
4532 }
4533 
glFinishRoundTrip_enc(void * self)4534 int glFinishRoundTrip_enc(void *self )
4535 {
4536 
4537 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4538 	IOStream *stream = ctx->m_stream;
4539 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4540 	bool useChecksum = checksumCalculator->getVersion() > 0;
4541 
4542 	 unsigned char *ptr;
4543 	 unsigned char *buf;
4544 	 const size_t sizeWithoutChecksum = 8;
4545 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4546 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4547 	buf = stream->alloc(totalSize);
4548 	ptr = buf;
4549 	int tmp = OP_glFinishRoundTrip;memcpy(ptr, &tmp, 4); ptr += 4;
4550 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4551 
4552 
4553 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4554 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4555 
4556 
4557 	int retval;
4558 	stream->readback(&retval, 4);
4559 	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
4560 	if (useChecksum) {
4561 		unsigned char *checksumBufPtr = NULL;
4562 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
4563 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
4564 		stream->readback(checksumBufPtr, checksumSize);
4565 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
4566 			ALOGE("glFinishRoundTrip: GL communication error, please report this issue to b.android.com.\n");
4567 			abort();
4568 		}
4569 	}
4570 	return retval;
4571 }
4572 
glBlendEquationSeparateOES_enc(void * self,GLenum modeRGB,GLenum modeAlpha)4573 void glBlendEquationSeparateOES_enc(void *self , GLenum modeRGB, GLenum modeAlpha)
4574 {
4575 
4576 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4577 	IOStream *stream = ctx->m_stream;
4578 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4579 	bool useChecksum = checksumCalculator->getVersion() > 0;
4580 
4581 	 unsigned char *ptr;
4582 	 unsigned char *buf;
4583 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
4584 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4585 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4586 	buf = stream->alloc(totalSize);
4587 	ptr = buf;
4588 	int tmp = OP_glBlendEquationSeparateOES;memcpy(ptr, &tmp, 4); ptr += 4;
4589 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4590 
4591 		memcpy(ptr, &modeRGB, 4); ptr += 4;
4592 		memcpy(ptr, &modeAlpha, 4); ptr += 4;
4593 
4594 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4595 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4596 
4597 }
4598 
glBlendFuncSeparateOES_enc(void * self,GLenum srcRGB,GLenum dstRGB,GLenum srcAlpha,GLenum dstAlpha)4599 void glBlendFuncSeparateOES_enc(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
4600 {
4601 
4602 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4603 	IOStream *stream = ctx->m_stream;
4604 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4605 	bool useChecksum = checksumCalculator->getVersion() > 0;
4606 
4607 	 unsigned char *ptr;
4608 	 unsigned char *buf;
4609 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
4610 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4611 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4612 	buf = stream->alloc(totalSize);
4613 	ptr = buf;
4614 	int tmp = OP_glBlendFuncSeparateOES;memcpy(ptr, &tmp, 4); ptr += 4;
4615 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4616 
4617 		memcpy(ptr, &srcRGB, 4); ptr += 4;
4618 		memcpy(ptr, &dstRGB, 4); ptr += 4;
4619 		memcpy(ptr, &srcAlpha, 4); ptr += 4;
4620 		memcpy(ptr, &dstAlpha, 4); ptr += 4;
4621 
4622 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4623 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4624 
4625 }
4626 
glBlendEquationOES_enc(void * self,GLenum mode)4627 void glBlendEquationOES_enc(void *self , GLenum mode)
4628 {
4629 
4630 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4631 	IOStream *stream = ctx->m_stream;
4632 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4633 	bool useChecksum = checksumCalculator->getVersion() > 0;
4634 
4635 	 unsigned char *ptr;
4636 	 unsigned char *buf;
4637 	 const size_t sizeWithoutChecksum = 8 + 4;
4638 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4639 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4640 	buf = stream->alloc(totalSize);
4641 	ptr = buf;
4642 	int tmp = OP_glBlendEquationOES;memcpy(ptr, &tmp, 4); ptr += 4;
4643 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4644 
4645 		memcpy(ptr, &mode, 4); ptr += 4;
4646 
4647 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4648 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4649 
4650 }
4651 
glDrawTexsOES_enc(void * self,GLshort x,GLshort y,GLshort z,GLshort width,GLshort height)4652 void glDrawTexsOES_enc(void *self , GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
4653 {
4654 
4655 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4656 	IOStream *stream = ctx->m_stream;
4657 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4658 	bool useChecksum = checksumCalculator->getVersion() > 0;
4659 
4660 	 unsigned char *ptr;
4661 	 unsigned char *buf;
4662 	 const size_t sizeWithoutChecksum = 8 + 2 + 2 + 2 + 2 + 2;
4663 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4664 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4665 	buf = stream->alloc(totalSize);
4666 	ptr = buf;
4667 	int tmp = OP_glDrawTexsOES;memcpy(ptr, &tmp, 4); ptr += 4;
4668 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4669 
4670 		memcpy(ptr, &x, 2); ptr += 2;
4671 		memcpy(ptr, &y, 2); ptr += 2;
4672 		memcpy(ptr, &z, 2); ptr += 2;
4673 		memcpy(ptr, &width, 2); ptr += 2;
4674 		memcpy(ptr, &height, 2); ptr += 2;
4675 
4676 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4677 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4678 
4679 }
4680 
glDrawTexiOES_enc(void * self,GLint x,GLint y,GLint z,GLint width,GLint height)4681 void glDrawTexiOES_enc(void *self , GLint x, GLint y, GLint z, GLint width, GLint height)
4682 {
4683 
4684 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4685 	IOStream *stream = ctx->m_stream;
4686 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4687 	bool useChecksum = checksumCalculator->getVersion() > 0;
4688 
4689 	 unsigned char *ptr;
4690 	 unsigned char *buf;
4691 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
4692 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4693 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4694 	buf = stream->alloc(totalSize);
4695 	ptr = buf;
4696 	int tmp = OP_glDrawTexiOES;memcpy(ptr, &tmp, 4); ptr += 4;
4697 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4698 
4699 		memcpy(ptr, &x, 4); ptr += 4;
4700 		memcpy(ptr, &y, 4); ptr += 4;
4701 		memcpy(ptr, &z, 4); ptr += 4;
4702 		memcpy(ptr, &width, 4); ptr += 4;
4703 		memcpy(ptr, &height, 4); ptr += 4;
4704 
4705 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4706 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4707 
4708 }
4709 
glDrawTexxOES_enc(void * self,GLfixed x,GLfixed y,GLfixed z,GLfixed width,GLfixed height)4710 void glDrawTexxOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
4711 {
4712 
4713 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4714 	IOStream *stream = ctx->m_stream;
4715 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4716 	bool useChecksum = checksumCalculator->getVersion() > 0;
4717 
4718 	 unsigned char *ptr;
4719 	 unsigned char *buf;
4720 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
4721 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4722 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4723 	buf = stream->alloc(totalSize);
4724 	ptr = buf;
4725 	int tmp = OP_glDrawTexxOES;memcpy(ptr, &tmp, 4); ptr += 4;
4726 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4727 
4728 		memcpy(ptr, &x, 4); ptr += 4;
4729 		memcpy(ptr, &y, 4); ptr += 4;
4730 		memcpy(ptr, &z, 4); ptr += 4;
4731 		memcpy(ptr, &width, 4); ptr += 4;
4732 		memcpy(ptr, &height, 4); ptr += 4;
4733 
4734 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4735 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4736 
4737 }
4738 
glDrawTexsvOES_enc(void * self,const GLshort * coords)4739 void glDrawTexsvOES_enc(void *self , const GLshort* coords)
4740 {
4741 
4742 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4743 	IOStream *stream = ctx->m_stream;
4744 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4745 	bool useChecksum = checksumCalculator->getVersion() > 0;
4746 
4747 	const unsigned int __size_coords =  (5 * sizeof(GLshort));
4748 	 unsigned char *ptr;
4749 	 unsigned char *buf;
4750 	 const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
4751 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4752 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4753 	buf = stream->alloc(totalSize);
4754 	ptr = buf;
4755 	int tmp = OP_glDrawTexsvOES;memcpy(ptr, &tmp, 4); ptr += 4;
4756 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4757 
4758 	*(unsigned int *)(ptr) = __size_coords; ptr += 4;
4759 	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
4760 
4761 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4762 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4763 
4764 }
4765 
glDrawTexivOES_enc(void * self,const GLint * coords)4766 void glDrawTexivOES_enc(void *self , const GLint* coords)
4767 {
4768 
4769 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4770 	IOStream *stream = ctx->m_stream;
4771 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4772 	bool useChecksum = checksumCalculator->getVersion() > 0;
4773 
4774 	const unsigned int __size_coords =  (5 * sizeof(GLint));
4775 	 unsigned char *ptr;
4776 	 unsigned char *buf;
4777 	 const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
4778 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4779 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4780 	buf = stream->alloc(totalSize);
4781 	ptr = buf;
4782 	int tmp = OP_glDrawTexivOES;memcpy(ptr, &tmp, 4); ptr += 4;
4783 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4784 
4785 	*(unsigned int *)(ptr) = __size_coords; ptr += 4;
4786 	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
4787 
4788 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4789 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4790 
4791 }
4792 
glDrawTexxvOES_enc(void * self,const GLfixed * coords)4793 void glDrawTexxvOES_enc(void *self , const GLfixed* coords)
4794 {
4795 
4796 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4797 	IOStream *stream = ctx->m_stream;
4798 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4799 	bool useChecksum = checksumCalculator->getVersion() > 0;
4800 
4801 	const unsigned int __size_coords =  (5 * sizeof(GLfixed));
4802 	 unsigned char *ptr;
4803 	 unsigned char *buf;
4804 	 const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
4805 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4806 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4807 	buf = stream->alloc(totalSize);
4808 	ptr = buf;
4809 	int tmp = OP_glDrawTexxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
4810 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4811 
4812 	*(unsigned int *)(ptr) = __size_coords; ptr += 4;
4813 	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
4814 
4815 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4816 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4817 
4818 }
4819 
glDrawTexfOES_enc(void * self,GLfloat x,GLfloat y,GLfloat z,GLfloat width,GLfloat height)4820 void glDrawTexfOES_enc(void *self , GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
4821 {
4822 
4823 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4824 	IOStream *stream = ctx->m_stream;
4825 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4826 	bool useChecksum = checksumCalculator->getVersion() > 0;
4827 
4828 	 unsigned char *ptr;
4829 	 unsigned char *buf;
4830 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
4831 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4832 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4833 	buf = stream->alloc(totalSize);
4834 	ptr = buf;
4835 	int tmp = OP_glDrawTexfOES;memcpy(ptr, &tmp, 4); ptr += 4;
4836 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4837 
4838 		memcpy(ptr, &x, 4); ptr += 4;
4839 		memcpy(ptr, &y, 4); ptr += 4;
4840 		memcpy(ptr, &z, 4); ptr += 4;
4841 		memcpy(ptr, &width, 4); ptr += 4;
4842 		memcpy(ptr, &height, 4); ptr += 4;
4843 
4844 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4845 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4846 
4847 }
4848 
glDrawTexfvOES_enc(void * self,const GLfloat * coords)4849 void glDrawTexfvOES_enc(void *self , const GLfloat* coords)
4850 {
4851 
4852 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4853 	IOStream *stream = ctx->m_stream;
4854 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4855 	bool useChecksum = checksumCalculator->getVersion() > 0;
4856 
4857 	const unsigned int __size_coords =  (5 * sizeof(GLfloat));
4858 	 unsigned char *ptr;
4859 	 unsigned char *buf;
4860 	 const size_t sizeWithoutChecksum = 8 + __size_coords + 1*4;
4861 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4862 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4863 	buf = stream->alloc(totalSize);
4864 	ptr = buf;
4865 	int tmp = OP_glDrawTexfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
4866 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4867 
4868 	*(unsigned int *)(ptr) = __size_coords; ptr += 4;
4869 	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
4870 
4871 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4872 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4873 
4874 }
4875 
glEGLImageTargetTexture2DOES_enc(void * self,GLenum target,GLeglImageOES image)4876 void glEGLImageTargetTexture2DOES_enc(void *self , GLenum target, GLeglImageOES image)
4877 {
4878 
4879 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4880 	IOStream *stream = ctx->m_stream;
4881 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4882 	bool useChecksum = checksumCalculator->getVersion() > 0;
4883 
4884 	 unsigned char *ptr;
4885 	 unsigned char *buf;
4886 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
4887 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4888 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4889 	buf = stream->alloc(totalSize);
4890 	ptr = buf;
4891 	int tmp = OP_glEGLImageTargetTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
4892 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4893 
4894 		memcpy(ptr, &target, 4); ptr += 4;
4895 		memcpy(ptr, &image, 4); ptr += 4;
4896 
4897 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4898 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4899 
4900 }
4901 
glEGLImageTargetRenderbufferStorageOES_enc(void * self,GLenum target,GLeglImageOES image)4902 void glEGLImageTargetRenderbufferStorageOES_enc(void *self , GLenum target, GLeglImageOES image)
4903 {
4904 
4905 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4906 	IOStream *stream = ctx->m_stream;
4907 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4908 	bool useChecksum = checksumCalculator->getVersion() > 0;
4909 
4910 	 unsigned char *ptr;
4911 	 unsigned char *buf;
4912 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
4913 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4914 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4915 	buf = stream->alloc(totalSize);
4916 	ptr = buf;
4917 	int tmp = OP_glEGLImageTargetRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
4918 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4919 
4920 		memcpy(ptr, &target, 4); ptr += 4;
4921 		memcpy(ptr, &image, 4); ptr += 4;
4922 
4923 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4924 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4925 
4926 }
4927 
glAlphaFuncxOES_enc(void * self,GLenum func,GLclampx ref)4928 void glAlphaFuncxOES_enc(void *self , GLenum func, GLclampx ref)
4929 {
4930 
4931 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4932 	IOStream *stream = ctx->m_stream;
4933 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4934 	bool useChecksum = checksumCalculator->getVersion() > 0;
4935 
4936 	 unsigned char *ptr;
4937 	 unsigned char *buf;
4938 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
4939 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4940 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4941 	buf = stream->alloc(totalSize);
4942 	ptr = buf;
4943 	int tmp = OP_glAlphaFuncxOES;memcpy(ptr, &tmp, 4); ptr += 4;
4944 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4945 
4946 		memcpy(ptr, &func, 4); ptr += 4;
4947 		memcpy(ptr, &ref, 4); ptr += 4;
4948 
4949 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4950 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4951 
4952 }
4953 
glClearColorxOES_enc(void * self,GLclampx red,GLclampx green,GLclampx blue,GLclampx alpha)4954 void glClearColorxOES_enc(void *self , GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
4955 {
4956 
4957 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4958 	IOStream *stream = ctx->m_stream;
4959 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4960 	bool useChecksum = checksumCalculator->getVersion() > 0;
4961 
4962 	 unsigned char *ptr;
4963 	 unsigned char *buf;
4964 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
4965 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4966 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4967 	buf = stream->alloc(totalSize);
4968 	ptr = buf;
4969 	int tmp = OP_glClearColorxOES;memcpy(ptr, &tmp, 4); ptr += 4;
4970 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4971 
4972 		memcpy(ptr, &red, 4); ptr += 4;
4973 		memcpy(ptr, &green, 4); ptr += 4;
4974 		memcpy(ptr, &blue, 4); ptr += 4;
4975 		memcpy(ptr, &alpha, 4); ptr += 4;
4976 
4977 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
4978 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
4979 
4980 }
4981 
glClearDepthxOES_enc(void * self,GLclampx depth)4982 void glClearDepthxOES_enc(void *self , GLclampx depth)
4983 {
4984 
4985 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4986 	IOStream *stream = ctx->m_stream;
4987 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
4988 	bool useChecksum = checksumCalculator->getVersion() > 0;
4989 
4990 	 unsigned char *ptr;
4991 	 unsigned char *buf;
4992 	 const size_t sizeWithoutChecksum = 8 + 4;
4993 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
4994 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
4995 	buf = stream->alloc(totalSize);
4996 	ptr = buf;
4997 	int tmp = OP_glClearDepthxOES;memcpy(ptr, &tmp, 4); ptr += 4;
4998 	memcpy(ptr, &totalSize, 4);  ptr += 4;
4999 
5000 		memcpy(ptr, &depth, 4); ptr += 4;
5001 
5002 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5003 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5004 
5005 }
5006 
glClipPlanexOES_enc(void * self,GLenum plane,const GLfixed * equation)5007 void glClipPlanexOES_enc(void *self , GLenum plane, const GLfixed* equation)
5008 {
5009 
5010 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5011 	IOStream *stream = ctx->m_stream;
5012 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5013 	bool useChecksum = checksumCalculator->getVersion() > 0;
5014 
5015 	const unsigned int __size_equation =  (4 * sizeof(GLfixed));
5016 	 unsigned char *ptr;
5017 	 unsigned char *buf;
5018 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
5019 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5020 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5021 	buf = stream->alloc(totalSize);
5022 	ptr = buf;
5023 	int tmp = OP_glClipPlanexOES;memcpy(ptr, &tmp, 4); ptr += 4;
5024 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5025 
5026 		memcpy(ptr, &plane, 4); ptr += 4;
5027 	*(unsigned int *)(ptr) = __size_equation; ptr += 4;
5028 	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
5029 
5030 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5031 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5032 
5033 }
5034 
glClipPlanexIMG_enc(void * self,GLenum plane,const GLfixed * equation)5035 void glClipPlanexIMG_enc(void *self , GLenum plane, const GLfixed* equation)
5036 {
5037 
5038 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5039 	IOStream *stream = ctx->m_stream;
5040 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5041 	bool useChecksum = checksumCalculator->getVersion() > 0;
5042 
5043 	const unsigned int __size_equation =  (4 * sizeof(GLfixed));
5044 	 unsigned char *ptr;
5045 	 unsigned char *buf;
5046 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
5047 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5048 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5049 	buf = stream->alloc(totalSize);
5050 	ptr = buf;
5051 	int tmp = OP_glClipPlanexIMG;memcpy(ptr, &tmp, 4); ptr += 4;
5052 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5053 
5054 		memcpy(ptr, &plane, 4); ptr += 4;
5055 	*(unsigned int *)(ptr) = __size_equation; ptr += 4;
5056 	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
5057 
5058 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5059 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5060 
5061 }
5062 
glColor4xOES_enc(void * self,GLfixed red,GLfixed green,GLfixed blue,GLfixed alpha)5063 void glColor4xOES_enc(void *self , GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
5064 {
5065 
5066 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5067 	IOStream *stream = ctx->m_stream;
5068 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5069 	bool useChecksum = checksumCalculator->getVersion() > 0;
5070 
5071 	 unsigned char *ptr;
5072 	 unsigned char *buf;
5073 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
5074 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5075 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5076 	buf = stream->alloc(totalSize);
5077 	ptr = buf;
5078 	int tmp = OP_glColor4xOES;memcpy(ptr, &tmp, 4); ptr += 4;
5079 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5080 
5081 		memcpy(ptr, &red, 4); ptr += 4;
5082 		memcpy(ptr, &green, 4); ptr += 4;
5083 		memcpy(ptr, &blue, 4); ptr += 4;
5084 		memcpy(ptr, &alpha, 4); ptr += 4;
5085 
5086 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5087 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5088 
5089 }
5090 
glDepthRangexOES_enc(void * self,GLclampx zNear,GLclampx zFar)5091 void glDepthRangexOES_enc(void *self , GLclampx zNear, GLclampx zFar)
5092 {
5093 
5094 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5095 	IOStream *stream = ctx->m_stream;
5096 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5097 	bool useChecksum = checksumCalculator->getVersion() > 0;
5098 
5099 	 unsigned char *ptr;
5100 	 unsigned char *buf;
5101 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
5102 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5103 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5104 	buf = stream->alloc(totalSize);
5105 	ptr = buf;
5106 	int tmp = OP_glDepthRangexOES;memcpy(ptr, &tmp, 4); ptr += 4;
5107 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5108 
5109 		memcpy(ptr, &zNear, 4); ptr += 4;
5110 		memcpy(ptr, &zFar, 4); ptr += 4;
5111 
5112 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5113 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5114 
5115 }
5116 
glFogxOES_enc(void * self,GLenum pname,GLfixed param)5117 void glFogxOES_enc(void *self , GLenum pname, GLfixed param)
5118 {
5119 
5120 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5121 	IOStream *stream = ctx->m_stream;
5122 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5123 	bool useChecksum = checksumCalculator->getVersion() > 0;
5124 
5125 	 unsigned char *ptr;
5126 	 unsigned char *buf;
5127 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
5128 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5129 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5130 	buf = stream->alloc(totalSize);
5131 	ptr = buf;
5132 	int tmp = OP_glFogxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5133 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5134 
5135 		memcpy(ptr, &pname, 4); ptr += 4;
5136 		memcpy(ptr, &param, 4); ptr += 4;
5137 
5138 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5139 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5140 
5141 }
5142 
glFogxvOES_enc(void * self,GLenum pname,const GLfixed * params)5143 void glFogxvOES_enc(void *self , GLenum pname, const GLfixed* params)
5144 {
5145 
5146 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5147 	IOStream *stream = ctx->m_stream;
5148 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5149 	bool useChecksum = checksumCalculator->getVersion() > 0;
5150 
5151 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
5152 	 unsigned char *ptr;
5153 	 unsigned char *buf;
5154 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
5155 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5156 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5157 	buf = stream->alloc(totalSize);
5158 	ptr = buf;
5159 	int tmp = OP_glFogxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
5160 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5161 
5162 		memcpy(ptr, &pname, 4); ptr += 4;
5163 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
5164 	memcpy(ptr, params, __size_params);ptr += __size_params;
5165 
5166 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5167 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5168 
5169 }
5170 
glFrustumxOES_enc(void * self,GLfixed left,GLfixed right,GLfixed bottom,GLfixed top,GLfixed zNear,GLfixed zFar)5171 void glFrustumxOES_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
5172 {
5173 
5174 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5175 	IOStream *stream = ctx->m_stream;
5176 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5177 	bool useChecksum = checksumCalculator->getVersion() > 0;
5178 
5179 	 unsigned char *ptr;
5180 	 unsigned char *buf;
5181 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
5182 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5183 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5184 	buf = stream->alloc(totalSize);
5185 	ptr = buf;
5186 	int tmp = OP_glFrustumxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5187 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5188 
5189 		memcpy(ptr, &left, 4); ptr += 4;
5190 		memcpy(ptr, &right, 4); ptr += 4;
5191 		memcpy(ptr, &bottom, 4); ptr += 4;
5192 		memcpy(ptr, &top, 4); ptr += 4;
5193 		memcpy(ptr, &zNear, 4); ptr += 4;
5194 		memcpy(ptr, &zFar, 4); ptr += 4;
5195 
5196 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5197 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5198 
5199 }
5200 
glGetClipPlanexOES_enc(void * self,GLenum pname,GLfixed * eqn)5201 void glGetClipPlanexOES_enc(void *self , GLenum pname, GLfixed* eqn)
5202 {
5203 
5204 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5205 	IOStream *stream = ctx->m_stream;
5206 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5207 	bool useChecksum = checksumCalculator->getVersion() > 0;
5208 
5209 	const unsigned int __size_eqn =  (4 * sizeof(GLfixed));
5210 	 unsigned char *ptr;
5211 	 unsigned char *buf;
5212 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
5213 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5214 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5215 	buf = stream->alloc(totalSize);
5216 	ptr = buf;
5217 	int tmp = OP_glGetClipPlanexOES;memcpy(ptr, &tmp, 4); ptr += 4;
5218 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5219 
5220 		memcpy(ptr, &pname, 4); ptr += 4;
5221 	*(unsigned int *)(ptr) = __size_eqn; ptr += 4;
5222 
5223 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5224 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5225 
5226 	stream->readback(eqn, __size_eqn);
5227 	if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
5228 	if (useChecksum) {
5229 		unsigned char *checksumBufPtr = NULL;
5230 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
5231 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
5232 		stream->readback(checksumBufPtr, checksumSize);
5233 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
5234 			ALOGE("glGetClipPlanexOES: GL communication error, please report this issue to b.android.com.\n");
5235 			abort();
5236 		}
5237 	}
5238 }
5239 
glGetClipPlanex_enc(void * self,GLenum pname,GLfixed * eqn)5240 void glGetClipPlanex_enc(void *self , GLenum pname, GLfixed* eqn)
5241 {
5242 
5243 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5244 	IOStream *stream = ctx->m_stream;
5245 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5246 	bool useChecksum = checksumCalculator->getVersion() > 0;
5247 
5248 	const unsigned int __size_eqn =  (4 * sizeof(GLfixed));
5249 	 unsigned char *ptr;
5250 	 unsigned char *buf;
5251 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
5252 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5253 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5254 	buf = stream->alloc(totalSize);
5255 	ptr = buf;
5256 	int tmp = OP_glGetClipPlanex;memcpy(ptr, &tmp, 4); ptr += 4;
5257 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5258 
5259 		memcpy(ptr, &pname, 4); ptr += 4;
5260 	*(unsigned int *)(ptr) = __size_eqn; ptr += 4;
5261 
5262 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5263 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5264 
5265 	stream->readback(eqn, __size_eqn);
5266 	if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
5267 	if (useChecksum) {
5268 		unsigned char *checksumBufPtr = NULL;
5269 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
5270 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
5271 		stream->readback(checksumBufPtr, checksumSize);
5272 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
5273 			ALOGE("glGetClipPlanex: GL communication error, please report this issue to b.android.com.\n");
5274 			abort();
5275 		}
5276 	}
5277 }
5278 
glGetFixedvOES_enc(void * self,GLenum pname,GLfixed * params)5279 void glGetFixedvOES_enc(void *self , GLenum pname, GLfixed* params)
5280 {
5281 
5282 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5283 	IOStream *stream = ctx->m_stream;
5284 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5285 	bool useChecksum = checksumCalculator->getVersion() > 0;
5286 
5287 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
5288 	 unsigned char *ptr;
5289 	 unsigned char *buf;
5290 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
5291 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5292 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5293 	buf = stream->alloc(totalSize);
5294 	ptr = buf;
5295 	int tmp = OP_glGetFixedvOES;memcpy(ptr, &tmp, 4); ptr += 4;
5296 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5297 
5298 		memcpy(ptr, &pname, 4); ptr += 4;
5299 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
5300 
5301 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5302 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5303 
5304 	stream->readback(params, __size_params);
5305 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
5306 	if (useChecksum) {
5307 		unsigned char *checksumBufPtr = NULL;
5308 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
5309 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
5310 		stream->readback(checksumBufPtr, checksumSize);
5311 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
5312 			ALOGE("glGetFixedvOES: GL communication error, please report this issue to b.android.com.\n");
5313 			abort();
5314 		}
5315 	}
5316 }
5317 
glGetLightxvOES_enc(void * self,GLenum light,GLenum pname,GLfixed * params)5318 void glGetLightxvOES_enc(void *self , GLenum light, GLenum pname, GLfixed* params)
5319 {
5320 
5321 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5322 	IOStream *stream = ctx->m_stream;
5323 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5324 	bool useChecksum = checksumCalculator->getVersion() > 0;
5325 
5326 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
5327 	 unsigned char *ptr;
5328 	 unsigned char *buf;
5329 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
5330 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5331 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5332 	buf = stream->alloc(totalSize);
5333 	ptr = buf;
5334 	int tmp = OP_glGetLightxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
5335 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5336 
5337 		memcpy(ptr, &light, 4); ptr += 4;
5338 		memcpy(ptr, &pname, 4); ptr += 4;
5339 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
5340 
5341 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5342 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5343 
5344 	stream->readback(params, __size_params);
5345 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
5346 	if (useChecksum) {
5347 		unsigned char *checksumBufPtr = NULL;
5348 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
5349 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
5350 		stream->readback(checksumBufPtr, checksumSize);
5351 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
5352 			ALOGE("glGetLightxvOES: GL communication error, please report this issue to b.android.com.\n");
5353 			abort();
5354 		}
5355 	}
5356 }
5357 
glGetMaterialxvOES_enc(void * self,GLenum face,GLenum pname,GLfixed * params)5358 void glGetMaterialxvOES_enc(void *self , GLenum face, GLenum pname, GLfixed* params)
5359 {
5360 
5361 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5362 	IOStream *stream = ctx->m_stream;
5363 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5364 	bool useChecksum = checksumCalculator->getVersion() > 0;
5365 
5366 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
5367 	 unsigned char *ptr;
5368 	 unsigned char *buf;
5369 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
5370 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5371 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5372 	buf = stream->alloc(totalSize);
5373 	ptr = buf;
5374 	int tmp = OP_glGetMaterialxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
5375 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5376 
5377 		memcpy(ptr, &face, 4); ptr += 4;
5378 		memcpy(ptr, &pname, 4); ptr += 4;
5379 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
5380 
5381 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5382 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5383 
5384 	stream->readback(params, __size_params);
5385 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
5386 	if (useChecksum) {
5387 		unsigned char *checksumBufPtr = NULL;
5388 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
5389 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
5390 		stream->readback(checksumBufPtr, checksumSize);
5391 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
5392 			ALOGE("glGetMaterialxvOES: GL communication error, please report this issue to b.android.com.\n");
5393 			abort();
5394 		}
5395 	}
5396 }
5397 
glGetTexEnvxvOES_enc(void * self,GLenum env,GLenum pname,GLfixed * params)5398 void glGetTexEnvxvOES_enc(void *self , GLenum env, GLenum pname, GLfixed* params)
5399 {
5400 
5401 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5402 	IOStream *stream = ctx->m_stream;
5403 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5404 	bool useChecksum = checksumCalculator->getVersion() > 0;
5405 
5406 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
5407 	 unsigned char *ptr;
5408 	 unsigned char *buf;
5409 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
5410 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5411 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5412 	buf = stream->alloc(totalSize);
5413 	ptr = buf;
5414 	int tmp = OP_glGetTexEnvxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
5415 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5416 
5417 		memcpy(ptr, &env, 4); ptr += 4;
5418 		memcpy(ptr, &pname, 4); ptr += 4;
5419 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
5420 
5421 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5422 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5423 
5424 	stream->readback(params, __size_params);
5425 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
5426 	if (useChecksum) {
5427 		unsigned char *checksumBufPtr = NULL;
5428 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
5429 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
5430 		stream->readback(checksumBufPtr, checksumSize);
5431 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
5432 			ALOGE("glGetTexEnvxvOES: GL communication error, please report this issue to b.android.com.\n");
5433 			abort();
5434 		}
5435 	}
5436 }
5437 
glGetTexParameterxvOES_enc(void * self,GLenum target,GLenum pname,GLfixed * params)5438 void glGetTexParameterxvOES_enc(void *self , GLenum target, GLenum pname, GLfixed* params)
5439 {
5440 
5441 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5442 	IOStream *stream = ctx->m_stream;
5443 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5444 	bool useChecksum = checksumCalculator->getVersion() > 0;
5445 
5446 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
5447 	 unsigned char *ptr;
5448 	 unsigned char *buf;
5449 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
5450 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5451 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5452 	buf = stream->alloc(totalSize);
5453 	ptr = buf;
5454 	int tmp = OP_glGetTexParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
5455 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5456 
5457 		memcpy(ptr, &target, 4); ptr += 4;
5458 		memcpy(ptr, &pname, 4); ptr += 4;
5459 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
5460 
5461 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5462 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5463 
5464 	stream->readback(params, __size_params);
5465 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
5466 	if (useChecksum) {
5467 		unsigned char *checksumBufPtr = NULL;
5468 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
5469 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
5470 		stream->readback(checksumBufPtr, checksumSize);
5471 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
5472 			ALOGE("glGetTexParameterxvOES: GL communication error, please report this issue to b.android.com.\n");
5473 			abort();
5474 		}
5475 	}
5476 }
5477 
glLightModelxOES_enc(void * self,GLenum pname,GLfixed param)5478 void glLightModelxOES_enc(void *self , GLenum pname, GLfixed param)
5479 {
5480 
5481 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5482 	IOStream *stream = ctx->m_stream;
5483 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5484 	bool useChecksum = checksumCalculator->getVersion() > 0;
5485 
5486 	 unsigned char *ptr;
5487 	 unsigned char *buf;
5488 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
5489 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5490 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5491 	buf = stream->alloc(totalSize);
5492 	ptr = buf;
5493 	int tmp = OP_glLightModelxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5494 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5495 
5496 		memcpy(ptr, &pname, 4); ptr += 4;
5497 		memcpy(ptr, &param, 4); ptr += 4;
5498 
5499 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5500 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5501 
5502 }
5503 
glLightModelxvOES_enc(void * self,GLenum pname,const GLfixed * params)5504 void glLightModelxvOES_enc(void *self , GLenum pname, const GLfixed* params)
5505 {
5506 
5507 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5508 	IOStream *stream = ctx->m_stream;
5509 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5510 	bool useChecksum = checksumCalculator->getVersion() > 0;
5511 
5512 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
5513 	 unsigned char *ptr;
5514 	 unsigned char *buf;
5515 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
5516 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5517 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5518 	buf = stream->alloc(totalSize);
5519 	ptr = buf;
5520 	int tmp = OP_glLightModelxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
5521 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5522 
5523 		memcpy(ptr, &pname, 4); ptr += 4;
5524 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
5525 	memcpy(ptr, params, __size_params);ptr += __size_params;
5526 
5527 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5528 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5529 
5530 }
5531 
glLightxOES_enc(void * self,GLenum light,GLenum pname,GLfixed param)5532 void glLightxOES_enc(void *self , GLenum light, GLenum pname, GLfixed param)
5533 {
5534 
5535 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5536 	IOStream *stream = ctx->m_stream;
5537 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5538 	bool useChecksum = checksumCalculator->getVersion() > 0;
5539 
5540 	 unsigned char *ptr;
5541 	 unsigned char *buf;
5542 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
5543 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5544 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5545 	buf = stream->alloc(totalSize);
5546 	ptr = buf;
5547 	int tmp = OP_glLightxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5548 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5549 
5550 		memcpy(ptr, &light, 4); ptr += 4;
5551 		memcpy(ptr, &pname, 4); ptr += 4;
5552 		memcpy(ptr, &param, 4); ptr += 4;
5553 
5554 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5555 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5556 
5557 }
5558 
glLightxvOES_enc(void * self,GLenum light,GLenum pname,const GLfixed * params)5559 void glLightxvOES_enc(void *self , GLenum light, GLenum pname, const GLfixed* params)
5560 {
5561 
5562 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5563 	IOStream *stream = ctx->m_stream;
5564 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5565 	bool useChecksum = checksumCalculator->getVersion() > 0;
5566 
5567 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
5568 	 unsigned char *ptr;
5569 	 unsigned char *buf;
5570 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
5571 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5572 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5573 	buf = stream->alloc(totalSize);
5574 	ptr = buf;
5575 	int tmp = OP_glLightxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
5576 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5577 
5578 		memcpy(ptr, &light, 4); ptr += 4;
5579 		memcpy(ptr, &pname, 4); ptr += 4;
5580 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
5581 	memcpy(ptr, params, __size_params);ptr += __size_params;
5582 
5583 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5584 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5585 
5586 }
5587 
glLineWidthxOES_enc(void * self,GLfixed width)5588 void glLineWidthxOES_enc(void *self , GLfixed width)
5589 {
5590 
5591 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5592 	IOStream *stream = ctx->m_stream;
5593 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5594 	bool useChecksum = checksumCalculator->getVersion() > 0;
5595 
5596 	 unsigned char *ptr;
5597 	 unsigned char *buf;
5598 	 const size_t sizeWithoutChecksum = 8 + 4;
5599 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5600 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5601 	buf = stream->alloc(totalSize);
5602 	ptr = buf;
5603 	int tmp = OP_glLineWidthxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5604 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5605 
5606 		memcpy(ptr, &width, 4); ptr += 4;
5607 
5608 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5609 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5610 
5611 }
5612 
glLoadMatrixxOES_enc(void * self,const GLfixed * m)5613 void glLoadMatrixxOES_enc(void *self , const GLfixed* m)
5614 {
5615 
5616 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5617 	IOStream *stream = ctx->m_stream;
5618 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5619 	bool useChecksum = checksumCalculator->getVersion() > 0;
5620 
5621 	const unsigned int __size_m =  (16 * sizeof(GLfixed));
5622 	 unsigned char *ptr;
5623 	 unsigned char *buf;
5624 	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
5625 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5626 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5627 	buf = stream->alloc(totalSize);
5628 	ptr = buf;
5629 	int tmp = OP_glLoadMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5630 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5631 
5632 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
5633 	memcpy(ptr, m, __size_m);ptr += __size_m;
5634 
5635 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5636 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5637 
5638 }
5639 
glMaterialxOES_enc(void * self,GLenum face,GLenum pname,GLfixed param)5640 void glMaterialxOES_enc(void *self , GLenum face, GLenum pname, GLfixed param)
5641 {
5642 
5643 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5644 	IOStream *stream = ctx->m_stream;
5645 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5646 	bool useChecksum = checksumCalculator->getVersion() > 0;
5647 
5648 	 unsigned char *ptr;
5649 	 unsigned char *buf;
5650 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
5651 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5652 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5653 	buf = stream->alloc(totalSize);
5654 	ptr = buf;
5655 	int tmp = OP_glMaterialxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5656 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5657 
5658 		memcpy(ptr, &face, 4); ptr += 4;
5659 		memcpy(ptr, &pname, 4); ptr += 4;
5660 		memcpy(ptr, &param, 4); ptr += 4;
5661 
5662 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5663 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5664 
5665 }
5666 
glMaterialxvOES_enc(void * self,GLenum face,GLenum pname,const GLfixed * params)5667 void glMaterialxvOES_enc(void *self , GLenum face, GLenum pname, const GLfixed* params)
5668 {
5669 
5670 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5671 	IOStream *stream = ctx->m_stream;
5672 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5673 	bool useChecksum = checksumCalculator->getVersion() > 0;
5674 
5675 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
5676 	 unsigned char *ptr;
5677 	 unsigned char *buf;
5678 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
5679 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5680 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5681 	buf = stream->alloc(totalSize);
5682 	ptr = buf;
5683 	int tmp = OP_glMaterialxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
5684 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5685 
5686 		memcpy(ptr, &face, 4); ptr += 4;
5687 		memcpy(ptr, &pname, 4); ptr += 4;
5688 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
5689 	memcpy(ptr, params, __size_params);ptr += __size_params;
5690 
5691 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5692 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5693 
5694 }
5695 
glMultMatrixxOES_enc(void * self,const GLfixed * m)5696 void glMultMatrixxOES_enc(void *self , const GLfixed* m)
5697 {
5698 
5699 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5700 	IOStream *stream = ctx->m_stream;
5701 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5702 	bool useChecksum = checksumCalculator->getVersion() > 0;
5703 
5704 	const unsigned int __size_m =  (16 * sizeof(GLfixed));
5705 	 unsigned char *ptr;
5706 	 unsigned char *buf;
5707 	 const size_t sizeWithoutChecksum = 8 + __size_m + 1*4;
5708 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5709 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5710 	buf = stream->alloc(totalSize);
5711 	ptr = buf;
5712 	int tmp = OP_glMultMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5713 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5714 
5715 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
5716 	memcpy(ptr, m, __size_m);ptr += __size_m;
5717 
5718 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5719 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5720 
5721 }
5722 
glMultiTexCoord4xOES_enc(void * self,GLenum target,GLfixed s,GLfixed t,GLfixed r,GLfixed q)5723 void glMultiTexCoord4xOES_enc(void *self , GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
5724 {
5725 
5726 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5727 	IOStream *stream = ctx->m_stream;
5728 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5729 	bool useChecksum = checksumCalculator->getVersion() > 0;
5730 
5731 	 unsigned char *ptr;
5732 	 unsigned char *buf;
5733 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
5734 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5735 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5736 	buf = stream->alloc(totalSize);
5737 	ptr = buf;
5738 	int tmp = OP_glMultiTexCoord4xOES;memcpy(ptr, &tmp, 4); ptr += 4;
5739 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5740 
5741 		memcpy(ptr, &target, 4); ptr += 4;
5742 		memcpy(ptr, &s, 4); ptr += 4;
5743 		memcpy(ptr, &t, 4); ptr += 4;
5744 		memcpy(ptr, &r, 4); ptr += 4;
5745 		memcpy(ptr, &q, 4); ptr += 4;
5746 
5747 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5748 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5749 
5750 }
5751 
glNormal3xOES_enc(void * self,GLfixed nx,GLfixed ny,GLfixed nz)5752 void glNormal3xOES_enc(void *self , GLfixed nx, GLfixed ny, GLfixed nz)
5753 {
5754 
5755 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5756 	IOStream *stream = ctx->m_stream;
5757 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5758 	bool useChecksum = checksumCalculator->getVersion() > 0;
5759 
5760 	 unsigned char *ptr;
5761 	 unsigned char *buf;
5762 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
5763 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5764 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5765 	buf = stream->alloc(totalSize);
5766 	ptr = buf;
5767 	int tmp = OP_glNormal3xOES;memcpy(ptr, &tmp, 4); ptr += 4;
5768 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5769 
5770 		memcpy(ptr, &nx, 4); ptr += 4;
5771 		memcpy(ptr, &ny, 4); ptr += 4;
5772 		memcpy(ptr, &nz, 4); ptr += 4;
5773 
5774 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5775 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5776 
5777 }
5778 
glOrthoxOES_enc(void * self,GLfixed left,GLfixed right,GLfixed bottom,GLfixed top,GLfixed zNear,GLfixed zFar)5779 void glOrthoxOES_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
5780 {
5781 
5782 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5783 	IOStream *stream = ctx->m_stream;
5784 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5785 	bool useChecksum = checksumCalculator->getVersion() > 0;
5786 
5787 	 unsigned char *ptr;
5788 	 unsigned char *buf;
5789 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
5790 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5791 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5792 	buf = stream->alloc(totalSize);
5793 	ptr = buf;
5794 	int tmp = OP_glOrthoxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5795 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5796 
5797 		memcpy(ptr, &left, 4); ptr += 4;
5798 		memcpy(ptr, &right, 4); ptr += 4;
5799 		memcpy(ptr, &bottom, 4); ptr += 4;
5800 		memcpy(ptr, &top, 4); ptr += 4;
5801 		memcpy(ptr, &zNear, 4); ptr += 4;
5802 		memcpy(ptr, &zFar, 4); ptr += 4;
5803 
5804 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5805 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5806 
5807 }
5808 
glPointParameterxOES_enc(void * self,GLenum pname,GLfixed param)5809 void glPointParameterxOES_enc(void *self , GLenum pname, GLfixed param)
5810 {
5811 
5812 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5813 	IOStream *stream = ctx->m_stream;
5814 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5815 	bool useChecksum = checksumCalculator->getVersion() > 0;
5816 
5817 	 unsigned char *ptr;
5818 	 unsigned char *buf;
5819 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
5820 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5821 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5822 	buf = stream->alloc(totalSize);
5823 	ptr = buf;
5824 	int tmp = OP_glPointParameterxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5825 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5826 
5827 		memcpy(ptr, &pname, 4); ptr += 4;
5828 		memcpy(ptr, &param, 4); ptr += 4;
5829 
5830 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5831 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5832 
5833 }
5834 
glPointParameterxvOES_enc(void * self,GLenum pname,const GLfixed * params)5835 void glPointParameterxvOES_enc(void *self , GLenum pname, const GLfixed* params)
5836 {
5837 
5838 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5839 	IOStream *stream = ctx->m_stream;
5840 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5841 	bool useChecksum = checksumCalculator->getVersion() > 0;
5842 
5843 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
5844 	 unsigned char *ptr;
5845 	 unsigned char *buf;
5846 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_params + 1*4;
5847 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5848 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5849 	buf = stream->alloc(totalSize);
5850 	ptr = buf;
5851 	int tmp = OP_glPointParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
5852 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5853 
5854 		memcpy(ptr, &pname, 4); ptr += 4;
5855 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
5856 	memcpy(ptr, params, __size_params);ptr += __size_params;
5857 
5858 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5859 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5860 
5861 }
5862 
glPointSizexOES_enc(void * self,GLfixed size)5863 void glPointSizexOES_enc(void *self , GLfixed size)
5864 {
5865 
5866 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5867 	IOStream *stream = ctx->m_stream;
5868 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5869 	bool useChecksum = checksumCalculator->getVersion() > 0;
5870 
5871 	 unsigned char *ptr;
5872 	 unsigned char *buf;
5873 	 const size_t sizeWithoutChecksum = 8 + 4;
5874 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5875 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5876 	buf = stream->alloc(totalSize);
5877 	ptr = buf;
5878 	int tmp = OP_glPointSizexOES;memcpy(ptr, &tmp, 4); ptr += 4;
5879 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5880 
5881 		memcpy(ptr, &size, 4); ptr += 4;
5882 
5883 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5884 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5885 
5886 }
5887 
glPolygonOffsetxOES_enc(void * self,GLfixed factor,GLfixed units)5888 void glPolygonOffsetxOES_enc(void *self , GLfixed factor, GLfixed units)
5889 {
5890 
5891 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5892 	IOStream *stream = ctx->m_stream;
5893 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5894 	bool useChecksum = checksumCalculator->getVersion() > 0;
5895 
5896 	 unsigned char *ptr;
5897 	 unsigned char *buf;
5898 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
5899 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5900 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5901 	buf = stream->alloc(totalSize);
5902 	ptr = buf;
5903 	int tmp = OP_glPolygonOffsetxOES;memcpy(ptr, &tmp, 4); ptr += 4;
5904 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5905 
5906 		memcpy(ptr, &factor, 4); ptr += 4;
5907 		memcpy(ptr, &units, 4); ptr += 4;
5908 
5909 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5910 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5911 
5912 }
5913 
glRotatexOES_enc(void * self,GLfixed angle,GLfixed x,GLfixed y,GLfixed z)5914 void glRotatexOES_enc(void *self , GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
5915 {
5916 
5917 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5918 	IOStream *stream = ctx->m_stream;
5919 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5920 	bool useChecksum = checksumCalculator->getVersion() > 0;
5921 
5922 	 unsigned char *ptr;
5923 	 unsigned char *buf;
5924 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
5925 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5926 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5927 	buf = stream->alloc(totalSize);
5928 	ptr = buf;
5929 	int tmp = OP_glRotatexOES;memcpy(ptr, &tmp, 4); ptr += 4;
5930 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5931 
5932 		memcpy(ptr, &angle, 4); ptr += 4;
5933 		memcpy(ptr, &x, 4); ptr += 4;
5934 		memcpy(ptr, &y, 4); ptr += 4;
5935 		memcpy(ptr, &z, 4); ptr += 4;
5936 
5937 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5938 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5939 
5940 }
5941 
glSampleCoveragexOES_enc(void * self,GLclampx value,GLboolean invert)5942 void glSampleCoveragexOES_enc(void *self , GLclampx value, GLboolean invert)
5943 {
5944 
5945 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5946 	IOStream *stream = ctx->m_stream;
5947 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5948 	bool useChecksum = checksumCalculator->getVersion() > 0;
5949 
5950 	 unsigned char *ptr;
5951 	 unsigned char *buf;
5952 	 const size_t sizeWithoutChecksum = 8 + 4 + 1;
5953 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5954 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5955 	buf = stream->alloc(totalSize);
5956 	ptr = buf;
5957 	int tmp = OP_glSampleCoveragexOES;memcpy(ptr, &tmp, 4); ptr += 4;
5958 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5959 
5960 		memcpy(ptr, &value, 4); ptr += 4;
5961 		memcpy(ptr, &invert, 1); ptr += 1;
5962 
5963 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5964 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5965 
5966 }
5967 
glScalexOES_enc(void * self,GLfixed x,GLfixed y,GLfixed z)5968 void glScalexOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
5969 {
5970 
5971 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5972 	IOStream *stream = ctx->m_stream;
5973 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
5974 	bool useChecksum = checksumCalculator->getVersion() > 0;
5975 
5976 	 unsigned char *ptr;
5977 	 unsigned char *buf;
5978 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
5979 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
5980 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
5981 	buf = stream->alloc(totalSize);
5982 	ptr = buf;
5983 	int tmp = OP_glScalexOES;memcpy(ptr, &tmp, 4); ptr += 4;
5984 	memcpy(ptr, &totalSize, 4);  ptr += 4;
5985 
5986 		memcpy(ptr, &x, 4); ptr += 4;
5987 		memcpy(ptr, &y, 4); ptr += 4;
5988 		memcpy(ptr, &z, 4); ptr += 4;
5989 
5990 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
5991 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
5992 
5993 }
5994 
glTexEnvxOES_enc(void * self,GLenum target,GLenum pname,GLfixed param)5995 void glTexEnvxOES_enc(void *self , GLenum target, GLenum pname, GLfixed param)
5996 {
5997 
5998 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
5999 	IOStream *stream = ctx->m_stream;
6000 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6001 	bool useChecksum = checksumCalculator->getVersion() > 0;
6002 
6003 	 unsigned char *ptr;
6004 	 unsigned char *buf;
6005 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
6006 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6007 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6008 	buf = stream->alloc(totalSize);
6009 	ptr = buf;
6010 	int tmp = OP_glTexEnvxOES;memcpy(ptr, &tmp, 4); ptr += 4;
6011 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6012 
6013 		memcpy(ptr, &target, 4); ptr += 4;
6014 		memcpy(ptr, &pname, 4); ptr += 4;
6015 		memcpy(ptr, &param, 4); ptr += 4;
6016 
6017 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6018 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6019 
6020 }
6021 
glTexEnvxvOES_enc(void * self,GLenum target,GLenum pname,const GLfixed * params)6022 void glTexEnvxvOES_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
6023 {
6024 
6025 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6026 	IOStream *stream = ctx->m_stream;
6027 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6028 	bool useChecksum = checksumCalculator->getVersion() > 0;
6029 
6030 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
6031 	 unsigned char *ptr;
6032 	 unsigned char *buf;
6033 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
6034 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6035 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6036 	buf = stream->alloc(totalSize);
6037 	ptr = buf;
6038 	int tmp = OP_glTexEnvxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
6039 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6040 
6041 		memcpy(ptr, &target, 4); ptr += 4;
6042 		memcpy(ptr, &pname, 4); ptr += 4;
6043 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
6044 	memcpy(ptr, params, __size_params);ptr += __size_params;
6045 
6046 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6047 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6048 
6049 }
6050 
glTexParameterxOES_enc(void * self,GLenum target,GLenum pname,GLfixed param)6051 void glTexParameterxOES_enc(void *self , GLenum target, GLenum pname, GLfixed param)
6052 {
6053 
6054 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6055 	IOStream *stream = ctx->m_stream;
6056 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6057 	bool useChecksum = checksumCalculator->getVersion() > 0;
6058 
6059 	 unsigned char *ptr;
6060 	 unsigned char *buf;
6061 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
6062 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6063 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6064 	buf = stream->alloc(totalSize);
6065 	ptr = buf;
6066 	int tmp = OP_glTexParameterxOES;memcpy(ptr, &tmp, 4); ptr += 4;
6067 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6068 
6069 		memcpy(ptr, &target, 4); ptr += 4;
6070 		memcpy(ptr, &pname, 4); ptr += 4;
6071 		memcpy(ptr, &param, 4); ptr += 4;
6072 
6073 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6074 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6075 
6076 }
6077 
glTexParameterxvOES_enc(void * self,GLenum target,GLenum pname,const GLfixed * params)6078 void glTexParameterxvOES_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
6079 {
6080 
6081 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6082 	IOStream *stream = ctx->m_stream;
6083 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6084 	bool useChecksum = checksumCalculator->getVersion() > 0;
6085 
6086 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
6087 	 unsigned char *ptr;
6088 	 unsigned char *buf;
6089 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
6090 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6091 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6092 	buf = stream->alloc(totalSize);
6093 	ptr = buf;
6094 	int tmp = OP_glTexParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
6095 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6096 
6097 		memcpy(ptr, &target, 4); ptr += 4;
6098 		memcpy(ptr, &pname, 4); ptr += 4;
6099 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
6100 	memcpy(ptr, params, __size_params);ptr += __size_params;
6101 
6102 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6103 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6104 
6105 }
6106 
glTranslatexOES_enc(void * self,GLfixed x,GLfixed y,GLfixed z)6107 void glTranslatexOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
6108 {
6109 
6110 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6111 	IOStream *stream = ctx->m_stream;
6112 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6113 	bool useChecksum = checksumCalculator->getVersion() > 0;
6114 
6115 	 unsigned char *ptr;
6116 	 unsigned char *buf;
6117 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
6118 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6119 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6120 	buf = stream->alloc(totalSize);
6121 	ptr = buf;
6122 	int tmp = OP_glTranslatexOES;memcpy(ptr, &tmp, 4); ptr += 4;
6123 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6124 
6125 		memcpy(ptr, &x, 4); ptr += 4;
6126 		memcpy(ptr, &y, 4); ptr += 4;
6127 		memcpy(ptr, &z, 4); ptr += 4;
6128 
6129 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6130 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6131 
6132 }
6133 
glIsRenderbufferOES_enc(void * self,GLuint renderbuffer)6134 GLboolean glIsRenderbufferOES_enc(void *self , GLuint renderbuffer)
6135 {
6136 
6137 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6138 	IOStream *stream = ctx->m_stream;
6139 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6140 	bool useChecksum = checksumCalculator->getVersion() > 0;
6141 
6142 	 unsigned char *ptr;
6143 	 unsigned char *buf;
6144 	 const size_t sizeWithoutChecksum = 8 + 4;
6145 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6146 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6147 	buf = stream->alloc(totalSize);
6148 	ptr = buf;
6149 	int tmp = OP_glIsRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
6150 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6151 
6152 		memcpy(ptr, &renderbuffer, 4); ptr += 4;
6153 
6154 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6155 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6156 
6157 
6158 	GLboolean retval;
6159 	stream->readback(&retval, 1);
6160 	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
6161 	if (useChecksum) {
6162 		unsigned char *checksumBufPtr = NULL;
6163 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
6164 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
6165 		stream->readback(checksumBufPtr, checksumSize);
6166 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
6167 			ALOGE("glIsRenderbufferOES: GL communication error, please report this issue to b.android.com.\n");
6168 			abort();
6169 		}
6170 	}
6171 	return retval;
6172 }
6173 
glBindRenderbufferOES_enc(void * self,GLenum target,GLuint renderbuffer)6174 void glBindRenderbufferOES_enc(void *self , GLenum target, GLuint renderbuffer)
6175 {
6176 
6177 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6178 	IOStream *stream = ctx->m_stream;
6179 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6180 	bool useChecksum = checksumCalculator->getVersion() > 0;
6181 
6182 	 unsigned char *ptr;
6183 	 unsigned char *buf;
6184 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
6185 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6186 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6187 	buf = stream->alloc(totalSize);
6188 	ptr = buf;
6189 	int tmp = OP_glBindRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
6190 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6191 
6192 		memcpy(ptr, &target, 4); ptr += 4;
6193 		memcpy(ptr, &renderbuffer, 4); ptr += 4;
6194 
6195 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6196 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6197 
6198 }
6199 
glDeleteRenderbuffersOES_enc(void * self,GLsizei n,const GLuint * renderbuffers)6200 void glDeleteRenderbuffersOES_enc(void *self , GLsizei n, const GLuint* renderbuffers)
6201 {
6202 
6203 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6204 	IOStream *stream = ctx->m_stream;
6205 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6206 	bool useChecksum = checksumCalculator->getVersion() > 0;
6207 
6208 	const unsigned int __size_renderbuffers =  (n * sizeof(GLuint));
6209 	 unsigned char *ptr;
6210 	 unsigned char *buf;
6211 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_renderbuffers + 1*4;
6212 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6213 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6214 	buf = stream->alloc(totalSize);
6215 	ptr = buf;
6216 	int tmp = OP_glDeleteRenderbuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
6217 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6218 
6219 		memcpy(ptr, &n, 4); ptr += 4;
6220 	*(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
6221 	memcpy(ptr, renderbuffers, __size_renderbuffers);ptr += __size_renderbuffers;
6222 
6223 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6224 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6225 
6226 }
6227 
glGenRenderbuffersOES_enc(void * self,GLsizei n,GLuint * renderbuffers)6228 void glGenRenderbuffersOES_enc(void *self , GLsizei n, GLuint* renderbuffers)
6229 {
6230 
6231 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6232 	IOStream *stream = ctx->m_stream;
6233 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6234 	bool useChecksum = checksumCalculator->getVersion() > 0;
6235 
6236 	const unsigned int __size_renderbuffers =  (n * sizeof(GLuint));
6237 	 unsigned char *ptr;
6238 	 unsigned char *buf;
6239 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
6240 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6241 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6242 	buf = stream->alloc(totalSize);
6243 	ptr = buf;
6244 	int tmp = OP_glGenRenderbuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
6245 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6246 
6247 		memcpy(ptr, &n, 4); ptr += 4;
6248 	*(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
6249 
6250 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6251 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6252 
6253 	stream->readback(renderbuffers, __size_renderbuffers);
6254 	if (useChecksum) checksumCalculator->addBuffer(renderbuffers, __size_renderbuffers);
6255 	if (useChecksum) {
6256 		unsigned char *checksumBufPtr = NULL;
6257 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
6258 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
6259 		stream->readback(checksumBufPtr, checksumSize);
6260 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
6261 			ALOGE("glGenRenderbuffersOES: GL communication error, please report this issue to b.android.com.\n");
6262 			abort();
6263 		}
6264 	}
6265 }
6266 
glRenderbufferStorageOES_enc(void * self,GLenum target,GLenum internalformat,GLsizei width,GLsizei height)6267 void glRenderbufferStorageOES_enc(void *self , GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
6268 {
6269 
6270 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6271 	IOStream *stream = ctx->m_stream;
6272 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6273 	bool useChecksum = checksumCalculator->getVersion() > 0;
6274 
6275 	 unsigned char *ptr;
6276 	 unsigned char *buf;
6277 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
6278 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6279 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6280 	buf = stream->alloc(totalSize);
6281 	ptr = buf;
6282 	int tmp = OP_glRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
6283 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6284 
6285 		memcpy(ptr, &target, 4); ptr += 4;
6286 		memcpy(ptr, &internalformat, 4); ptr += 4;
6287 		memcpy(ptr, &width, 4); ptr += 4;
6288 		memcpy(ptr, &height, 4); ptr += 4;
6289 
6290 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6291 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6292 
6293 }
6294 
glGetRenderbufferParameterivOES_enc(void * self,GLenum target,GLenum pname,GLint * params)6295 void glGetRenderbufferParameterivOES_enc(void *self , GLenum target, GLenum pname, GLint* params)
6296 {
6297 
6298 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6299 	IOStream *stream = ctx->m_stream;
6300 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6301 	bool useChecksum = checksumCalculator->getVersion() > 0;
6302 
6303 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
6304 	 unsigned char *ptr;
6305 	 unsigned char *buf;
6306 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
6307 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6308 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6309 	buf = stream->alloc(totalSize);
6310 	ptr = buf;
6311 	int tmp = OP_glGetRenderbufferParameterivOES;memcpy(ptr, &tmp, 4); ptr += 4;
6312 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6313 
6314 		memcpy(ptr, &target, 4); ptr += 4;
6315 		memcpy(ptr, &pname, 4); ptr += 4;
6316 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
6317 
6318 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6319 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6320 
6321 	stream->readback(params, __size_params);
6322 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
6323 	if (useChecksum) {
6324 		unsigned char *checksumBufPtr = NULL;
6325 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
6326 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
6327 		stream->readback(checksumBufPtr, checksumSize);
6328 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
6329 			ALOGE("glGetRenderbufferParameterivOES: GL communication error, please report this issue to b.android.com.\n");
6330 			abort();
6331 		}
6332 	}
6333 }
6334 
glIsFramebufferOES_enc(void * self,GLuint framebuffer)6335 GLboolean glIsFramebufferOES_enc(void *self , GLuint framebuffer)
6336 {
6337 
6338 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6339 	IOStream *stream = ctx->m_stream;
6340 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6341 	bool useChecksum = checksumCalculator->getVersion() > 0;
6342 
6343 	 unsigned char *ptr;
6344 	 unsigned char *buf;
6345 	 const size_t sizeWithoutChecksum = 8 + 4;
6346 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6347 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6348 	buf = stream->alloc(totalSize);
6349 	ptr = buf;
6350 	int tmp = OP_glIsFramebufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
6351 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6352 
6353 		memcpy(ptr, &framebuffer, 4); ptr += 4;
6354 
6355 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6356 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6357 
6358 
6359 	GLboolean retval;
6360 	stream->readback(&retval, 1);
6361 	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
6362 	if (useChecksum) {
6363 		unsigned char *checksumBufPtr = NULL;
6364 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
6365 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
6366 		stream->readback(checksumBufPtr, checksumSize);
6367 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
6368 			ALOGE("glIsFramebufferOES: GL communication error, please report this issue to b.android.com.\n");
6369 			abort();
6370 		}
6371 	}
6372 	return retval;
6373 }
6374 
glBindFramebufferOES_enc(void * self,GLenum target,GLuint framebuffer)6375 void glBindFramebufferOES_enc(void *self , GLenum target, GLuint framebuffer)
6376 {
6377 
6378 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6379 	IOStream *stream = ctx->m_stream;
6380 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6381 	bool useChecksum = checksumCalculator->getVersion() > 0;
6382 
6383 	 unsigned char *ptr;
6384 	 unsigned char *buf;
6385 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
6386 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6387 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6388 	buf = stream->alloc(totalSize);
6389 	ptr = buf;
6390 	int tmp = OP_glBindFramebufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
6391 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6392 
6393 		memcpy(ptr, &target, 4); ptr += 4;
6394 		memcpy(ptr, &framebuffer, 4); ptr += 4;
6395 
6396 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6397 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6398 
6399 }
6400 
glDeleteFramebuffersOES_enc(void * self,GLsizei n,const GLuint * framebuffers)6401 void glDeleteFramebuffersOES_enc(void *self , GLsizei n, const GLuint* framebuffers)
6402 {
6403 
6404 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6405 	IOStream *stream = ctx->m_stream;
6406 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6407 	bool useChecksum = checksumCalculator->getVersion() > 0;
6408 
6409 	const unsigned int __size_framebuffers =  (n * sizeof(GLuint));
6410 	 unsigned char *ptr;
6411 	 unsigned char *buf;
6412 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_framebuffers + 1*4;
6413 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6414 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6415 	buf = stream->alloc(totalSize);
6416 	ptr = buf;
6417 	int tmp = OP_glDeleteFramebuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
6418 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6419 
6420 		memcpy(ptr, &n, 4); ptr += 4;
6421 	*(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
6422 	memcpy(ptr, framebuffers, __size_framebuffers);ptr += __size_framebuffers;
6423 
6424 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6425 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6426 
6427 }
6428 
glGenFramebuffersOES_enc(void * self,GLsizei n,GLuint * framebuffers)6429 void glGenFramebuffersOES_enc(void *self , GLsizei n, GLuint* framebuffers)
6430 {
6431 
6432 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6433 	IOStream *stream = ctx->m_stream;
6434 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6435 	bool useChecksum = checksumCalculator->getVersion() > 0;
6436 
6437 	const unsigned int __size_framebuffers =  (n * sizeof(GLuint));
6438 	 unsigned char *ptr;
6439 	 unsigned char *buf;
6440 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
6441 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6442 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6443 	buf = stream->alloc(totalSize);
6444 	ptr = buf;
6445 	int tmp = OP_glGenFramebuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
6446 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6447 
6448 		memcpy(ptr, &n, 4); ptr += 4;
6449 	*(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
6450 
6451 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6452 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6453 
6454 	stream->readback(framebuffers, __size_framebuffers);
6455 	if (useChecksum) checksumCalculator->addBuffer(framebuffers, __size_framebuffers);
6456 	if (useChecksum) {
6457 		unsigned char *checksumBufPtr = NULL;
6458 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
6459 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
6460 		stream->readback(checksumBufPtr, checksumSize);
6461 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
6462 			ALOGE("glGenFramebuffersOES: GL communication error, please report this issue to b.android.com.\n");
6463 			abort();
6464 		}
6465 	}
6466 }
6467 
glCheckFramebufferStatusOES_enc(void * self,GLenum target)6468 GLenum glCheckFramebufferStatusOES_enc(void *self , GLenum target)
6469 {
6470 
6471 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6472 	IOStream *stream = ctx->m_stream;
6473 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6474 	bool useChecksum = checksumCalculator->getVersion() > 0;
6475 
6476 	 unsigned char *ptr;
6477 	 unsigned char *buf;
6478 	 const size_t sizeWithoutChecksum = 8 + 4;
6479 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6480 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6481 	buf = stream->alloc(totalSize);
6482 	ptr = buf;
6483 	int tmp = OP_glCheckFramebufferStatusOES;memcpy(ptr, &tmp, 4); ptr += 4;
6484 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6485 
6486 		memcpy(ptr, &target, 4); ptr += 4;
6487 
6488 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6489 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6490 
6491 
6492 	GLenum retval;
6493 	stream->readback(&retval, 4);
6494 	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
6495 	if (useChecksum) {
6496 		unsigned char *checksumBufPtr = NULL;
6497 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
6498 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
6499 		stream->readback(checksumBufPtr, checksumSize);
6500 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
6501 			ALOGE("glCheckFramebufferStatusOES: GL communication error, please report this issue to b.android.com.\n");
6502 			abort();
6503 		}
6504 	}
6505 	return retval;
6506 }
6507 
glFramebufferRenderbufferOES_enc(void * self,GLenum target,GLenum attachment,GLenum renderbuffertarget,GLuint renderbuffer)6508 void glFramebufferRenderbufferOES_enc(void *self , GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
6509 {
6510 
6511 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6512 	IOStream *stream = ctx->m_stream;
6513 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6514 	bool useChecksum = checksumCalculator->getVersion() > 0;
6515 
6516 	 unsigned char *ptr;
6517 	 unsigned char *buf;
6518 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
6519 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6520 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6521 	buf = stream->alloc(totalSize);
6522 	ptr = buf;
6523 	int tmp = OP_glFramebufferRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
6524 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6525 
6526 		memcpy(ptr, &target, 4); ptr += 4;
6527 		memcpy(ptr, &attachment, 4); ptr += 4;
6528 		memcpy(ptr, &renderbuffertarget, 4); ptr += 4;
6529 		memcpy(ptr, &renderbuffer, 4); ptr += 4;
6530 
6531 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6532 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6533 
6534 }
6535 
glFramebufferTexture2DOES_enc(void * self,GLenum target,GLenum attachment,GLenum textarget,GLuint texture,GLint level)6536 void glFramebufferTexture2DOES_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
6537 {
6538 
6539 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6540 	IOStream *stream = ctx->m_stream;
6541 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6542 	bool useChecksum = checksumCalculator->getVersion() > 0;
6543 
6544 	 unsigned char *ptr;
6545 	 unsigned char *buf;
6546 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
6547 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6548 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6549 	buf = stream->alloc(totalSize);
6550 	ptr = buf;
6551 	int tmp = OP_glFramebufferTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
6552 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6553 
6554 		memcpy(ptr, &target, 4); ptr += 4;
6555 		memcpy(ptr, &attachment, 4); ptr += 4;
6556 		memcpy(ptr, &textarget, 4); ptr += 4;
6557 		memcpy(ptr, &texture, 4); ptr += 4;
6558 		memcpy(ptr, &level, 4); ptr += 4;
6559 
6560 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6561 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6562 
6563 }
6564 
glGetFramebufferAttachmentParameterivOES_enc(void * self,GLenum target,GLenum attachment,GLenum pname,GLint * params)6565 void glGetFramebufferAttachmentParameterivOES_enc(void *self , GLenum target, GLenum attachment, GLenum pname, GLint* params)
6566 {
6567 
6568 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6569 	IOStream *stream = ctx->m_stream;
6570 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6571 	bool useChecksum = checksumCalculator->getVersion() > 0;
6572 
6573 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
6574 	 unsigned char *ptr;
6575 	 unsigned char *buf;
6576 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
6577 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6578 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6579 	buf = stream->alloc(totalSize);
6580 	ptr = buf;
6581 	int tmp = OP_glGetFramebufferAttachmentParameterivOES;memcpy(ptr, &tmp, 4); ptr += 4;
6582 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6583 
6584 		memcpy(ptr, &target, 4); ptr += 4;
6585 		memcpy(ptr, &attachment, 4); ptr += 4;
6586 		memcpy(ptr, &pname, 4); ptr += 4;
6587 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
6588 
6589 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6590 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6591 
6592 	stream->readback(params, __size_params);
6593 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
6594 	if (useChecksum) {
6595 		unsigned char *checksumBufPtr = NULL;
6596 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
6597 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
6598 		stream->readback(checksumBufPtr, checksumSize);
6599 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
6600 			ALOGE("glGetFramebufferAttachmentParameterivOES: GL communication error, please report this issue to b.android.com.\n");
6601 			abort();
6602 		}
6603 	}
6604 }
6605 
glGenerateMipmapOES_enc(void * self,GLenum target)6606 void glGenerateMipmapOES_enc(void *self , GLenum target)
6607 {
6608 
6609 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6610 	IOStream *stream = ctx->m_stream;
6611 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6612 	bool useChecksum = checksumCalculator->getVersion() > 0;
6613 
6614 	 unsigned char *ptr;
6615 	 unsigned char *buf;
6616 	 const size_t sizeWithoutChecksum = 8 + 4;
6617 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6618 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6619 	buf = stream->alloc(totalSize);
6620 	ptr = buf;
6621 	int tmp = OP_glGenerateMipmapOES;memcpy(ptr, &tmp, 4); ptr += 4;
6622 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6623 
6624 		memcpy(ptr, &target, 4); ptr += 4;
6625 
6626 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6627 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6628 
6629 }
6630 
glUnmapBufferOES_enc(void * self,GLenum target)6631 GLboolean glUnmapBufferOES_enc(void *self , GLenum target)
6632 {
6633 
6634 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6635 	IOStream *stream = ctx->m_stream;
6636 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6637 	bool useChecksum = checksumCalculator->getVersion() > 0;
6638 
6639 	 unsigned char *ptr;
6640 	 unsigned char *buf;
6641 	 const size_t sizeWithoutChecksum = 8 + 4;
6642 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6643 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6644 	buf = stream->alloc(totalSize);
6645 	ptr = buf;
6646 	int tmp = OP_glUnmapBufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
6647 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6648 
6649 		memcpy(ptr, &target, 4); ptr += 4;
6650 
6651 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6652 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6653 
6654 
6655 	GLboolean retval;
6656 	stream->readback(&retval, 1);
6657 	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
6658 	if (useChecksum) {
6659 		unsigned char *checksumBufPtr = NULL;
6660 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
6661 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
6662 		stream->readback(checksumBufPtr, checksumSize);
6663 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
6664 			ALOGE("glUnmapBufferOES: GL communication error, please report this issue to b.android.com.\n");
6665 			abort();
6666 		}
6667 	}
6668 	return retval;
6669 }
6670 
glCurrentPaletteMatrixOES_enc(void * self,GLuint matrixpaletteindex)6671 void glCurrentPaletteMatrixOES_enc(void *self , GLuint matrixpaletteindex)
6672 {
6673 
6674 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6675 	IOStream *stream = ctx->m_stream;
6676 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6677 	bool useChecksum = checksumCalculator->getVersion() > 0;
6678 
6679 	 unsigned char *ptr;
6680 	 unsigned char *buf;
6681 	 const size_t sizeWithoutChecksum = 8 + 4;
6682 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6683 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6684 	buf = stream->alloc(totalSize);
6685 	ptr = buf;
6686 	int tmp = OP_glCurrentPaletteMatrixOES;memcpy(ptr, &tmp, 4); ptr += 4;
6687 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6688 
6689 		memcpy(ptr, &matrixpaletteindex, 4); ptr += 4;
6690 
6691 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6692 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6693 
6694 }
6695 
glLoadPaletteFromModelViewMatrixOES_enc(void * self)6696 void glLoadPaletteFromModelViewMatrixOES_enc(void *self )
6697 {
6698 
6699 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6700 	IOStream *stream = ctx->m_stream;
6701 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6702 	bool useChecksum = checksumCalculator->getVersion() > 0;
6703 
6704 	 unsigned char *ptr;
6705 	 unsigned char *buf;
6706 	 const size_t sizeWithoutChecksum = 8;
6707 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6708 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6709 	buf = stream->alloc(totalSize);
6710 	ptr = buf;
6711 	int tmp = OP_glLoadPaletteFromModelViewMatrixOES;memcpy(ptr, &tmp, 4); ptr += 4;
6712 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6713 
6714 
6715 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6716 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6717 
6718 }
6719 
glQueryMatrixxOES_enc(void * self,GLfixed * mantissa,GLint * exponent)6720 GLbitfield glQueryMatrixxOES_enc(void *self , GLfixed* mantissa, GLint* exponent)
6721 {
6722 
6723 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6724 	IOStream *stream = ctx->m_stream;
6725 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6726 	bool useChecksum = checksumCalculator->getVersion() > 0;
6727 
6728 	const unsigned int __size_mantissa =  (16 * sizeof(GLfixed));
6729 	const unsigned int __size_exponent =  (16 * sizeof(GLfixed));
6730 	 unsigned char *ptr;
6731 	 unsigned char *buf;
6732 	 const size_t sizeWithoutChecksum = 8 + 0 + 0 + 2*4;
6733 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6734 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6735 	buf = stream->alloc(totalSize);
6736 	ptr = buf;
6737 	int tmp = OP_glQueryMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
6738 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6739 
6740 	*(unsigned int *)(ptr) = __size_mantissa; ptr += 4;
6741 	*(unsigned int *)(ptr) = __size_exponent; ptr += 4;
6742 
6743 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6744 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6745 
6746 	stream->readback(mantissa, __size_mantissa);
6747 	if (useChecksum) checksumCalculator->addBuffer(mantissa, __size_mantissa);
6748 	stream->readback(exponent, __size_exponent);
6749 	if (useChecksum) checksumCalculator->addBuffer(exponent, __size_exponent);
6750 
6751 	GLbitfield retval;
6752 	stream->readback(&retval, 4);
6753 	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
6754 	if (useChecksum) {
6755 		unsigned char *checksumBufPtr = NULL;
6756 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
6757 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
6758 		stream->readback(checksumBufPtr, checksumSize);
6759 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
6760 			ALOGE("glQueryMatrixxOES: GL communication error, please report this issue to b.android.com.\n");
6761 			abort();
6762 		}
6763 	}
6764 	return retval;
6765 }
6766 
glDepthRangefOES_enc(void * self,GLclampf zNear,GLclampf zFar)6767 void glDepthRangefOES_enc(void *self , GLclampf zNear, GLclampf zFar)
6768 {
6769 
6770 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6771 	IOStream *stream = ctx->m_stream;
6772 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6773 	bool useChecksum = checksumCalculator->getVersion() > 0;
6774 
6775 	 unsigned char *ptr;
6776 	 unsigned char *buf;
6777 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
6778 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6779 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6780 	buf = stream->alloc(totalSize);
6781 	ptr = buf;
6782 	int tmp = OP_glDepthRangefOES;memcpy(ptr, &tmp, 4); ptr += 4;
6783 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6784 
6785 		memcpy(ptr, &zNear, 4); ptr += 4;
6786 		memcpy(ptr, &zFar, 4); ptr += 4;
6787 
6788 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6789 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6790 
6791 }
6792 
glFrustumfOES_enc(void * self,GLfloat left,GLfloat right,GLfloat bottom,GLfloat top,GLfloat zNear,GLfloat zFar)6793 void glFrustumfOES_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
6794 {
6795 
6796 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6797 	IOStream *stream = ctx->m_stream;
6798 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6799 	bool useChecksum = checksumCalculator->getVersion() > 0;
6800 
6801 	 unsigned char *ptr;
6802 	 unsigned char *buf;
6803 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
6804 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6805 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6806 	buf = stream->alloc(totalSize);
6807 	ptr = buf;
6808 	int tmp = OP_glFrustumfOES;memcpy(ptr, &tmp, 4); ptr += 4;
6809 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6810 
6811 		memcpy(ptr, &left, 4); ptr += 4;
6812 		memcpy(ptr, &right, 4); ptr += 4;
6813 		memcpy(ptr, &bottom, 4); ptr += 4;
6814 		memcpy(ptr, &top, 4); ptr += 4;
6815 		memcpy(ptr, &zNear, 4); ptr += 4;
6816 		memcpy(ptr, &zFar, 4); ptr += 4;
6817 
6818 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6819 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6820 
6821 }
6822 
glOrthofOES_enc(void * self,GLfloat left,GLfloat right,GLfloat bottom,GLfloat top,GLfloat zNear,GLfloat zFar)6823 void glOrthofOES_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
6824 {
6825 
6826 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6827 	IOStream *stream = ctx->m_stream;
6828 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6829 	bool useChecksum = checksumCalculator->getVersion() > 0;
6830 
6831 	 unsigned char *ptr;
6832 	 unsigned char *buf;
6833 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
6834 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6835 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6836 	buf = stream->alloc(totalSize);
6837 	ptr = buf;
6838 	int tmp = OP_glOrthofOES;memcpy(ptr, &tmp, 4); ptr += 4;
6839 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6840 
6841 		memcpy(ptr, &left, 4); ptr += 4;
6842 		memcpy(ptr, &right, 4); ptr += 4;
6843 		memcpy(ptr, &bottom, 4); ptr += 4;
6844 		memcpy(ptr, &top, 4); ptr += 4;
6845 		memcpy(ptr, &zNear, 4); ptr += 4;
6846 		memcpy(ptr, &zFar, 4); ptr += 4;
6847 
6848 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6849 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6850 
6851 }
6852 
glClipPlanefOES_enc(void * self,GLenum plane,const GLfloat * equation)6853 void glClipPlanefOES_enc(void *self , GLenum plane, const GLfloat* equation)
6854 {
6855 
6856 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6857 	IOStream *stream = ctx->m_stream;
6858 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6859 	bool useChecksum = checksumCalculator->getVersion() > 0;
6860 
6861 	const unsigned int __size_equation =  (4 * sizeof(GLfloat));
6862 	 unsigned char *ptr;
6863 	 unsigned char *buf;
6864 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
6865 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6866 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6867 	buf = stream->alloc(totalSize);
6868 	ptr = buf;
6869 	int tmp = OP_glClipPlanefOES;memcpy(ptr, &tmp, 4); ptr += 4;
6870 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6871 
6872 		memcpy(ptr, &plane, 4); ptr += 4;
6873 	*(unsigned int *)(ptr) = __size_equation; ptr += 4;
6874 	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
6875 
6876 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6877 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6878 
6879 }
6880 
glClipPlanefIMG_enc(void * self,GLenum plane,const GLfloat * equation)6881 void glClipPlanefIMG_enc(void *self , GLenum plane, const GLfloat* equation)
6882 {
6883 
6884 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6885 	IOStream *stream = ctx->m_stream;
6886 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6887 	bool useChecksum = checksumCalculator->getVersion() > 0;
6888 
6889 	const unsigned int __size_equation =  (4 * sizeof(GLfloat));
6890 	 unsigned char *ptr;
6891 	 unsigned char *buf;
6892 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_equation + 1*4;
6893 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6894 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6895 	buf = stream->alloc(totalSize);
6896 	ptr = buf;
6897 	int tmp = OP_glClipPlanefIMG;memcpy(ptr, &tmp, 4); ptr += 4;
6898 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6899 
6900 		memcpy(ptr, &plane, 4); ptr += 4;
6901 	*(unsigned int *)(ptr) = __size_equation; ptr += 4;
6902 	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
6903 
6904 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6905 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6906 
6907 }
6908 
glGetClipPlanefOES_enc(void * self,GLenum pname,GLfloat * eqn)6909 void glGetClipPlanefOES_enc(void *self , GLenum pname, GLfloat* eqn)
6910 {
6911 
6912 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6913 	IOStream *stream = ctx->m_stream;
6914 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6915 	bool useChecksum = checksumCalculator->getVersion() > 0;
6916 
6917 	const unsigned int __size_eqn =  (4 * sizeof(GLfloat));
6918 	 unsigned char *ptr;
6919 	 unsigned char *buf;
6920 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
6921 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6922 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6923 	buf = stream->alloc(totalSize);
6924 	ptr = buf;
6925 	int tmp = OP_glGetClipPlanefOES;memcpy(ptr, &tmp, 4); ptr += 4;
6926 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6927 
6928 		memcpy(ptr, &pname, 4); ptr += 4;
6929 	*(unsigned int *)(ptr) = __size_eqn; ptr += 4;
6930 
6931 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6932 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6933 
6934 	stream->readback(eqn, __size_eqn);
6935 	if (useChecksum) checksumCalculator->addBuffer(eqn, __size_eqn);
6936 	if (useChecksum) {
6937 		unsigned char *checksumBufPtr = NULL;
6938 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
6939 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
6940 		stream->readback(checksumBufPtr, checksumSize);
6941 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
6942 			ALOGE("glGetClipPlanefOES: GL communication error, please report this issue to b.android.com.\n");
6943 			abort();
6944 		}
6945 	}
6946 }
6947 
glClearDepthfOES_enc(void * self,GLclampf depth)6948 void glClearDepthfOES_enc(void *self , GLclampf depth)
6949 {
6950 
6951 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6952 	IOStream *stream = ctx->m_stream;
6953 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6954 	bool useChecksum = checksumCalculator->getVersion() > 0;
6955 
6956 	 unsigned char *ptr;
6957 	 unsigned char *buf;
6958 	 const size_t sizeWithoutChecksum = 8 + 4;
6959 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6960 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6961 	buf = stream->alloc(totalSize);
6962 	ptr = buf;
6963 	int tmp = OP_glClearDepthfOES;memcpy(ptr, &tmp, 4); ptr += 4;
6964 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6965 
6966 		memcpy(ptr, &depth, 4); ptr += 4;
6967 
6968 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6969 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6970 
6971 }
6972 
glTexGenfOES_enc(void * self,GLenum coord,GLenum pname,GLfloat param)6973 void glTexGenfOES_enc(void *self , GLenum coord, GLenum pname, GLfloat param)
6974 {
6975 
6976 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
6977 	IOStream *stream = ctx->m_stream;
6978 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
6979 	bool useChecksum = checksumCalculator->getVersion() > 0;
6980 
6981 	 unsigned char *ptr;
6982 	 unsigned char *buf;
6983 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
6984 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
6985 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
6986 	buf = stream->alloc(totalSize);
6987 	ptr = buf;
6988 	int tmp = OP_glTexGenfOES;memcpy(ptr, &tmp, 4); ptr += 4;
6989 	memcpy(ptr, &totalSize, 4);  ptr += 4;
6990 
6991 		memcpy(ptr, &coord, 4); ptr += 4;
6992 		memcpy(ptr, &pname, 4); ptr += 4;
6993 		memcpy(ptr, &param, 4); ptr += 4;
6994 
6995 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
6996 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
6997 
6998 }
6999 
glTexGenfvOES_enc(void * self,GLenum coord,GLenum pname,const GLfloat * params)7000 void glTexGenfvOES_enc(void *self , GLenum coord, GLenum pname, const GLfloat* params)
7001 {
7002 
7003 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7004 	IOStream *stream = ctx->m_stream;
7005 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7006 	bool useChecksum = checksumCalculator->getVersion() > 0;
7007 
7008 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
7009 	 unsigned char *ptr;
7010 	 unsigned char *buf;
7011 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
7012 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7013 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7014 	buf = stream->alloc(totalSize);
7015 	ptr = buf;
7016 	int tmp = OP_glTexGenfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
7017 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7018 
7019 		memcpy(ptr, &coord, 4); ptr += 4;
7020 		memcpy(ptr, &pname, 4); ptr += 4;
7021 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
7022 	memcpy(ptr, params, __size_params);ptr += __size_params;
7023 
7024 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7025 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7026 
7027 }
7028 
glTexGeniOES_enc(void * self,GLenum coord,GLenum pname,GLint param)7029 void glTexGeniOES_enc(void *self , GLenum coord, GLenum pname, GLint param)
7030 {
7031 
7032 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7033 	IOStream *stream = ctx->m_stream;
7034 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7035 	bool useChecksum = checksumCalculator->getVersion() > 0;
7036 
7037 	 unsigned char *ptr;
7038 	 unsigned char *buf;
7039 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
7040 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7041 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7042 	buf = stream->alloc(totalSize);
7043 	ptr = buf;
7044 	int tmp = OP_glTexGeniOES;memcpy(ptr, &tmp, 4); ptr += 4;
7045 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7046 
7047 		memcpy(ptr, &coord, 4); ptr += 4;
7048 		memcpy(ptr, &pname, 4); ptr += 4;
7049 		memcpy(ptr, &param, 4); ptr += 4;
7050 
7051 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7052 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7053 
7054 }
7055 
glTexGenivOES_enc(void * self,GLenum coord,GLenum pname,const GLint * params)7056 void glTexGenivOES_enc(void *self , GLenum coord, GLenum pname, const GLint* params)
7057 {
7058 
7059 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7060 	IOStream *stream = ctx->m_stream;
7061 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7062 	bool useChecksum = checksumCalculator->getVersion() > 0;
7063 
7064 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
7065 	 unsigned char *ptr;
7066 	 unsigned char *buf;
7067 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
7068 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7069 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7070 	buf = stream->alloc(totalSize);
7071 	ptr = buf;
7072 	int tmp = OP_glTexGenivOES;memcpy(ptr, &tmp, 4); ptr += 4;
7073 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7074 
7075 		memcpy(ptr, &coord, 4); ptr += 4;
7076 		memcpy(ptr, &pname, 4); ptr += 4;
7077 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
7078 	memcpy(ptr, params, __size_params);ptr += __size_params;
7079 
7080 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7081 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7082 
7083 }
7084 
glTexGenxOES_enc(void * self,GLenum coord,GLenum pname,GLfixed param)7085 void glTexGenxOES_enc(void *self , GLenum coord, GLenum pname, GLfixed param)
7086 {
7087 
7088 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7089 	IOStream *stream = ctx->m_stream;
7090 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7091 	bool useChecksum = checksumCalculator->getVersion() > 0;
7092 
7093 	 unsigned char *ptr;
7094 	 unsigned char *buf;
7095 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
7096 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7097 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7098 	buf = stream->alloc(totalSize);
7099 	ptr = buf;
7100 	int tmp = OP_glTexGenxOES;memcpy(ptr, &tmp, 4); ptr += 4;
7101 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7102 
7103 		memcpy(ptr, &coord, 4); ptr += 4;
7104 		memcpy(ptr, &pname, 4); ptr += 4;
7105 		memcpy(ptr, &param, 4); ptr += 4;
7106 
7107 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7108 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7109 
7110 }
7111 
glTexGenxvOES_enc(void * self,GLenum coord,GLenum pname,const GLfixed * params)7112 void glTexGenxvOES_enc(void *self , GLenum coord, GLenum pname, const GLfixed* params)
7113 {
7114 
7115 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7116 	IOStream *stream = ctx->m_stream;
7117 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7118 	bool useChecksum = checksumCalculator->getVersion() > 0;
7119 
7120 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
7121 	 unsigned char *ptr;
7122 	 unsigned char *buf;
7123 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
7124 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7125 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7126 	buf = stream->alloc(totalSize);
7127 	ptr = buf;
7128 	int tmp = OP_glTexGenxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
7129 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7130 
7131 		memcpy(ptr, &coord, 4); ptr += 4;
7132 		memcpy(ptr, &pname, 4); ptr += 4;
7133 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
7134 	memcpy(ptr, params, __size_params);ptr += __size_params;
7135 
7136 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7137 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7138 
7139 }
7140 
glGetTexGenfvOES_enc(void * self,GLenum coord,GLenum pname,GLfloat * params)7141 void glGetTexGenfvOES_enc(void *self , GLenum coord, GLenum pname, GLfloat* params)
7142 {
7143 
7144 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7145 	IOStream *stream = ctx->m_stream;
7146 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7147 	bool useChecksum = checksumCalculator->getVersion() > 0;
7148 
7149 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
7150 	 unsigned char *ptr;
7151 	 unsigned char *buf;
7152 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
7153 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7154 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7155 	buf = stream->alloc(totalSize);
7156 	ptr = buf;
7157 	int tmp = OP_glGetTexGenfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
7158 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7159 
7160 		memcpy(ptr, &coord, 4); ptr += 4;
7161 		memcpy(ptr, &pname, 4); ptr += 4;
7162 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
7163 	memcpy(ptr, params, __size_params);ptr += __size_params;
7164 
7165 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7166 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7167 
7168 }
7169 
glGetTexGenivOES_enc(void * self,GLenum coord,GLenum pname,GLint * params)7170 void glGetTexGenivOES_enc(void *self , GLenum coord, GLenum pname, GLint* params)
7171 {
7172 
7173 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7174 	IOStream *stream = ctx->m_stream;
7175 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7176 	bool useChecksum = checksumCalculator->getVersion() > 0;
7177 
7178 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
7179 	 unsigned char *ptr;
7180 	 unsigned char *buf;
7181 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
7182 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7183 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7184 	buf = stream->alloc(totalSize);
7185 	ptr = buf;
7186 	int tmp = OP_glGetTexGenivOES;memcpy(ptr, &tmp, 4); ptr += 4;
7187 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7188 
7189 		memcpy(ptr, &coord, 4); ptr += 4;
7190 		memcpy(ptr, &pname, 4); ptr += 4;
7191 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
7192 	memcpy(ptr, params, __size_params);ptr += __size_params;
7193 
7194 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7195 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7196 
7197 }
7198 
glGetTexGenxvOES_enc(void * self,GLenum coord,GLenum pname,GLfixed * params)7199 void glGetTexGenxvOES_enc(void *self , GLenum coord, GLenum pname, GLfixed* params)
7200 {
7201 
7202 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7203 	IOStream *stream = ctx->m_stream;
7204 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7205 	bool useChecksum = checksumCalculator->getVersion() > 0;
7206 
7207 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
7208 	 unsigned char *ptr;
7209 	 unsigned char *buf;
7210 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
7211 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7212 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7213 	buf = stream->alloc(totalSize);
7214 	ptr = buf;
7215 	int tmp = OP_glGetTexGenxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
7216 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7217 
7218 		memcpy(ptr, &coord, 4); ptr += 4;
7219 		memcpy(ptr, &pname, 4); ptr += 4;
7220 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
7221 	memcpy(ptr, params, __size_params);ptr += __size_params;
7222 
7223 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7224 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7225 
7226 }
7227 
glBindVertexArrayOES_enc(void * self,GLuint array)7228 void glBindVertexArrayOES_enc(void *self , GLuint array)
7229 {
7230 
7231 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7232 	IOStream *stream = ctx->m_stream;
7233 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7234 	bool useChecksum = checksumCalculator->getVersion() > 0;
7235 
7236 	 unsigned char *ptr;
7237 	 unsigned char *buf;
7238 	 const size_t sizeWithoutChecksum = 8 + 4;
7239 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7240 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7241 	buf = stream->alloc(totalSize);
7242 	ptr = buf;
7243 	int tmp = OP_glBindVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
7244 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7245 
7246 		memcpy(ptr, &array, 4); ptr += 4;
7247 
7248 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7249 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7250 
7251 }
7252 
glDeleteVertexArraysOES_enc(void * self,GLsizei n,const GLuint * arrays)7253 void glDeleteVertexArraysOES_enc(void *self , GLsizei n, const GLuint* arrays)
7254 {
7255 
7256 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7257 	IOStream *stream = ctx->m_stream;
7258 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7259 	bool useChecksum = checksumCalculator->getVersion() > 0;
7260 
7261 	const unsigned int __size_arrays =  (n * sizeof(GLuint));
7262 	 unsigned char *ptr;
7263 	 unsigned char *buf;
7264 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_arrays + 1*4;
7265 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7266 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7267 	buf = stream->alloc(totalSize);
7268 	ptr = buf;
7269 	int tmp = OP_glDeleteVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
7270 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7271 
7272 		memcpy(ptr, &n, 4); ptr += 4;
7273 	*(unsigned int *)(ptr) = __size_arrays; ptr += 4;
7274 	memcpy(ptr, arrays, __size_arrays);ptr += __size_arrays;
7275 
7276 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7277 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7278 
7279 }
7280 
glGenVertexArraysOES_enc(void * self,GLsizei n,GLuint * arrays)7281 void glGenVertexArraysOES_enc(void *self , GLsizei n, GLuint* arrays)
7282 {
7283 
7284 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7285 	IOStream *stream = ctx->m_stream;
7286 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7287 	bool useChecksum = checksumCalculator->getVersion() > 0;
7288 
7289 	const unsigned int __size_arrays =  (n * sizeof(GLuint));
7290 	 unsigned char *ptr;
7291 	 unsigned char *buf;
7292 	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
7293 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7294 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7295 	buf = stream->alloc(totalSize);
7296 	ptr = buf;
7297 	int tmp = OP_glGenVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
7298 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7299 
7300 		memcpy(ptr, &n, 4); ptr += 4;
7301 	*(unsigned int *)(ptr) = __size_arrays; ptr += 4;
7302 
7303 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7304 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7305 
7306 	stream->readback(arrays, __size_arrays);
7307 	if (useChecksum) checksumCalculator->addBuffer(arrays, __size_arrays);
7308 	if (useChecksum) {
7309 		unsigned char *checksumBufPtr = NULL;
7310 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7311 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7312 		stream->readback(checksumBufPtr, checksumSize);
7313 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7314 			ALOGE("glGenVertexArraysOES: GL communication error, please report this issue to b.android.com.\n");
7315 			abort();
7316 		}
7317 	}
7318 }
7319 
glIsVertexArrayOES_enc(void * self,GLuint array)7320 GLboolean glIsVertexArrayOES_enc(void *self , GLuint array)
7321 {
7322 
7323 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7324 	IOStream *stream = ctx->m_stream;
7325 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7326 	bool useChecksum = checksumCalculator->getVersion() > 0;
7327 
7328 	 unsigned char *ptr;
7329 	 unsigned char *buf;
7330 	 const size_t sizeWithoutChecksum = 8 + 4;
7331 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7332 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7333 	buf = stream->alloc(totalSize);
7334 	ptr = buf;
7335 	int tmp = OP_glIsVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
7336 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7337 
7338 		memcpy(ptr, &array, 4); ptr += 4;
7339 
7340 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7341 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7342 
7343 
7344 	GLboolean retval;
7345 	stream->readback(&retval, 1);
7346 	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
7347 	if (useChecksum) {
7348 		unsigned char *checksumBufPtr = NULL;
7349 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7350 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7351 		stream->readback(checksumBufPtr, checksumSize);
7352 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7353 			ALOGE("glIsVertexArrayOES: GL communication error, please report this issue to b.android.com.\n");
7354 			abort();
7355 		}
7356 	}
7357 	return retval;
7358 }
7359 
glDiscardFramebufferEXT_enc(void * self,GLenum target,GLsizei numAttachments,const GLenum * attachments)7360 void glDiscardFramebufferEXT_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments)
7361 {
7362 
7363 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7364 	IOStream *stream = ctx->m_stream;
7365 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7366 	bool useChecksum = checksumCalculator->getVersion() > 0;
7367 
7368 	const unsigned int __size_attachments =  (numAttachments * sizeof(const GLenum));
7369 	 unsigned char *ptr;
7370 	 unsigned char *buf;
7371 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_attachments + 1*4;
7372 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7373 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7374 	buf = stream->alloc(totalSize);
7375 	ptr = buf;
7376 	int tmp = OP_glDiscardFramebufferEXT;memcpy(ptr, &tmp, 4); ptr += 4;
7377 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7378 
7379 		memcpy(ptr, &target, 4); ptr += 4;
7380 		memcpy(ptr, &numAttachments, 4); ptr += 4;
7381 	*(unsigned int *)(ptr) = __size_attachments; ptr += 4;
7382 	memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
7383 
7384 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7385 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7386 
7387 }
7388 
glRenderbufferStorageMultisampleIMG_enc(void * self,GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height)7389 void glRenderbufferStorageMultisampleIMG_enc(void *self , GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
7390 {
7391 
7392 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7393 	IOStream *stream = ctx->m_stream;
7394 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7395 	bool useChecksum = checksumCalculator->getVersion() > 0;
7396 
7397 	 unsigned char *ptr;
7398 	 unsigned char *buf;
7399 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
7400 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7401 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7402 	buf = stream->alloc(totalSize);
7403 	ptr = buf;
7404 	int tmp = OP_glRenderbufferStorageMultisampleIMG;memcpy(ptr, &tmp, 4); ptr += 4;
7405 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7406 
7407 		memcpy(ptr, &target, 4); ptr += 4;
7408 		memcpy(ptr, &samples, 4); ptr += 4;
7409 		memcpy(ptr, &internalformat, 4); ptr += 4;
7410 		memcpy(ptr, &width, 4); ptr += 4;
7411 		memcpy(ptr, &height, 4); ptr += 4;
7412 
7413 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7414 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7415 
7416 }
7417 
glFramebufferTexture2DMultisampleIMG_enc(void * self,GLenum target,GLenum attachment,GLenum textarget,GLuint texture,GLint level,GLsizei samples)7418 void glFramebufferTexture2DMultisampleIMG_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
7419 {
7420 
7421 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7422 	IOStream *stream = ctx->m_stream;
7423 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7424 	bool useChecksum = checksumCalculator->getVersion() > 0;
7425 
7426 	 unsigned char *ptr;
7427 	 unsigned char *buf;
7428 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
7429 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7430 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7431 	buf = stream->alloc(totalSize);
7432 	ptr = buf;
7433 	int tmp = OP_glFramebufferTexture2DMultisampleIMG;memcpy(ptr, &tmp, 4); ptr += 4;
7434 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7435 
7436 		memcpy(ptr, &target, 4); ptr += 4;
7437 		memcpy(ptr, &attachment, 4); ptr += 4;
7438 		memcpy(ptr, &textarget, 4); ptr += 4;
7439 		memcpy(ptr, &texture, 4); ptr += 4;
7440 		memcpy(ptr, &level, 4); ptr += 4;
7441 		memcpy(ptr, &samples, 4); ptr += 4;
7442 
7443 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7444 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7445 
7446 }
7447 
glDeleteFencesNV_enc(void * self,GLsizei n,const GLuint * fences)7448 void glDeleteFencesNV_enc(void *self , GLsizei n, const GLuint* fences)
7449 {
7450 
7451 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7452 	IOStream *stream = ctx->m_stream;
7453 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7454 	bool useChecksum = checksumCalculator->getVersion() > 0;
7455 
7456 	const unsigned int __size_fences =  (n * sizeof(GLuint));
7457 	 unsigned char *ptr;
7458 	 unsigned char *buf;
7459 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_fences + 1*4;
7460 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7461 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7462 	buf = stream->alloc(totalSize);
7463 	ptr = buf;
7464 	int tmp = OP_glDeleteFencesNV;memcpy(ptr, &tmp, 4); ptr += 4;
7465 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7466 
7467 		memcpy(ptr, &n, 4); ptr += 4;
7468 	*(unsigned int *)(ptr) = __size_fences; ptr += 4;
7469 	memcpy(ptr, fences, __size_fences);ptr += __size_fences;
7470 
7471 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7472 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7473 
7474 }
7475 
glGenFencesNV_enc(void * self,GLsizei n,GLuint * fences)7476 void glGenFencesNV_enc(void *self , GLsizei n, GLuint* fences)
7477 {
7478 
7479 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7480 	IOStream *stream = ctx->m_stream;
7481 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7482 	bool useChecksum = checksumCalculator->getVersion() > 0;
7483 
7484 	const unsigned int __size_fences =  (n * sizeof(GLuint));
7485 	 unsigned char *ptr;
7486 	 unsigned char *buf;
7487 	 const size_t sizeWithoutChecksum = 8 + 4 + __size_fences + 1*4;
7488 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7489 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7490 	buf = stream->alloc(totalSize);
7491 	ptr = buf;
7492 	int tmp = OP_glGenFencesNV;memcpy(ptr, &tmp, 4); ptr += 4;
7493 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7494 
7495 		memcpy(ptr, &n, 4); ptr += 4;
7496 	*(unsigned int *)(ptr) = __size_fences; ptr += 4;
7497 	memcpy(ptr, fences, __size_fences);ptr += __size_fences;
7498 
7499 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7500 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7501 
7502 }
7503 
glIsFenceNV_enc(void * self,GLuint fence)7504 GLboolean glIsFenceNV_enc(void *self , GLuint fence)
7505 {
7506 
7507 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7508 	IOStream *stream = ctx->m_stream;
7509 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7510 	bool useChecksum = checksumCalculator->getVersion() > 0;
7511 
7512 	 unsigned char *ptr;
7513 	 unsigned char *buf;
7514 	 const size_t sizeWithoutChecksum = 8 + 4;
7515 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7516 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7517 	buf = stream->alloc(totalSize);
7518 	ptr = buf;
7519 	int tmp = OP_glIsFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
7520 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7521 
7522 		memcpy(ptr, &fence, 4); ptr += 4;
7523 
7524 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7525 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7526 
7527 
7528 	GLboolean retval;
7529 	stream->readback(&retval, 1);
7530 	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
7531 	if (useChecksum) {
7532 		unsigned char *checksumBufPtr = NULL;
7533 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7534 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7535 		stream->readback(checksumBufPtr, checksumSize);
7536 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7537 			ALOGE("glIsFenceNV: GL communication error, please report this issue to b.android.com.\n");
7538 			abort();
7539 		}
7540 	}
7541 	return retval;
7542 }
7543 
glTestFenceNV_enc(void * self,GLuint fence)7544 GLboolean glTestFenceNV_enc(void *self , GLuint fence)
7545 {
7546 
7547 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7548 	IOStream *stream = ctx->m_stream;
7549 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7550 	bool useChecksum = checksumCalculator->getVersion() > 0;
7551 
7552 	 unsigned char *ptr;
7553 	 unsigned char *buf;
7554 	 const size_t sizeWithoutChecksum = 8 + 4;
7555 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7556 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7557 	buf = stream->alloc(totalSize);
7558 	ptr = buf;
7559 	int tmp = OP_glTestFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
7560 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7561 
7562 		memcpy(ptr, &fence, 4); ptr += 4;
7563 
7564 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7565 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7566 
7567 
7568 	GLboolean retval;
7569 	stream->readback(&retval, 1);
7570 	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
7571 	if (useChecksum) {
7572 		unsigned char *checksumBufPtr = NULL;
7573 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7574 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7575 		stream->readback(checksumBufPtr, checksumSize);
7576 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7577 			ALOGE("glTestFenceNV: GL communication error, please report this issue to b.android.com.\n");
7578 			abort();
7579 		}
7580 	}
7581 	return retval;
7582 }
7583 
glGetFenceivNV_enc(void * self,GLuint fence,GLenum pname,GLint * params)7584 void glGetFenceivNV_enc(void *self , GLuint fence, GLenum pname, GLint* params)
7585 {
7586 
7587 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7588 	IOStream *stream = ctx->m_stream;
7589 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7590 	bool useChecksum = checksumCalculator->getVersion() > 0;
7591 
7592 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
7593 	 unsigned char *ptr;
7594 	 unsigned char *buf;
7595 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
7596 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7597 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7598 	buf = stream->alloc(totalSize);
7599 	ptr = buf;
7600 	int tmp = OP_glGetFenceivNV;memcpy(ptr, &tmp, 4); ptr += 4;
7601 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7602 
7603 		memcpy(ptr, &fence, 4); ptr += 4;
7604 		memcpy(ptr, &pname, 4); ptr += 4;
7605 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
7606 
7607 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7608 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7609 
7610 	stream->readback(params, __size_params);
7611 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
7612 	if (useChecksum) {
7613 		unsigned char *checksumBufPtr = NULL;
7614 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7615 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7616 		stream->readback(checksumBufPtr, checksumSize);
7617 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7618 			ALOGE("glGetFenceivNV: GL communication error, please report this issue to b.android.com.\n");
7619 			abort();
7620 		}
7621 	}
7622 }
7623 
glFinishFenceNV_enc(void * self,GLuint fence)7624 void glFinishFenceNV_enc(void *self , GLuint fence)
7625 {
7626 
7627 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7628 	IOStream *stream = ctx->m_stream;
7629 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7630 	bool useChecksum = checksumCalculator->getVersion() > 0;
7631 
7632 	 unsigned char *ptr;
7633 	 unsigned char *buf;
7634 	 const size_t sizeWithoutChecksum = 8 + 4;
7635 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7636 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7637 	buf = stream->alloc(totalSize);
7638 	ptr = buf;
7639 	int tmp = OP_glFinishFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
7640 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7641 
7642 		memcpy(ptr, &fence, 4); ptr += 4;
7643 
7644 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7645 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7646 
7647 }
7648 
glSetFenceNV_enc(void * self,GLuint fence,GLenum condition)7649 void glSetFenceNV_enc(void *self , GLuint fence, GLenum condition)
7650 {
7651 
7652 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7653 	IOStream *stream = ctx->m_stream;
7654 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7655 	bool useChecksum = checksumCalculator->getVersion() > 0;
7656 
7657 	 unsigned char *ptr;
7658 	 unsigned char *buf;
7659 	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
7660 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7661 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7662 	buf = stream->alloc(totalSize);
7663 	ptr = buf;
7664 	int tmp = OP_glSetFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
7665 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7666 
7667 		memcpy(ptr, &fence, 4); ptr += 4;
7668 		memcpy(ptr, &condition, 4); ptr += 4;
7669 
7670 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7671 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7672 
7673 }
7674 
glGetDriverControlsQCOM_enc(void * self,GLint * num,GLsizei size,GLuint * driverControls)7675 void glGetDriverControlsQCOM_enc(void *self , GLint* num, GLsizei size, GLuint* driverControls)
7676 {
7677 
7678 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7679 	IOStream *stream = ctx->m_stream;
7680 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7681 	bool useChecksum = checksumCalculator->getVersion() > 0;
7682 
7683 	const unsigned int __size_num =  (1 * sizeof(GLint));
7684 	const unsigned int __size_driverControls =  (size * sizeof(GLuint));
7685 	 unsigned char *ptr;
7686 	 unsigned char *buf;
7687 	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
7688 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7689 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7690 	buf = stream->alloc(totalSize);
7691 	ptr = buf;
7692 	int tmp = OP_glGetDriverControlsQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
7693 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7694 
7695 	*(unsigned int *)(ptr) = __size_num; ptr += 4;
7696 		memcpy(ptr, &size, 4); ptr += 4;
7697 	*(unsigned int *)(ptr) = __size_driverControls; ptr += 4;
7698 
7699 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7700 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7701 
7702 	stream->readback(num, __size_num);
7703 	if (useChecksum) checksumCalculator->addBuffer(num, __size_num);
7704 	stream->readback(driverControls, __size_driverControls);
7705 	if (useChecksum) checksumCalculator->addBuffer(driverControls, __size_driverControls);
7706 	if (useChecksum) {
7707 		unsigned char *checksumBufPtr = NULL;
7708 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7709 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7710 		stream->readback(checksumBufPtr, checksumSize);
7711 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7712 			ALOGE("glGetDriverControlsQCOM: GL communication error, please report this issue to b.android.com.\n");
7713 			abort();
7714 		}
7715 	}
7716 }
7717 
glGetDriverControlStringQCOM_enc(void * self,GLuint driverControl,GLsizei bufSize,GLsizei * length,GLchar * driverControlString)7718 void glGetDriverControlStringQCOM_enc(void *self , GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString)
7719 {
7720 
7721 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7722 	IOStream *stream = ctx->m_stream;
7723 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7724 	bool useChecksum = checksumCalculator->getVersion() > 0;
7725 
7726 	const unsigned int __size_length =  (1 * sizeof(GLsizei));
7727 	const unsigned int __size_driverControlString =  (1 * sizeof(GLchar));
7728 	 unsigned char *ptr;
7729 	 unsigned char *buf;
7730 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 2*4;
7731 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7732 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7733 	buf = stream->alloc(totalSize);
7734 	ptr = buf;
7735 	int tmp = OP_glGetDriverControlStringQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
7736 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7737 
7738 		memcpy(ptr, &driverControl, 4); ptr += 4;
7739 		memcpy(ptr, &bufSize, 4); ptr += 4;
7740 	*(unsigned int *)(ptr) = __size_length; ptr += 4;
7741 	*(unsigned int *)(ptr) = __size_driverControlString; ptr += 4;
7742 
7743 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7744 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7745 
7746 	stream->readback(length, __size_length);
7747 	if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
7748 	stream->readback(driverControlString, __size_driverControlString);
7749 	if (useChecksum) checksumCalculator->addBuffer(driverControlString, __size_driverControlString);
7750 	if (useChecksum) {
7751 		unsigned char *checksumBufPtr = NULL;
7752 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7753 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7754 		stream->readback(checksumBufPtr, checksumSize);
7755 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7756 			ALOGE("glGetDriverControlStringQCOM: GL communication error, please report this issue to b.android.com.\n");
7757 			abort();
7758 		}
7759 	}
7760 }
7761 
glEnableDriverControlQCOM_enc(void * self,GLuint driverControl)7762 void glEnableDriverControlQCOM_enc(void *self , GLuint driverControl)
7763 {
7764 
7765 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7766 	IOStream *stream = ctx->m_stream;
7767 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7768 	bool useChecksum = checksumCalculator->getVersion() > 0;
7769 
7770 	 unsigned char *ptr;
7771 	 unsigned char *buf;
7772 	 const size_t sizeWithoutChecksum = 8 + 4;
7773 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7774 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7775 	buf = stream->alloc(totalSize);
7776 	ptr = buf;
7777 	int tmp = OP_glEnableDriverControlQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
7778 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7779 
7780 		memcpy(ptr, &driverControl, 4); ptr += 4;
7781 
7782 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7783 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7784 
7785 }
7786 
glDisableDriverControlQCOM_enc(void * self,GLuint driverControl)7787 void glDisableDriverControlQCOM_enc(void *self , GLuint driverControl)
7788 {
7789 
7790 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7791 	IOStream *stream = ctx->m_stream;
7792 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7793 	bool useChecksum = checksumCalculator->getVersion() > 0;
7794 
7795 	 unsigned char *ptr;
7796 	 unsigned char *buf;
7797 	 const size_t sizeWithoutChecksum = 8 + 4;
7798 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7799 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7800 	buf = stream->alloc(totalSize);
7801 	ptr = buf;
7802 	int tmp = OP_glDisableDriverControlQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
7803 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7804 
7805 		memcpy(ptr, &driverControl, 4); ptr += 4;
7806 
7807 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7808 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7809 
7810 }
7811 
glExtGetTexturesQCOM_enc(void * self,GLuint * textures,GLint maxTextures,GLint * numTextures)7812 void glExtGetTexturesQCOM_enc(void *self , GLuint* textures, GLint maxTextures, GLint* numTextures)
7813 {
7814 
7815 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7816 	IOStream *stream = ctx->m_stream;
7817 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7818 	bool useChecksum = checksumCalculator->getVersion() > 0;
7819 
7820 	const unsigned int __size_textures =  (maxTextures * sizeof(GLuint));
7821 	const unsigned int __size_numTextures =  (1 * sizeof(GLint));
7822 	 unsigned char *ptr;
7823 	 unsigned char *buf;
7824 	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
7825 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7826 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7827 	buf = stream->alloc(totalSize);
7828 	ptr = buf;
7829 	int tmp = OP_glExtGetTexturesQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
7830 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7831 
7832 	*(unsigned int *)(ptr) = __size_textures; ptr += 4;
7833 		memcpy(ptr, &maxTextures, 4); ptr += 4;
7834 	*(unsigned int *)(ptr) = __size_numTextures; ptr += 4;
7835 
7836 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7837 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7838 
7839 	stream->readback(textures, __size_textures);
7840 	if (useChecksum) checksumCalculator->addBuffer(textures, __size_textures);
7841 	stream->readback(numTextures, __size_numTextures);
7842 	if (useChecksum) checksumCalculator->addBuffer(numTextures, __size_numTextures);
7843 	if (useChecksum) {
7844 		unsigned char *checksumBufPtr = NULL;
7845 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7846 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7847 		stream->readback(checksumBufPtr, checksumSize);
7848 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7849 			ALOGE("glExtGetTexturesQCOM: GL communication error, please report this issue to b.android.com.\n");
7850 			abort();
7851 		}
7852 	}
7853 }
7854 
glExtGetBuffersQCOM_enc(void * self,GLuint * buffers,GLint maxBuffers,GLint * numBuffers)7855 void glExtGetBuffersQCOM_enc(void *self , GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
7856 {
7857 
7858 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7859 	IOStream *stream = ctx->m_stream;
7860 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7861 	bool useChecksum = checksumCalculator->getVersion() > 0;
7862 
7863 	const unsigned int __size_buffers =  (maxBuffers * sizeof(GLuint));
7864 	const unsigned int __size_numBuffers =  (1 * sizeof(GLint));
7865 	 unsigned char *ptr;
7866 	 unsigned char *buf;
7867 	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
7868 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7869 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7870 	buf = stream->alloc(totalSize);
7871 	ptr = buf;
7872 	int tmp = OP_glExtGetBuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
7873 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7874 
7875 	*(unsigned int *)(ptr) = __size_buffers; ptr += 4;
7876 		memcpy(ptr, &maxBuffers, 4); ptr += 4;
7877 	*(unsigned int *)(ptr) = __size_numBuffers; ptr += 4;
7878 
7879 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7880 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7881 
7882 	stream->readback(buffers, __size_buffers);
7883 	if (useChecksum) checksumCalculator->addBuffer(buffers, __size_buffers);
7884 	stream->readback(numBuffers, __size_numBuffers);
7885 	if (useChecksum) checksumCalculator->addBuffer(numBuffers, __size_numBuffers);
7886 	if (useChecksum) {
7887 		unsigned char *checksumBufPtr = NULL;
7888 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7889 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7890 		stream->readback(checksumBufPtr, checksumSize);
7891 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7892 			ALOGE("glExtGetBuffersQCOM: GL communication error, please report this issue to b.android.com.\n");
7893 			abort();
7894 		}
7895 	}
7896 }
7897 
glExtGetRenderbuffersQCOM_enc(void * self,GLuint * renderbuffers,GLint maxRenderbuffers,GLint * numRenderbuffers)7898 void glExtGetRenderbuffersQCOM_enc(void *self , GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
7899 {
7900 
7901 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7902 	IOStream *stream = ctx->m_stream;
7903 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7904 	bool useChecksum = checksumCalculator->getVersion() > 0;
7905 
7906 	const unsigned int __size_renderbuffers =  (maxRenderbuffers * sizeof(GLuint));
7907 	const unsigned int __size_numRenderbuffers =  (1 * sizeof(GLint));
7908 	 unsigned char *ptr;
7909 	 unsigned char *buf;
7910 	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
7911 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7912 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7913 	buf = stream->alloc(totalSize);
7914 	ptr = buf;
7915 	int tmp = OP_glExtGetRenderbuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
7916 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7917 
7918 	*(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
7919 		memcpy(ptr, &maxRenderbuffers, 4); ptr += 4;
7920 	*(unsigned int *)(ptr) = __size_numRenderbuffers; ptr += 4;
7921 
7922 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7923 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7924 
7925 	stream->readback(renderbuffers, __size_renderbuffers);
7926 	if (useChecksum) checksumCalculator->addBuffer(renderbuffers, __size_renderbuffers);
7927 	stream->readback(numRenderbuffers, __size_numRenderbuffers);
7928 	if (useChecksum) checksumCalculator->addBuffer(numRenderbuffers, __size_numRenderbuffers);
7929 	if (useChecksum) {
7930 		unsigned char *checksumBufPtr = NULL;
7931 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7932 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7933 		stream->readback(checksumBufPtr, checksumSize);
7934 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7935 			ALOGE("glExtGetRenderbuffersQCOM: GL communication error, please report this issue to b.android.com.\n");
7936 			abort();
7937 		}
7938 	}
7939 }
7940 
glExtGetFramebuffersQCOM_enc(void * self,GLuint * framebuffers,GLint maxFramebuffers,GLint * numFramebuffers)7941 void glExtGetFramebuffersQCOM_enc(void *self , GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
7942 {
7943 
7944 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7945 	IOStream *stream = ctx->m_stream;
7946 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7947 	bool useChecksum = checksumCalculator->getVersion() > 0;
7948 
7949 	const unsigned int __size_framebuffers =  (maxFramebuffers * sizeof(GLuint));
7950 	const unsigned int __size_numFramebuffers =  (1 * sizeof(GLint));
7951 	 unsigned char *ptr;
7952 	 unsigned char *buf;
7953 	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
7954 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7955 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7956 	buf = stream->alloc(totalSize);
7957 	ptr = buf;
7958 	int tmp = OP_glExtGetFramebuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
7959 	memcpy(ptr, &totalSize, 4);  ptr += 4;
7960 
7961 	*(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
7962 		memcpy(ptr, &maxFramebuffers, 4); ptr += 4;
7963 	*(unsigned int *)(ptr) = __size_numFramebuffers; ptr += 4;
7964 
7965 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
7966 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
7967 
7968 	stream->readback(framebuffers, __size_framebuffers);
7969 	if (useChecksum) checksumCalculator->addBuffer(framebuffers, __size_framebuffers);
7970 	stream->readback(numFramebuffers, __size_numFramebuffers);
7971 	if (useChecksum) checksumCalculator->addBuffer(numFramebuffers, __size_numFramebuffers);
7972 	if (useChecksum) {
7973 		unsigned char *checksumBufPtr = NULL;
7974 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
7975 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
7976 		stream->readback(checksumBufPtr, checksumSize);
7977 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
7978 			ALOGE("glExtGetFramebuffersQCOM: GL communication error, please report this issue to b.android.com.\n");
7979 			abort();
7980 		}
7981 	}
7982 }
7983 
glExtGetTexLevelParameterivQCOM_enc(void * self,GLuint texture,GLenum face,GLint level,GLenum pname,GLint * params)7984 void glExtGetTexLevelParameterivQCOM_enc(void *self , GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
7985 {
7986 
7987 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
7988 	IOStream *stream = ctx->m_stream;
7989 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
7990 	bool useChecksum = checksumCalculator->getVersion() > 0;
7991 
7992 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
7993 	 unsigned char *ptr;
7994 	 unsigned char *buf;
7995 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 0 + 1*4;
7996 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
7997 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
7998 	buf = stream->alloc(totalSize);
7999 	ptr = buf;
8000 	int tmp = OP_glExtGetTexLevelParameterivQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
8001 	memcpy(ptr, &totalSize, 4);  ptr += 4;
8002 
8003 		memcpy(ptr, &texture, 4); ptr += 4;
8004 		memcpy(ptr, &face, 4); ptr += 4;
8005 		memcpy(ptr, &level, 4); ptr += 4;
8006 		memcpy(ptr, &pname, 4); ptr += 4;
8007 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
8008 
8009 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
8010 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
8011 
8012 	stream->readback(params, __size_params);
8013 	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
8014 	if (useChecksum) {
8015 		unsigned char *checksumBufPtr = NULL;
8016 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
8017 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
8018 		stream->readback(checksumBufPtr, checksumSize);
8019 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
8020 			ALOGE("glExtGetTexLevelParameterivQCOM: GL communication error, please report this issue to b.android.com.\n");
8021 			abort();
8022 		}
8023 	}
8024 }
8025 
glExtTexObjectStateOverrideiQCOM_enc(void * self,GLenum target,GLenum pname,GLint param)8026 void glExtTexObjectStateOverrideiQCOM_enc(void *self , GLenum target, GLenum pname, GLint param)
8027 {
8028 
8029 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
8030 	IOStream *stream = ctx->m_stream;
8031 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
8032 	bool useChecksum = checksumCalculator->getVersion() > 0;
8033 
8034 	 unsigned char *ptr;
8035 	 unsigned char *buf;
8036 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
8037 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
8038 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
8039 	buf = stream->alloc(totalSize);
8040 	ptr = buf;
8041 	int tmp = OP_glExtTexObjectStateOverrideiQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
8042 	memcpy(ptr, &totalSize, 4);  ptr += 4;
8043 
8044 		memcpy(ptr, &target, 4); ptr += 4;
8045 		memcpy(ptr, &pname, 4); ptr += 4;
8046 		memcpy(ptr, &param, 4); ptr += 4;
8047 
8048 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
8049 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
8050 
8051 }
8052 
glExtGetTexSubImageQCOM_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,GLvoid * texels)8053 void glExtGetTexSubImageQCOM_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels)
8054 {
8055 
8056 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
8057 	IOStream *stream = ctx->m_stream;
8058 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
8059 	bool useChecksum = checksumCalculator->getVersion() > 0;
8060 
8061 	const unsigned int __size_texels =  (depth * glesv1_enc::pixelDataSize(self, width, height, format, type, 0));
8062 	 unsigned char *ptr;
8063 	 unsigned char *buf;
8064 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 0 + 1*4;
8065 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
8066 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
8067 	buf = stream->alloc(totalSize);
8068 	ptr = buf;
8069 	int tmp = OP_glExtGetTexSubImageQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
8070 	memcpy(ptr, &totalSize, 4);  ptr += 4;
8071 
8072 		memcpy(ptr, &target, 4); ptr += 4;
8073 		memcpy(ptr, &level, 4); ptr += 4;
8074 		memcpy(ptr, &xoffset, 4); ptr += 4;
8075 		memcpy(ptr, &yoffset, 4); ptr += 4;
8076 		memcpy(ptr, &zoffset, 4); ptr += 4;
8077 		memcpy(ptr, &width, 4); ptr += 4;
8078 		memcpy(ptr, &height, 4); ptr += 4;
8079 		memcpy(ptr, &depth, 4); ptr += 4;
8080 		memcpy(ptr, &format, 4); ptr += 4;
8081 		memcpy(ptr, &type, 4); ptr += 4;
8082 	*(unsigned int *)(ptr) = __size_texels; ptr += 4;
8083 
8084 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
8085 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
8086 
8087 	stream->readback(texels, __size_texels);
8088 	if (useChecksum) checksumCalculator->addBuffer(texels, __size_texels);
8089 	if (useChecksum) {
8090 		unsigned char *checksumBufPtr = NULL;
8091 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
8092 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
8093 		stream->readback(checksumBufPtr, checksumSize);
8094 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
8095 			ALOGE("glExtGetTexSubImageQCOM: GL communication error, please report this issue to b.android.com.\n");
8096 			abort();
8097 		}
8098 	}
8099 }
8100 
glExtGetShadersQCOM_enc(void * self,GLuint * shaders,GLint maxShaders,GLint * numShaders)8101 void glExtGetShadersQCOM_enc(void *self , GLuint* shaders, GLint maxShaders, GLint* numShaders)
8102 {
8103 
8104 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
8105 	IOStream *stream = ctx->m_stream;
8106 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
8107 	bool useChecksum = checksumCalculator->getVersion() > 0;
8108 
8109 	const unsigned int __size_shaders =  (maxShaders * sizeof(GLuint));
8110 	const unsigned int __size_numShaders =  (1 * sizeof(GLint));
8111 	 unsigned char *ptr;
8112 	 unsigned char *buf;
8113 	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
8114 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
8115 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
8116 	buf = stream->alloc(totalSize);
8117 	ptr = buf;
8118 	int tmp = OP_glExtGetShadersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
8119 	memcpy(ptr, &totalSize, 4);  ptr += 4;
8120 
8121 	*(unsigned int *)(ptr) = __size_shaders; ptr += 4;
8122 		memcpy(ptr, &maxShaders, 4); ptr += 4;
8123 	*(unsigned int *)(ptr) = __size_numShaders; ptr += 4;
8124 
8125 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
8126 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
8127 
8128 	stream->readback(shaders, __size_shaders);
8129 	if (useChecksum) checksumCalculator->addBuffer(shaders, __size_shaders);
8130 	stream->readback(numShaders, __size_numShaders);
8131 	if (useChecksum) checksumCalculator->addBuffer(numShaders, __size_numShaders);
8132 	if (useChecksum) {
8133 		unsigned char *checksumBufPtr = NULL;
8134 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
8135 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
8136 		stream->readback(checksumBufPtr, checksumSize);
8137 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
8138 			ALOGE("glExtGetShadersQCOM: GL communication error, please report this issue to b.android.com.\n");
8139 			abort();
8140 		}
8141 	}
8142 }
8143 
glExtGetProgramsQCOM_enc(void * self,GLuint * programs,GLint maxPrograms,GLint * numPrograms)8144 void glExtGetProgramsQCOM_enc(void *self , GLuint* programs, GLint maxPrograms, GLint* numPrograms)
8145 {
8146 
8147 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
8148 	IOStream *stream = ctx->m_stream;
8149 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
8150 	bool useChecksum = checksumCalculator->getVersion() > 0;
8151 
8152 	const unsigned int __size_programs =  (maxPrograms * sizeof(GLuint));
8153 	const unsigned int __size_numPrograms =  (1 * sizeof(GLint));
8154 	 unsigned char *ptr;
8155 	 unsigned char *buf;
8156 	 const size_t sizeWithoutChecksum = 8 + 0 + 4 + 0 + 2*4;
8157 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
8158 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
8159 	buf = stream->alloc(totalSize);
8160 	ptr = buf;
8161 	int tmp = OP_glExtGetProgramsQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
8162 	memcpy(ptr, &totalSize, 4);  ptr += 4;
8163 
8164 	*(unsigned int *)(ptr) = __size_programs; ptr += 4;
8165 		memcpy(ptr, &maxPrograms, 4); ptr += 4;
8166 	*(unsigned int *)(ptr) = __size_numPrograms; ptr += 4;
8167 
8168 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
8169 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
8170 
8171 	stream->readback(programs, __size_programs);
8172 	if (useChecksum) checksumCalculator->addBuffer(programs, __size_programs);
8173 	stream->readback(numPrograms, __size_numPrograms);
8174 	if (useChecksum) checksumCalculator->addBuffer(numPrograms, __size_numPrograms);
8175 	if (useChecksum) {
8176 		unsigned char *checksumBufPtr = NULL;
8177 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
8178 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
8179 		stream->readback(checksumBufPtr, checksumSize);
8180 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
8181 			ALOGE("glExtGetProgramsQCOM: GL communication error, please report this issue to b.android.com.\n");
8182 			abort();
8183 		}
8184 	}
8185 }
8186 
glExtIsProgramBinaryQCOM_enc(void * self,GLuint program)8187 GLboolean glExtIsProgramBinaryQCOM_enc(void *self , GLuint program)
8188 {
8189 
8190 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
8191 	IOStream *stream = ctx->m_stream;
8192 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
8193 	bool useChecksum = checksumCalculator->getVersion() > 0;
8194 
8195 	 unsigned char *ptr;
8196 	 unsigned char *buf;
8197 	 const size_t sizeWithoutChecksum = 8 + 4;
8198 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
8199 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
8200 	buf = stream->alloc(totalSize);
8201 	ptr = buf;
8202 	int tmp = OP_glExtIsProgramBinaryQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
8203 	memcpy(ptr, &totalSize, 4);  ptr += 4;
8204 
8205 		memcpy(ptr, &program, 4); ptr += 4;
8206 
8207 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
8208 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
8209 
8210 
8211 	GLboolean retval;
8212 	stream->readback(&retval, 1);
8213 	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
8214 	if (useChecksum) {
8215 		unsigned char *checksumBufPtr = NULL;
8216 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
8217 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
8218 		stream->readback(checksumBufPtr, checksumSize);
8219 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
8220 			ALOGE("glExtIsProgramBinaryQCOM: GL communication error, please report this issue to b.android.com.\n");
8221 			abort();
8222 		}
8223 	}
8224 	return retval;
8225 }
8226 
glStartTilingQCOM_enc(void * self,GLuint x,GLuint y,GLuint width,GLuint height,GLbitfield preserveMask)8227 void glStartTilingQCOM_enc(void *self , GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
8228 {
8229 
8230 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
8231 	IOStream *stream = ctx->m_stream;
8232 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
8233 	bool useChecksum = checksumCalculator->getVersion() > 0;
8234 
8235 	 unsigned char *ptr;
8236 	 unsigned char *buf;
8237 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
8238 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
8239 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
8240 	buf = stream->alloc(totalSize);
8241 	ptr = buf;
8242 	int tmp = OP_glStartTilingQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
8243 	memcpy(ptr, &totalSize, 4);  ptr += 4;
8244 
8245 		memcpy(ptr, &x, 4); ptr += 4;
8246 		memcpy(ptr, &y, 4); ptr += 4;
8247 		memcpy(ptr, &width, 4); ptr += 4;
8248 		memcpy(ptr, &height, 4); ptr += 4;
8249 		memcpy(ptr, &preserveMask, 4); ptr += 4;
8250 
8251 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
8252 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
8253 
8254 }
8255 
glEndTilingQCOM_enc(void * self,GLbitfield preserveMask)8256 void glEndTilingQCOM_enc(void *self , GLbitfield preserveMask)
8257 {
8258 
8259 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
8260 	IOStream *stream = ctx->m_stream;
8261 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
8262 	bool useChecksum = checksumCalculator->getVersion() > 0;
8263 
8264 	 unsigned char *ptr;
8265 	 unsigned char *buf;
8266 	 const size_t sizeWithoutChecksum = 8 + 4;
8267 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
8268 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
8269 	buf = stream->alloc(totalSize);
8270 	ptr = buf;
8271 	int tmp = OP_glEndTilingQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
8272 	memcpy(ptr, &totalSize, 4);  ptr += 4;
8273 
8274 		memcpy(ptr, &preserveMask, 4); ptr += 4;
8275 
8276 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
8277 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
8278 
8279 }
8280 
glGetGraphicsResetStatusEXT_enc(void * self)8281 GLenum glGetGraphicsResetStatusEXT_enc(void *self )
8282 {
8283 
8284 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
8285 	IOStream *stream = ctx->m_stream;
8286 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
8287 	bool useChecksum = checksumCalculator->getVersion() > 0;
8288 
8289 	 unsigned char *ptr;
8290 	 unsigned char *buf;
8291 	 const size_t sizeWithoutChecksum = 8;
8292 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
8293 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
8294 	buf = stream->alloc(totalSize);
8295 	ptr = buf;
8296 	int tmp = OP_glGetGraphicsResetStatusEXT;memcpy(ptr, &tmp, 4); ptr += 4;
8297 	memcpy(ptr, &totalSize, 4);  ptr += 4;
8298 
8299 
8300 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
8301 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
8302 
8303 
8304 	GLenum retval;
8305 	stream->readback(&retval, 4);
8306 	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
8307 	if (useChecksum) {
8308 		unsigned char *checksumBufPtr = NULL;
8309 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
8310 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
8311 		stream->readback(checksumBufPtr, checksumSize);
8312 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
8313 			ALOGE("glGetGraphicsResetStatusEXT: GL communication error, please report this issue to b.android.com.\n");
8314 			abort();
8315 		}
8316 	}
8317 	return retval;
8318 }
8319 
glReadnPixelsEXT_enc(void * self,GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,GLsizei bufSize,GLvoid * data)8320 void glReadnPixelsEXT_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid* data)
8321 {
8322 
8323 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
8324 	IOStream *stream = ctx->m_stream;
8325 	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
8326 	bool useChecksum = checksumCalculator->getVersion() > 0;
8327 
8328 	const unsigned int __size_data =  bufSize;
8329 	 unsigned char *ptr;
8330 	 unsigned char *buf;
8331 	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 0 + 1*4;
8332 	 const size_t checksumSize = checksumCalculator->checksumByteSize();
8333 	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
8334 	buf = stream->alloc(totalSize);
8335 	ptr = buf;
8336 	int tmp = OP_glReadnPixelsEXT;memcpy(ptr, &tmp, 4); ptr += 4;
8337 	memcpy(ptr, &totalSize, 4);  ptr += 4;
8338 
8339 		memcpy(ptr, &x, 4); ptr += 4;
8340 		memcpy(ptr, &y, 4); ptr += 4;
8341 		memcpy(ptr, &width, 4); ptr += 4;
8342 		memcpy(ptr, &height, 4); ptr += 4;
8343 		memcpy(ptr, &format, 4); ptr += 4;
8344 		memcpy(ptr, &type, 4); ptr += 4;
8345 		memcpy(ptr, &bufSize, 4); ptr += 4;
8346 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
8347 
8348 	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
8349 	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
8350 
8351 	stream->readback(data, __size_data);
8352 	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
8353 	if (useChecksum) {
8354 		unsigned char *checksumBufPtr = NULL;
8355 		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
8356 		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
8357 		stream->readback(checksumBufPtr, checksumSize);
8358 		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
8359 			ALOGE("glReadnPixelsEXT: GL communication error, please report this issue to b.android.com.\n");
8360 			abort();
8361 		}
8362 	}
8363 }
8364 
8365 }  // namespace
8366 
gl_encoder_context_t(IOStream * stream,ChecksumCalculator * checksumCalculator)8367 gl_encoder_context_t::gl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
8368 {
8369 	m_stream = stream;
8370 	m_checksumCalculator = checksumCalculator;
8371 
8372 	this->glAlphaFunc = &glAlphaFunc_enc;
8373 	this->glClearColor = &glClearColor_enc;
8374 	this->glClearDepthf = &glClearDepthf_enc;
8375 	this->glClipPlanef = &glClipPlanef_enc;
8376 	this->glColor4f = &glColor4f_enc;
8377 	this->glDepthRangef = &glDepthRangef_enc;
8378 	this->glFogf = &glFogf_enc;
8379 	this->glFogfv = &glFogfv_enc;
8380 	this->glFrustumf = &glFrustumf_enc;
8381 	this->glGetClipPlanef = &glGetClipPlanef_enc;
8382 	this->glGetFloatv = &glGetFloatv_enc;
8383 	this->glGetLightfv = &glGetLightfv_enc;
8384 	this->glGetMaterialfv = &glGetMaterialfv_enc;
8385 	this->glGetTexEnvfv = &glGetTexEnvfv_enc;
8386 	this->glGetTexParameterfv = &glGetTexParameterfv_enc;
8387 	this->glLightModelf = &glLightModelf_enc;
8388 	this->glLightModelfv = &glLightModelfv_enc;
8389 	this->glLightf = &glLightf_enc;
8390 	this->glLightfv = &glLightfv_enc;
8391 	this->glLineWidth = &glLineWidth_enc;
8392 	this->glLoadMatrixf = &glLoadMatrixf_enc;
8393 	this->glMaterialf = &glMaterialf_enc;
8394 	this->glMaterialfv = &glMaterialfv_enc;
8395 	this->glMultMatrixf = &glMultMatrixf_enc;
8396 	this->glMultiTexCoord4f = &glMultiTexCoord4f_enc;
8397 	this->glNormal3f = &glNormal3f_enc;
8398 	this->glOrthof = &glOrthof_enc;
8399 	this->glPointParameterf = &glPointParameterf_enc;
8400 	this->glPointParameterfv = &glPointParameterfv_enc;
8401 	this->glPointSize = &glPointSize_enc;
8402 	this->glPolygonOffset = &glPolygonOffset_enc;
8403 	this->glRotatef = &glRotatef_enc;
8404 	this->glScalef = &glScalef_enc;
8405 	this->glTexEnvf = &glTexEnvf_enc;
8406 	this->glTexEnvfv = &glTexEnvfv_enc;
8407 	this->glTexParameterf = &glTexParameterf_enc;
8408 	this->glTexParameterfv = &glTexParameterfv_enc;
8409 	this->glTranslatef = &glTranslatef_enc;
8410 	this->glActiveTexture = &glActiveTexture_enc;
8411 	this->glAlphaFuncx = &glAlphaFuncx_enc;
8412 	this->glBindBuffer = &glBindBuffer_enc;
8413 	this->glBindTexture = &glBindTexture_enc;
8414 	this->glBlendFunc = &glBlendFunc_enc;
8415 	this->glBufferData = &glBufferData_enc;
8416 	this->glBufferSubData = &glBufferSubData_enc;
8417 	this->glClear = &glClear_enc;
8418 	this->glClearColorx = &glClearColorx_enc;
8419 	this->glClearDepthx = &glClearDepthx_enc;
8420 	this->glClearStencil = &glClearStencil_enc;
8421 	this->glClientActiveTexture = &glClientActiveTexture_enc;
8422 	this->glColor4ub = &glColor4ub_enc;
8423 	this->glColor4x = &glColor4x_enc;
8424 	this->glColorMask = &glColorMask_enc;
8425 	this->glColorPointer = (glColorPointer_client_proc_t) &enc_unsupported;
8426 	this->glCompressedTexImage2D = &glCompressedTexImage2D_enc;
8427 	this->glCompressedTexSubImage2D = &glCompressedTexSubImage2D_enc;
8428 	this->glCopyTexImage2D = &glCopyTexImage2D_enc;
8429 	this->glCopyTexSubImage2D = &glCopyTexSubImage2D_enc;
8430 	this->glCullFace = &glCullFace_enc;
8431 	this->glDeleteBuffers = &glDeleteBuffers_enc;
8432 	this->glDeleteTextures = &glDeleteTextures_enc;
8433 	this->glDepthFunc = &glDepthFunc_enc;
8434 	this->glDepthMask = &glDepthMask_enc;
8435 	this->glDepthRangex = &glDepthRangex_enc;
8436 	this->glDisable = &glDisable_enc;
8437 	this->glDisableClientState = &glDisableClientState_enc;
8438 	this->glDrawArrays = &glDrawArrays_enc;
8439 	this->glDrawElements = (glDrawElements_client_proc_t) &enc_unsupported;
8440 	this->glEnable = &glEnable_enc;
8441 	this->glEnableClientState = &glEnableClientState_enc;
8442 	this->glFinish = &glFinish_enc;
8443 	this->glFlush = &glFlush_enc;
8444 	this->glFogx = &glFogx_enc;
8445 	this->glFogxv = &glFogxv_enc;
8446 	this->glFrontFace = &glFrontFace_enc;
8447 	this->glFrustumx = &glFrustumx_enc;
8448 	this->glGetBooleanv = &glGetBooleanv_enc;
8449 	this->glGetBufferParameteriv = &glGetBufferParameteriv_enc;
8450 	this->glClipPlanex = &glClipPlanex_enc;
8451 	this->glGenBuffers = &glGenBuffers_enc;
8452 	this->glGenTextures = &glGenTextures_enc;
8453 	this->glGetError = &glGetError_enc;
8454 	this->glGetFixedv = &glGetFixedv_enc;
8455 	this->glGetIntegerv = &glGetIntegerv_enc;
8456 	this->glGetLightxv = &glGetLightxv_enc;
8457 	this->glGetMaterialxv = &glGetMaterialxv_enc;
8458 	this->glGetPointerv = (glGetPointerv_client_proc_t) &enc_unsupported;
8459 	this->glGetString = (glGetString_client_proc_t) &enc_unsupported;
8460 	this->glGetTexEnviv = &glGetTexEnviv_enc;
8461 	this->glGetTexEnvxv = &glGetTexEnvxv_enc;
8462 	this->glGetTexParameteriv = &glGetTexParameteriv_enc;
8463 	this->glGetTexParameterxv = &glGetTexParameterxv_enc;
8464 	this->glHint = &glHint_enc;
8465 	this->glIsBuffer = &glIsBuffer_enc;
8466 	this->glIsEnabled = &glIsEnabled_enc;
8467 	this->glIsTexture = &glIsTexture_enc;
8468 	this->glLightModelx = &glLightModelx_enc;
8469 	this->glLightModelxv = &glLightModelxv_enc;
8470 	this->glLightx = &glLightx_enc;
8471 	this->glLightxv = &glLightxv_enc;
8472 	this->glLineWidthx = &glLineWidthx_enc;
8473 	this->glLoadIdentity = &glLoadIdentity_enc;
8474 	this->glLoadMatrixx = &glLoadMatrixx_enc;
8475 	this->glLogicOp = &glLogicOp_enc;
8476 	this->glMaterialx = &glMaterialx_enc;
8477 	this->glMaterialxv = &glMaterialxv_enc;
8478 	this->glMatrixMode = &glMatrixMode_enc;
8479 	this->glMultMatrixx = &glMultMatrixx_enc;
8480 	this->glMultiTexCoord4x = &glMultiTexCoord4x_enc;
8481 	this->glNormal3x = &glNormal3x_enc;
8482 	this->glNormalPointer = (glNormalPointer_client_proc_t) &enc_unsupported;
8483 	this->glOrthox = &glOrthox_enc;
8484 	this->glPixelStorei = &glPixelStorei_enc;
8485 	this->glPointParameterx = &glPointParameterx_enc;
8486 	this->glPointParameterxv = &glPointParameterxv_enc;
8487 	this->glPointSizex = &glPointSizex_enc;
8488 	this->glPolygonOffsetx = &glPolygonOffsetx_enc;
8489 	this->glPopMatrix = &glPopMatrix_enc;
8490 	this->glPushMatrix = &glPushMatrix_enc;
8491 	this->glReadPixels = &glReadPixels_enc;
8492 	this->glRotatex = &glRotatex_enc;
8493 	this->glSampleCoverage = &glSampleCoverage_enc;
8494 	this->glSampleCoveragex = &glSampleCoveragex_enc;
8495 	this->glScalex = &glScalex_enc;
8496 	this->glScissor = &glScissor_enc;
8497 	this->glShadeModel = &glShadeModel_enc;
8498 	this->glStencilFunc = &glStencilFunc_enc;
8499 	this->glStencilMask = &glStencilMask_enc;
8500 	this->glStencilOp = &glStencilOp_enc;
8501 	this->glTexCoordPointer = (glTexCoordPointer_client_proc_t) &enc_unsupported;
8502 	this->glTexEnvi = &glTexEnvi_enc;
8503 	this->glTexEnvx = &glTexEnvx_enc;
8504 	this->glTexEnviv = &glTexEnviv_enc;
8505 	this->glTexEnvxv = &glTexEnvxv_enc;
8506 	this->glTexImage2D = &glTexImage2D_enc;
8507 	this->glTexParameteri = &glTexParameteri_enc;
8508 	this->glTexParameterx = &glTexParameterx_enc;
8509 	this->glTexParameteriv = &glTexParameteriv_enc;
8510 	this->glTexParameterxv = &glTexParameterxv_enc;
8511 	this->glTexSubImage2D = &glTexSubImage2D_enc;
8512 	this->glTranslatex = &glTranslatex_enc;
8513 	this->glVertexPointer = (glVertexPointer_client_proc_t) &enc_unsupported;
8514 	this->glViewport = &glViewport_enc;
8515 	this->glPointSizePointerOES = (glPointSizePointerOES_client_proc_t) &enc_unsupported;
8516 	this->glVertexPointerOffset = &glVertexPointerOffset_enc;
8517 	this->glColorPointerOffset = &glColorPointerOffset_enc;
8518 	this->glNormalPointerOffset = &glNormalPointerOffset_enc;
8519 	this->glPointSizePointerOffset = &glPointSizePointerOffset_enc;
8520 	this->glTexCoordPointerOffset = &glTexCoordPointerOffset_enc;
8521 	this->glWeightPointerOffset = &glWeightPointerOffset_enc;
8522 	this->glMatrixIndexPointerOffset = &glMatrixIndexPointerOffset_enc;
8523 	this->glVertexPointerData = &glVertexPointerData_enc;
8524 	this->glColorPointerData = &glColorPointerData_enc;
8525 	this->glNormalPointerData = &glNormalPointerData_enc;
8526 	this->glTexCoordPointerData = &glTexCoordPointerData_enc;
8527 	this->glPointSizePointerData = &glPointSizePointerData_enc;
8528 	this->glWeightPointerData = &glWeightPointerData_enc;
8529 	this->glMatrixIndexPointerData = &glMatrixIndexPointerData_enc;
8530 	this->glDrawElementsOffset = &glDrawElementsOffset_enc;
8531 	this->glDrawElementsData = &glDrawElementsData_enc;
8532 	this->glGetCompressedTextureFormats = &glGetCompressedTextureFormats_enc;
8533 	this->glFinishRoundTrip = &glFinishRoundTrip_enc;
8534 	this->glBlendEquationSeparateOES = &glBlendEquationSeparateOES_enc;
8535 	this->glBlendFuncSeparateOES = &glBlendFuncSeparateOES_enc;
8536 	this->glBlendEquationOES = &glBlendEquationOES_enc;
8537 	this->glDrawTexsOES = &glDrawTexsOES_enc;
8538 	this->glDrawTexiOES = &glDrawTexiOES_enc;
8539 	this->glDrawTexxOES = &glDrawTexxOES_enc;
8540 	this->glDrawTexsvOES = &glDrawTexsvOES_enc;
8541 	this->glDrawTexivOES = &glDrawTexivOES_enc;
8542 	this->glDrawTexxvOES = &glDrawTexxvOES_enc;
8543 	this->glDrawTexfOES = &glDrawTexfOES_enc;
8544 	this->glDrawTexfvOES = &glDrawTexfvOES_enc;
8545 	this->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES_enc;
8546 	this->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES_enc;
8547 	this->glAlphaFuncxOES = &glAlphaFuncxOES_enc;
8548 	this->glClearColorxOES = &glClearColorxOES_enc;
8549 	this->glClearDepthxOES = &glClearDepthxOES_enc;
8550 	this->glClipPlanexOES = &glClipPlanexOES_enc;
8551 	this->glClipPlanexIMG = &glClipPlanexIMG_enc;
8552 	this->glColor4xOES = &glColor4xOES_enc;
8553 	this->glDepthRangexOES = &glDepthRangexOES_enc;
8554 	this->glFogxOES = &glFogxOES_enc;
8555 	this->glFogxvOES = &glFogxvOES_enc;
8556 	this->glFrustumxOES = &glFrustumxOES_enc;
8557 	this->glGetClipPlanexOES = &glGetClipPlanexOES_enc;
8558 	this->glGetClipPlanex = &glGetClipPlanex_enc;
8559 	this->glGetFixedvOES = &glGetFixedvOES_enc;
8560 	this->glGetLightxvOES = &glGetLightxvOES_enc;
8561 	this->glGetMaterialxvOES = &glGetMaterialxvOES_enc;
8562 	this->glGetTexEnvxvOES = &glGetTexEnvxvOES_enc;
8563 	this->glGetTexParameterxvOES = &glGetTexParameterxvOES_enc;
8564 	this->glLightModelxOES = &glLightModelxOES_enc;
8565 	this->glLightModelxvOES = &glLightModelxvOES_enc;
8566 	this->glLightxOES = &glLightxOES_enc;
8567 	this->glLightxvOES = &glLightxvOES_enc;
8568 	this->glLineWidthxOES = &glLineWidthxOES_enc;
8569 	this->glLoadMatrixxOES = &glLoadMatrixxOES_enc;
8570 	this->glMaterialxOES = &glMaterialxOES_enc;
8571 	this->glMaterialxvOES = &glMaterialxvOES_enc;
8572 	this->glMultMatrixxOES = &glMultMatrixxOES_enc;
8573 	this->glMultiTexCoord4xOES = &glMultiTexCoord4xOES_enc;
8574 	this->glNormal3xOES = &glNormal3xOES_enc;
8575 	this->glOrthoxOES = &glOrthoxOES_enc;
8576 	this->glPointParameterxOES = &glPointParameterxOES_enc;
8577 	this->glPointParameterxvOES = &glPointParameterxvOES_enc;
8578 	this->glPointSizexOES = &glPointSizexOES_enc;
8579 	this->glPolygonOffsetxOES = &glPolygonOffsetxOES_enc;
8580 	this->glRotatexOES = &glRotatexOES_enc;
8581 	this->glSampleCoveragexOES = &glSampleCoveragexOES_enc;
8582 	this->glScalexOES = &glScalexOES_enc;
8583 	this->glTexEnvxOES = &glTexEnvxOES_enc;
8584 	this->glTexEnvxvOES = &glTexEnvxvOES_enc;
8585 	this->glTexParameterxOES = &glTexParameterxOES_enc;
8586 	this->glTexParameterxvOES = &glTexParameterxvOES_enc;
8587 	this->glTranslatexOES = &glTranslatexOES_enc;
8588 	this->glIsRenderbufferOES = &glIsRenderbufferOES_enc;
8589 	this->glBindRenderbufferOES = &glBindRenderbufferOES_enc;
8590 	this->glDeleteRenderbuffersOES = &glDeleteRenderbuffersOES_enc;
8591 	this->glGenRenderbuffersOES = &glGenRenderbuffersOES_enc;
8592 	this->glRenderbufferStorageOES = &glRenderbufferStorageOES_enc;
8593 	this->glGetRenderbufferParameterivOES = &glGetRenderbufferParameterivOES_enc;
8594 	this->glIsFramebufferOES = &glIsFramebufferOES_enc;
8595 	this->glBindFramebufferOES = &glBindFramebufferOES_enc;
8596 	this->glDeleteFramebuffersOES = &glDeleteFramebuffersOES_enc;
8597 	this->glGenFramebuffersOES = &glGenFramebuffersOES_enc;
8598 	this->glCheckFramebufferStatusOES = &glCheckFramebufferStatusOES_enc;
8599 	this->glFramebufferRenderbufferOES = &glFramebufferRenderbufferOES_enc;
8600 	this->glFramebufferTexture2DOES = &glFramebufferTexture2DOES_enc;
8601 	this->glGetFramebufferAttachmentParameterivOES = &glGetFramebufferAttachmentParameterivOES_enc;
8602 	this->glGenerateMipmapOES = &glGenerateMipmapOES_enc;
8603 	this->glMapBufferOES = (glMapBufferOES_client_proc_t) &enc_unsupported;
8604 	this->glUnmapBufferOES = &glUnmapBufferOES_enc;
8605 	this->glGetBufferPointervOES = (glGetBufferPointervOES_client_proc_t) &enc_unsupported;
8606 	this->glCurrentPaletteMatrixOES = &glCurrentPaletteMatrixOES_enc;
8607 	this->glLoadPaletteFromModelViewMatrixOES = &glLoadPaletteFromModelViewMatrixOES_enc;
8608 	this->glMatrixIndexPointerOES = (glMatrixIndexPointerOES_client_proc_t) &enc_unsupported;
8609 	this->glWeightPointerOES = (glWeightPointerOES_client_proc_t) &enc_unsupported;
8610 	this->glQueryMatrixxOES = &glQueryMatrixxOES_enc;
8611 	this->glDepthRangefOES = &glDepthRangefOES_enc;
8612 	this->glFrustumfOES = &glFrustumfOES_enc;
8613 	this->glOrthofOES = &glOrthofOES_enc;
8614 	this->glClipPlanefOES = &glClipPlanefOES_enc;
8615 	this->glClipPlanefIMG = &glClipPlanefIMG_enc;
8616 	this->glGetClipPlanefOES = &glGetClipPlanefOES_enc;
8617 	this->glClearDepthfOES = &glClearDepthfOES_enc;
8618 	this->glTexGenfOES = &glTexGenfOES_enc;
8619 	this->glTexGenfvOES = &glTexGenfvOES_enc;
8620 	this->glTexGeniOES = &glTexGeniOES_enc;
8621 	this->glTexGenivOES = &glTexGenivOES_enc;
8622 	this->glTexGenxOES = &glTexGenxOES_enc;
8623 	this->glTexGenxvOES = &glTexGenxvOES_enc;
8624 	this->glGetTexGenfvOES = &glGetTexGenfvOES_enc;
8625 	this->glGetTexGenivOES = &glGetTexGenivOES_enc;
8626 	this->glGetTexGenxvOES = &glGetTexGenxvOES_enc;
8627 	this->glBindVertexArrayOES = &glBindVertexArrayOES_enc;
8628 	this->glDeleteVertexArraysOES = &glDeleteVertexArraysOES_enc;
8629 	this->glGenVertexArraysOES = &glGenVertexArraysOES_enc;
8630 	this->glIsVertexArrayOES = &glIsVertexArrayOES_enc;
8631 	this->glDiscardFramebufferEXT = &glDiscardFramebufferEXT_enc;
8632 	this->glMultiDrawArraysEXT = (glMultiDrawArraysEXT_client_proc_t) &enc_unsupported;
8633 	this->glMultiDrawElementsEXT = (glMultiDrawElementsEXT_client_proc_t) &enc_unsupported;
8634 	this->glMultiDrawArraysSUN = (glMultiDrawArraysSUN_client_proc_t) &enc_unsupported;
8635 	this->glMultiDrawElementsSUN = (glMultiDrawElementsSUN_client_proc_t) &enc_unsupported;
8636 	this->glRenderbufferStorageMultisampleIMG = &glRenderbufferStorageMultisampleIMG_enc;
8637 	this->glFramebufferTexture2DMultisampleIMG = &glFramebufferTexture2DMultisampleIMG_enc;
8638 	this->glDeleteFencesNV = &glDeleteFencesNV_enc;
8639 	this->glGenFencesNV = &glGenFencesNV_enc;
8640 	this->glIsFenceNV = &glIsFenceNV_enc;
8641 	this->glTestFenceNV = &glTestFenceNV_enc;
8642 	this->glGetFenceivNV = &glGetFenceivNV_enc;
8643 	this->glFinishFenceNV = &glFinishFenceNV_enc;
8644 	this->glSetFenceNV = &glSetFenceNV_enc;
8645 	this->glGetDriverControlsQCOM = &glGetDriverControlsQCOM_enc;
8646 	this->glGetDriverControlStringQCOM = &glGetDriverControlStringQCOM_enc;
8647 	this->glEnableDriverControlQCOM = &glEnableDriverControlQCOM_enc;
8648 	this->glDisableDriverControlQCOM = &glDisableDriverControlQCOM_enc;
8649 	this->glExtGetTexturesQCOM = &glExtGetTexturesQCOM_enc;
8650 	this->glExtGetBuffersQCOM = &glExtGetBuffersQCOM_enc;
8651 	this->glExtGetRenderbuffersQCOM = &glExtGetRenderbuffersQCOM_enc;
8652 	this->glExtGetFramebuffersQCOM = &glExtGetFramebuffersQCOM_enc;
8653 	this->glExtGetTexLevelParameterivQCOM = &glExtGetTexLevelParameterivQCOM_enc;
8654 	this->glExtTexObjectStateOverrideiQCOM = &glExtTexObjectStateOverrideiQCOM_enc;
8655 	this->glExtGetTexSubImageQCOM = &glExtGetTexSubImageQCOM_enc;
8656 	this->glExtGetBufferPointervQCOM = (glExtGetBufferPointervQCOM_client_proc_t) &enc_unsupported;
8657 	this->glExtGetShadersQCOM = &glExtGetShadersQCOM_enc;
8658 	this->glExtGetProgramsQCOM = &glExtGetProgramsQCOM_enc;
8659 	this->glExtIsProgramBinaryQCOM = &glExtIsProgramBinaryQCOM_enc;
8660 	this->glExtGetProgramBinarySourceQCOM = (glExtGetProgramBinarySourceQCOM_client_proc_t) &enc_unsupported;
8661 	this->glStartTilingQCOM = &glStartTilingQCOM_enc;
8662 	this->glEndTilingQCOM = &glEndTilingQCOM_enc;
8663 	this->glGetGraphicsResetStatusEXT = &glGetGraphicsResetStatusEXT_enc;
8664 	this->glReadnPixelsEXT = &glReadnPixelsEXT_enc;
8665 }
8666 
8667