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