Handle account removal correctly on all platforms.
[chromium-blink-merge.git] / gpu / command_buffer / client / gles2_implementation_impl_autogen.h
blobb748d03c742e34af0ce6e2d6f69f2be5d2725c5e
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT!
11 // This file is included by gles2_implementation.cc to define the
12 // GL api functions.
13 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_
14 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_
16 void GLES2Implementation::AttachShader(GLuint program, GLuint shader) {
17 GPU_CLIENT_SINGLE_THREAD_CHECK();
18 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glAttachShader(" << program << ", "
19 << shader << ")");
20 helper_->AttachShader(program, shader);
21 CheckGLError();
24 void GLES2Implementation::BindBuffer(GLenum target, GLuint buffer) {
25 GPU_CLIENT_SINGLE_THREAD_CHECK();
26 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindBuffer("
27 << GLES2Util::GetStringBufferTarget(target) << ", "
28 << buffer << ")");
29 if (IsBufferReservedId(buffer)) {
30 SetGLError(GL_INVALID_OPERATION, "BindBuffer", "buffer reserved id");
31 return;
33 if (BindBufferHelper(target, buffer)) {
34 helper_->BindBuffer(target, buffer);
36 CheckGLError();
39 void GLES2Implementation::BindFramebuffer(GLenum target, GLuint framebuffer) {
40 GPU_CLIENT_SINGLE_THREAD_CHECK();
41 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindFramebuffer("
42 << GLES2Util::GetStringFrameBufferTarget(target) << ", "
43 << framebuffer << ")");
44 if (IsFramebufferReservedId(framebuffer)) {
45 SetGLError(
46 GL_INVALID_OPERATION, "BindFramebuffer", "framebuffer reserved id");
47 return;
49 if (BindFramebufferHelper(target, framebuffer)) {
50 helper_->BindFramebuffer(target, framebuffer);
52 CheckGLError();
55 void GLES2Implementation::BindRenderbuffer(GLenum target, GLuint renderbuffer) {
56 GPU_CLIENT_SINGLE_THREAD_CHECK();
57 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindRenderbuffer("
58 << GLES2Util::GetStringRenderBufferTarget(target) << ", "
59 << renderbuffer << ")");
60 if (IsRenderbufferReservedId(renderbuffer)) {
61 SetGLError(
62 GL_INVALID_OPERATION, "BindRenderbuffer", "renderbuffer reserved id");
63 return;
65 if (BindRenderbufferHelper(target, renderbuffer)) {
66 helper_->BindRenderbuffer(target, renderbuffer);
68 CheckGLError();
71 void GLES2Implementation::BindTexture(GLenum target, GLuint texture) {
72 GPU_CLIENT_SINGLE_THREAD_CHECK();
73 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindTexture("
74 << GLES2Util::GetStringTextureBindTarget(target) << ", "
75 << texture << ")");
76 if (IsTextureReservedId(texture)) {
77 SetGLError(GL_INVALID_OPERATION, "BindTexture", "texture reserved id");
78 return;
80 if (BindTextureHelper(target, texture)) {
81 helper_->BindTexture(target, texture);
83 CheckGLError();
86 void GLES2Implementation::BlendColor(GLclampf red,
87 GLclampf green,
88 GLclampf blue,
89 GLclampf alpha) {
90 GPU_CLIENT_SINGLE_THREAD_CHECK();
91 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendColor(" << red << ", "
92 << green << ", " << blue << ", " << alpha << ")");
93 helper_->BlendColor(red, green, blue, alpha);
94 CheckGLError();
97 void GLES2Implementation::BlendEquation(GLenum mode) {
98 GPU_CLIENT_SINGLE_THREAD_CHECK();
99 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendEquation("
100 << GLES2Util::GetStringEquation(mode) << ")");
101 helper_->BlendEquation(mode);
102 CheckGLError();
105 void GLES2Implementation::BlendEquationSeparate(GLenum modeRGB,
106 GLenum modeAlpha) {
107 GPU_CLIENT_SINGLE_THREAD_CHECK();
108 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendEquationSeparate("
109 << GLES2Util::GetStringEquation(modeRGB) << ", "
110 << GLES2Util::GetStringEquation(modeAlpha) << ")");
111 helper_->BlendEquationSeparate(modeRGB, modeAlpha);
112 CheckGLError();
115 void GLES2Implementation::BlendFunc(GLenum sfactor, GLenum dfactor) {
116 GPU_CLIENT_SINGLE_THREAD_CHECK();
117 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendFunc("
118 << GLES2Util::GetStringSrcBlendFactor(sfactor) << ", "
119 << GLES2Util::GetStringDstBlendFactor(dfactor) << ")");
120 helper_->BlendFunc(sfactor, dfactor);
121 CheckGLError();
124 void GLES2Implementation::BlendFuncSeparate(GLenum srcRGB,
125 GLenum dstRGB,
126 GLenum srcAlpha,
127 GLenum dstAlpha) {
128 GPU_CLIENT_SINGLE_THREAD_CHECK();
129 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendFuncSeparate("
130 << GLES2Util::GetStringSrcBlendFactor(srcRGB) << ", "
131 << GLES2Util::GetStringDstBlendFactor(dstRGB) << ", "
132 << GLES2Util::GetStringSrcBlendFactor(srcAlpha) << ", "
133 << GLES2Util::GetStringDstBlendFactor(dstAlpha) << ")");
134 helper_->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
135 CheckGLError();
138 GLenum GLES2Implementation::CheckFramebufferStatus(GLenum target) {
139 GPU_CLIENT_SINGLE_THREAD_CHECK();
140 TRACE_EVENT0("gpu", "GLES2Implementation::CheckFramebufferStatus");
141 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCheckFramebufferStatus("
142 << GLES2Util::GetStringFrameBufferTarget(target) << ")");
143 typedef cmds::CheckFramebufferStatus::Result Result;
144 Result* result = GetResultAs<Result*>();
145 if (!result) {
146 return GL_FRAMEBUFFER_UNSUPPORTED;
148 *result = 0;
149 helper_->CheckFramebufferStatus(
150 target, GetResultShmId(), GetResultShmOffset());
151 WaitForCmd();
152 GLenum result_value = *result;
153 GPU_CLIENT_LOG("returned " << result_value);
154 CheckGLError();
155 return result_value;
158 void GLES2Implementation::Clear(GLbitfield mask) {
159 GPU_CLIENT_SINGLE_THREAD_CHECK();
160 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClear(" << mask << ")");
161 helper_->Clear(mask);
162 CheckGLError();
165 void GLES2Implementation::ClearColor(GLclampf red,
166 GLclampf green,
167 GLclampf blue,
168 GLclampf alpha) {
169 GPU_CLIENT_SINGLE_THREAD_CHECK();
170 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClearColor(" << red << ", "
171 << green << ", " << blue << ", " << alpha << ")");
172 helper_->ClearColor(red, green, blue, alpha);
173 CheckGLError();
176 void GLES2Implementation::ClearDepthf(GLclampf depth) {
177 GPU_CLIENT_SINGLE_THREAD_CHECK();
178 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClearDepthf(" << depth << ")");
179 helper_->ClearDepthf(depth);
180 CheckGLError();
183 void GLES2Implementation::ClearStencil(GLint s) {
184 GPU_CLIENT_SINGLE_THREAD_CHECK();
185 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glClearStencil(" << s << ")");
186 helper_->ClearStencil(s);
187 CheckGLError();
190 void GLES2Implementation::ColorMask(GLboolean red,
191 GLboolean green,
192 GLboolean blue,
193 GLboolean alpha) {
194 GPU_CLIENT_SINGLE_THREAD_CHECK();
195 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glColorMask("
196 << GLES2Util::GetStringBool(red) << ", "
197 << GLES2Util::GetStringBool(green) << ", "
198 << GLES2Util::GetStringBool(blue) << ", "
199 << GLES2Util::GetStringBool(alpha) << ")");
200 helper_->ColorMask(red, green, blue, alpha);
201 CheckGLError();
204 void GLES2Implementation::CompileShader(GLuint shader) {
205 GPU_CLIENT_SINGLE_THREAD_CHECK();
206 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCompileShader(" << shader
207 << ")");
208 helper_->CompileShader(shader);
209 CheckGLError();
212 void GLES2Implementation::CopyTexImage2D(GLenum target,
213 GLint level,
214 GLenum internalformat,
215 GLint x,
216 GLint y,
217 GLsizei width,
218 GLsizei height,
219 GLint border) {
220 GPU_CLIENT_SINGLE_THREAD_CHECK();
221 GPU_CLIENT_LOG(
222 "[" << GetLogPrefix() << "] glCopyTexImage2D("
223 << GLES2Util::GetStringTextureTarget(target) << ", " << level << ", "
224 << GLES2Util::GetStringTextureInternalFormat(internalformat) << ", "
225 << x << ", " << y << ", " << width << ", " << height << ", " << border
226 << ")");
227 if (width < 0) {
228 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D", "width < 0");
229 return;
231 if (height < 0) {
232 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D", "height < 0");
233 return;
235 if (border != 0) {
236 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D", "border GL_INVALID_VALUE");
237 return;
239 helper_->CopyTexImage2D(target, level, internalformat, x, y, width, height);
240 CheckGLError();
243 void GLES2Implementation::CopyTexSubImage2D(GLenum target,
244 GLint level,
245 GLint xoffset,
246 GLint yoffset,
247 GLint x,
248 GLint y,
249 GLsizei width,
250 GLsizei height) {
251 GPU_CLIENT_SINGLE_THREAD_CHECK();
252 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCopyTexSubImage2D("
253 << GLES2Util::GetStringTextureTarget(target) << ", "
254 << level << ", " << xoffset << ", " << yoffset << ", " << x
255 << ", " << y << ", " << width << ", " << height << ")");
256 if (width < 0) {
257 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D", "width < 0");
258 return;
260 if (height < 0) {
261 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D", "height < 0");
262 return;
264 helper_->CopyTexSubImage2D(
265 target, level, xoffset, yoffset, x, y, width, height);
266 CheckGLError();
269 GLuint GLES2Implementation::CreateProgram() {
270 GPU_CLIENT_SINGLE_THREAD_CHECK();
271 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateProgram("
272 << ")");
273 GLuint client_id;
274 GetIdHandler(id_namespaces::kProgramsAndShaders)
275 ->MakeIds(this, 0, 1, &client_id);
276 helper_->CreateProgram(client_id);
277 GPU_CLIENT_LOG("returned " << client_id);
278 CheckGLError();
279 return client_id;
282 GLuint GLES2Implementation::CreateShader(GLenum type) {
283 GPU_CLIENT_SINGLE_THREAD_CHECK();
284 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateShader("
285 << GLES2Util::GetStringShaderType(type) << ")");
286 GLuint client_id;
287 GetIdHandler(id_namespaces::kProgramsAndShaders)
288 ->MakeIds(this, 0, 1, &client_id);
289 helper_->CreateShader(type, client_id);
290 GPU_CLIENT_LOG("returned " << client_id);
291 CheckGLError();
292 return client_id;
295 void GLES2Implementation::CullFace(GLenum mode) {
296 GPU_CLIENT_SINGLE_THREAD_CHECK();
297 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCullFace("
298 << GLES2Util::GetStringFaceType(mode) << ")");
299 helper_->CullFace(mode);
300 CheckGLError();
303 void GLES2Implementation::DeleteBuffers(GLsizei n, const GLuint* buffers) {
304 GPU_CLIENT_SINGLE_THREAD_CHECK();
305 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteBuffers(" << n << ", "
306 << static_cast<const void*>(buffers) << ")");
307 GPU_CLIENT_LOG_CODE_BLOCK({
308 for (GLsizei i = 0; i < n; ++i) {
309 GPU_CLIENT_LOG(" " << i << ": " << buffers[i]);
312 GPU_CLIENT_DCHECK_CODE_BLOCK({
313 for (GLsizei i = 0; i < n; ++i) {
314 DCHECK(buffers[i] != 0);
317 if (n < 0) {
318 SetGLError(GL_INVALID_VALUE, "glDeleteBuffers", "n < 0");
319 return;
321 DeleteBuffersHelper(n, buffers);
322 CheckGLError();
325 void GLES2Implementation::DeleteFramebuffers(GLsizei n,
326 const GLuint* framebuffers) {
327 GPU_CLIENT_SINGLE_THREAD_CHECK();
328 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteFramebuffers(" << n << ", "
329 << static_cast<const void*>(framebuffers) << ")");
330 GPU_CLIENT_LOG_CODE_BLOCK({
331 for (GLsizei i = 0; i < n; ++i) {
332 GPU_CLIENT_LOG(" " << i << ": " << framebuffers[i]);
335 GPU_CLIENT_DCHECK_CODE_BLOCK({
336 for (GLsizei i = 0; i < n; ++i) {
337 DCHECK(framebuffers[i] != 0);
340 if (n < 0) {
341 SetGLError(GL_INVALID_VALUE, "glDeleteFramebuffers", "n < 0");
342 return;
344 DeleteFramebuffersHelper(n, framebuffers);
345 CheckGLError();
348 void GLES2Implementation::DeleteProgram(GLuint program) {
349 GPU_CLIENT_SINGLE_THREAD_CHECK();
350 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteProgram(" << program
351 << ")");
352 GPU_CLIENT_DCHECK(program != 0);
353 DeleteProgramHelper(program);
354 CheckGLError();
357 void GLES2Implementation::DeleteRenderbuffers(GLsizei n,
358 const GLuint* renderbuffers) {
359 GPU_CLIENT_SINGLE_THREAD_CHECK();
360 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteRenderbuffers(" << n
361 << ", " << static_cast<const void*>(renderbuffers) << ")");
362 GPU_CLIENT_LOG_CODE_BLOCK({
363 for (GLsizei i = 0; i < n; ++i) {
364 GPU_CLIENT_LOG(" " << i << ": " << renderbuffers[i]);
367 GPU_CLIENT_DCHECK_CODE_BLOCK({
368 for (GLsizei i = 0; i < n; ++i) {
369 DCHECK(renderbuffers[i] != 0);
372 if (n < 0) {
373 SetGLError(GL_INVALID_VALUE, "glDeleteRenderbuffers", "n < 0");
374 return;
376 DeleteRenderbuffersHelper(n, renderbuffers);
377 CheckGLError();
380 void GLES2Implementation::DeleteShader(GLuint shader) {
381 GPU_CLIENT_SINGLE_THREAD_CHECK();
382 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteShader(" << shader << ")");
383 GPU_CLIENT_DCHECK(shader != 0);
384 DeleteShaderHelper(shader);
385 CheckGLError();
388 void GLES2Implementation::DeleteTextures(GLsizei n, const GLuint* textures) {
389 GPU_CLIENT_SINGLE_THREAD_CHECK();
390 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteTextures(" << n << ", "
391 << static_cast<const void*>(textures) << ")");
392 GPU_CLIENT_LOG_CODE_BLOCK({
393 for (GLsizei i = 0; i < n; ++i) {
394 GPU_CLIENT_LOG(" " << i << ": " << textures[i]);
397 GPU_CLIENT_DCHECK_CODE_BLOCK({
398 for (GLsizei i = 0; i < n; ++i) {
399 DCHECK(textures[i] != 0);
402 if (n < 0) {
403 SetGLError(GL_INVALID_VALUE, "glDeleteTextures", "n < 0");
404 return;
406 DeleteTexturesHelper(n, textures);
407 CheckGLError();
410 void GLES2Implementation::DepthFunc(GLenum func) {
411 GPU_CLIENT_SINGLE_THREAD_CHECK();
412 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDepthFunc("
413 << GLES2Util::GetStringCmpFunction(func) << ")");
414 helper_->DepthFunc(func);
415 CheckGLError();
418 void GLES2Implementation::DepthMask(GLboolean flag) {
419 GPU_CLIENT_SINGLE_THREAD_CHECK();
420 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDepthMask("
421 << GLES2Util::GetStringBool(flag) << ")");
422 helper_->DepthMask(flag);
423 CheckGLError();
426 void GLES2Implementation::DepthRangef(GLclampf zNear, GLclampf zFar) {
427 GPU_CLIENT_SINGLE_THREAD_CHECK();
428 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDepthRangef(" << zNear << ", "
429 << zFar << ")");
430 helper_->DepthRangef(zNear, zFar);
431 CheckGLError();
434 void GLES2Implementation::DetachShader(GLuint program, GLuint shader) {
435 GPU_CLIENT_SINGLE_THREAD_CHECK();
436 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDetachShader(" << program << ", "
437 << shader << ")");
438 helper_->DetachShader(program, shader);
439 CheckGLError();
442 void GLES2Implementation::FramebufferRenderbuffer(GLenum target,
443 GLenum attachment,
444 GLenum renderbuffertarget,
445 GLuint renderbuffer) {
446 GPU_CLIENT_SINGLE_THREAD_CHECK();
447 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFramebufferRenderbuffer("
448 << GLES2Util::GetStringFrameBufferTarget(target) << ", "
449 << GLES2Util::GetStringAttachment(attachment) << ", "
450 << GLES2Util::GetStringRenderBufferTarget(
451 renderbuffertarget) << ", " << renderbuffer << ")");
452 helper_->FramebufferRenderbuffer(
453 target, attachment, renderbuffertarget, renderbuffer);
454 CheckGLError();
457 void GLES2Implementation::FramebufferTexture2D(GLenum target,
458 GLenum attachment,
459 GLenum textarget,
460 GLuint texture,
461 GLint level) {
462 GPU_CLIENT_SINGLE_THREAD_CHECK();
463 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFramebufferTexture2D("
464 << GLES2Util::GetStringFrameBufferTarget(target) << ", "
465 << GLES2Util::GetStringAttachment(attachment) << ", "
466 << GLES2Util::GetStringTextureTarget(textarget) << ", "
467 << texture << ", " << level << ")");
468 if (level != 0) {
469 SetGLError(
470 GL_INVALID_VALUE, "glFramebufferTexture2D", "level GL_INVALID_VALUE");
471 return;
473 helper_->FramebufferTexture2D(target, attachment, textarget, texture);
474 CheckGLError();
477 void GLES2Implementation::FrontFace(GLenum mode) {
478 GPU_CLIENT_SINGLE_THREAD_CHECK();
479 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFrontFace("
480 << GLES2Util::GetStringFaceMode(mode) << ")");
481 helper_->FrontFace(mode);
482 CheckGLError();
485 void GLES2Implementation::GenBuffers(GLsizei n, GLuint* buffers) {
486 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenBuffers(" << n << ", "
487 << static_cast<const void*>(buffers) << ")");
488 if (n < 0) {
489 SetGLError(GL_INVALID_VALUE, "glGenBuffers", "n < 0");
490 return;
492 GPU_CLIENT_SINGLE_THREAD_CHECK();
493 GetIdHandler(id_namespaces::kBuffers)->MakeIds(this, 0, n, buffers);
494 GenBuffersHelper(n, buffers);
495 helper_->GenBuffersImmediate(n, buffers);
496 if (share_group_->bind_generates_resource())
497 helper_->CommandBufferHelper::Flush();
498 GPU_CLIENT_LOG_CODE_BLOCK({
499 for (GLsizei i = 0; i < n; ++i) {
500 GPU_CLIENT_LOG(" " << i << ": " << buffers[i]);
503 CheckGLError();
506 void GLES2Implementation::GenerateMipmap(GLenum target) {
507 GPU_CLIENT_SINGLE_THREAD_CHECK();
508 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenerateMipmap("
509 << GLES2Util::GetStringTextureBindTarget(target) << ")");
510 helper_->GenerateMipmap(target);
511 CheckGLError();
514 void GLES2Implementation::GenFramebuffers(GLsizei n, GLuint* framebuffers) {
515 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenFramebuffers(" << n << ", "
516 << static_cast<const void*>(framebuffers) << ")");
517 if (n < 0) {
518 SetGLError(GL_INVALID_VALUE, "glGenFramebuffers", "n < 0");
519 return;
521 GPU_CLIENT_SINGLE_THREAD_CHECK();
522 GetIdHandler(id_namespaces::kFramebuffers)->MakeIds(this, 0, n, framebuffers);
523 GenFramebuffersHelper(n, framebuffers);
524 helper_->GenFramebuffersImmediate(n, framebuffers);
525 if (share_group_->bind_generates_resource())
526 helper_->CommandBufferHelper::Flush();
527 GPU_CLIENT_LOG_CODE_BLOCK({
528 for (GLsizei i = 0; i < n; ++i) {
529 GPU_CLIENT_LOG(" " << i << ": " << framebuffers[i]);
532 CheckGLError();
535 void GLES2Implementation::GenRenderbuffers(GLsizei n, GLuint* renderbuffers) {
536 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenRenderbuffers(" << n << ", "
537 << static_cast<const void*>(renderbuffers) << ")");
538 if (n < 0) {
539 SetGLError(GL_INVALID_VALUE, "glGenRenderbuffers", "n < 0");
540 return;
542 GPU_CLIENT_SINGLE_THREAD_CHECK();
543 GetIdHandler(id_namespaces::kRenderbuffers)
544 ->MakeIds(this, 0, n, renderbuffers);
545 GenRenderbuffersHelper(n, renderbuffers);
546 helper_->GenRenderbuffersImmediate(n, renderbuffers);
547 if (share_group_->bind_generates_resource())
548 helper_->CommandBufferHelper::Flush();
549 GPU_CLIENT_LOG_CODE_BLOCK({
550 for (GLsizei i = 0; i < n; ++i) {
551 GPU_CLIENT_LOG(" " << i << ": " << renderbuffers[i]);
554 CheckGLError();
557 void GLES2Implementation::GenTextures(GLsizei n, GLuint* textures) {
558 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenTextures(" << n << ", "
559 << static_cast<const void*>(textures) << ")");
560 if (n < 0) {
561 SetGLError(GL_INVALID_VALUE, "glGenTextures", "n < 0");
562 return;
564 GPU_CLIENT_SINGLE_THREAD_CHECK();
565 GetIdHandler(id_namespaces::kTextures)->MakeIds(this, 0, n, textures);
566 GenTexturesHelper(n, textures);
567 helper_->GenTexturesImmediate(n, textures);
568 if (share_group_->bind_generates_resource())
569 helper_->CommandBufferHelper::Flush();
570 GPU_CLIENT_LOG_CODE_BLOCK({
571 for (GLsizei i = 0; i < n; ++i) {
572 GPU_CLIENT_LOG(" " << i << ": " << textures[i]);
575 CheckGLError();
578 void GLES2Implementation::GetBooleanv(GLenum pname, GLboolean* params) {
579 GPU_CLIENT_SINGLE_THREAD_CHECK();
580 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLboolean, params);
581 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetBooleanv("
582 << GLES2Util::GetStringGLState(pname) << ", "
583 << static_cast<const void*>(params) << ")");
584 TRACE_EVENT0("gpu", "GLES2Implementation::GetBooleanv");
585 if (GetBooleanvHelper(pname, params)) {
586 return;
588 typedef cmds::GetBooleanv::Result Result;
589 Result* result = GetResultAs<Result*>();
590 if (!result) {
591 return;
593 result->SetNumResults(0);
594 helper_->GetBooleanv(pname, GetResultShmId(), GetResultShmOffset());
595 WaitForCmd();
596 result->CopyResult(params);
597 GPU_CLIENT_LOG_CODE_BLOCK({
598 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
599 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
602 CheckGLError();
604 void GLES2Implementation::GetBufferParameteriv(GLenum target,
605 GLenum pname,
606 GLint* params) {
607 GPU_CLIENT_SINGLE_THREAD_CHECK();
608 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
609 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetBufferParameteriv("
610 << GLES2Util::GetStringBufferTarget(target) << ", "
611 << GLES2Util::GetStringBufferParameter(pname) << ", "
612 << static_cast<const void*>(params) << ")");
613 TRACE_EVENT0("gpu", "GLES2Implementation::GetBufferParameteriv");
614 if (GetBufferParameterivHelper(target, pname, params)) {
615 return;
617 typedef cmds::GetBufferParameteriv::Result Result;
618 Result* result = GetResultAs<Result*>();
619 if (!result) {
620 return;
622 result->SetNumResults(0);
623 helper_->GetBufferParameteriv(
624 target, pname, GetResultShmId(), GetResultShmOffset());
625 WaitForCmd();
626 result->CopyResult(params);
627 GPU_CLIENT_LOG_CODE_BLOCK({
628 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
629 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
632 CheckGLError();
634 void GLES2Implementation::GetFloatv(GLenum pname, GLfloat* params) {
635 GPU_CLIENT_SINGLE_THREAD_CHECK();
636 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetFloatv("
637 << GLES2Util::GetStringGLState(pname) << ", "
638 << static_cast<const void*>(params) << ")");
639 TRACE_EVENT0("gpu", "GLES2Implementation::GetFloatv");
640 if (GetFloatvHelper(pname, params)) {
641 return;
643 typedef cmds::GetFloatv::Result Result;
644 Result* result = GetResultAs<Result*>();
645 if (!result) {
646 return;
648 result->SetNumResults(0);
649 helper_->GetFloatv(pname, GetResultShmId(), GetResultShmOffset());
650 WaitForCmd();
651 result->CopyResult(params);
652 GPU_CLIENT_LOG_CODE_BLOCK({
653 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
654 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
657 CheckGLError();
659 void GLES2Implementation::GetFramebufferAttachmentParameteriv(GLenum target,
660 GLenum attachment,
661 GLenum pname,
662 GLint* params) {
663 GPU_CLIENT_SINGLE_THREAD_CHECK();
664 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
665 GPU_CLIENT_LOG("[" << GetLogPrefix()
666 << "] glGetFramebufferAttachmentParameteriv("
667 << GLES2Util::GetStringFrameBufferTarget(target) << ", "
668 << GLES2Util::GetStringAttachment(attachment) << ", "
669 << GLES2Util::GetStringFrameBufferParameter(pname) << ", "
670 << static_cast<const void*>(params) << ")");
671 TRACE_EVENT0("gpu",
672 "GLES2Implementation::GetFramebufferAttachmentParameteriv");
673 if (GetFramebufferAttachmentParameterivHelper(
674 target, attachment, pname, params)) {
675 return;
677 typedef cmds::GetFramebufferAttachmentParameteriv::Result Result;
678 Result* result = GetResultAs<Result*>();
679 if (!result) {
680 return;
682 result->SetNumResults(0);
683 helper_->GetFramebufferAttachmentParameteriv(
684 target, attachment, pname, GetResultShmId(), GetResultShmOffset());
685 WaitForCmd();
686 result->CopyResult(params);
687 GPU_CLIENT_LOG_CODE_BLOCK({
688 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
689 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
692 CheckGLError();
694 void GLES2Implementation::GetIntegerv(GLenum pname, GLint* params) {
695 GPU_CLIENT_SINGLE_THREAD_CHECK();
696 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
697 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetIntegerv("
698 << GLES2Util::GetStringGLState(pname) << ", "
699 << static_cast<const void*>(params) << ")");
700 TRACE_EVENT0("gpu", "GLES2Implementation::GetIntegerv");
701 if (GetIntegervHelper(pname, params)) {
702 return;
704 typedef cmds::GetIntegerv::Result Result;
705 Result* result = GetResultAs<Result*>();
706 if (!result) {
707 return;
709 result->SetNumResults(0);
710 helper_->GetIntegerv(pname, GetResultShmId(), GetResultShmOffset());
711 WaitForCmd();
712 result->CopyResult(params);
713 GPU_CLIENT_LOG_CODE_BLOCK({
714 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
715 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
718 CheckGLError();
720 void GLES2Implementation::GetProgramiv(GLuint program,
721 GLenum pname,
722 GLint* params) {
723 GPU_CLIENT_SINGLE_THREAD_CHECK();
724 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
725 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetProgramiv(" << program << ", "
726 << GLES2Util::GetStringProgramParameter(pname) << ", "
727 << static_cast<const void*>(params) << ")");
728 TRACE_EVENT0("gpu", "GLES2Implementation::GetProgramiv");
729 if (GetProgramivHelper(program, pname, params)) {
730 return;
732 typedef cmds::GetProgramiv::Result Result;
733 Result* result = GetResultAs<Result*>();
734 if (!result) {
735 return;
737 result->SetNumResults(0);
738 helper_->GetProgramiv(program, pname, GetResultShmId(), GetResultShmOffset());
739 WaitForCmd();
740 result->CopyResult(params);
741 GPU_CLIENT_LOG_CODE_BLOCK({
742 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
743 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
746 CheckGLError();
748 void GLES2Implementation::GetProgramInfoLog(GLuint program,
749 GLsizei bufsize,
750 GLsizei* length,
751 char* infolog) {
752 GPU_CLIENT_SINGLE_THREAD_CHECK();
753 GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(GLsizei, length);
754 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetProgramInfoLog"
755 << "(" << program << ", " << bufsize << ", "
756 << static_cast<void*>(length) << ", "
757 << static_cast<void*>(infolog) << ")");
758 helper_->SetBucketSize(kResultBucketId, 0);
759 helper_->GetProgramInfoLog(program, kResultBucketId);
760 std::string str;
761 GLsizei max_size = 0;
762 if (GetBucketAsString(kResultBucketId, &str)) {
763 if (bufsize > 0) {
764 max_size = std::min(static_cast<size_t>(bufsize) - 1, str.size());
765 memcpy(infolog, str.c_str(), max_size);
766 infolog[max_size] = '\0';
767 GPU_CLIENT_LOG("------\n" << infolog << "\n------");
770 if (length != NULL) {
771 *length = max_size;
773 CheckGLError();
775 void GLES2Implementation::GetRenderbufferParameteriv(GLenum target,
776 GLenum pname,
777 GLint* params) {
778 GPU_CLIENT_SINGLE_THREAD_CHECK();
779 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
780 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetRenderbufferParameteriv("
781 << GLES2Util::GetStringRenderBufferTarget(target) << ", "
782 << GLES2Util::GetStringRenderBufferParameter(pname) << ", "
783 << static_cast<const void*>(params) << ")");
784 TRACE_EVENT0("gpu", "GLES2Implementation::GetRenderbufferParameteriv");
785 if (GetRenderbufferParameterivHelper(target, pname, params)) {
786 return;
788 typedef cmds::GetRenderbufferParameteriv::Result Result;
789 Result* result = GetResultAs<Result*>();
790 if (!result) {
791 return;
793 result->SetNumResults(0);
794 helper_->GetRenderbufferParameteriv(
795 target, pname, GetResultShmId(), GetResultShmOffset());
796 WaitForCmd();
797 result->CopyResult(params);
798 GPU_CLIENT_LOG_CODE_BLOCK({
799 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
800 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
803 CheckGLError();
805 void GLES2Implementation::GetShaderiv(GLuint shader,
806 GLenum pname,
807 GLint* params) {
808 GPU_CLIENT_SINGLE_THREAD_CHECK();
809 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
810 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetShaderiv(" << shader << ", "
811 << GLES2Util::GetStringShaderParameter(pname) << ", "
812 << static_cast<const void*>(params) << ")");
813 TRACE_EVENT0("gpu", "GLES2Implementation::GetShaderiv");
814 if (GetShaderivHelper(shader, pname, params)) {
815 return;
817 typedef cmds::GetShaderiv::Result Result;
818 Result* result = GetResultAs<Result*>();
819 if (!result) {
820 return;
822 result->SetNumResults(0);
823 helper_->GetShaderiv(shader, pname, GetResultShmId(), GetResultShmOffset());
824 WaitForCmd();
825 result->CopyResult(params);
826 GPU_CLIENT_LOG_CODE_BLOCK({
827 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
828 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
831 CheckGLError();
833 void GLES2Implementation::GetShaderInfoLog(GLuint shader,
834 GLsizei bufsize,
835 GLsizei* length,
836 char* infolog) {
837 GPU_CLIENT_SINGLE_THREAD_CHECK();
838 GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(GLsizei, length);
839 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetShaderInfoLog"
840 << "(" << shader << ", " << bufsize << ", "
841 << static_cast<void*>(length) << ", "
842 << static_cast<void*>(infolog) << ")");
843 helper_->SetBucketSize(kResultBucketId, 0);
844 helper_->GetShaderInfoLog(shader, kResultBucketId);
845 std::string str;
846 GLsizei max_size = 0;
847 if (GetBucketAsString(kResultBucketId, &str)) {
848 if (bufsize > 0) {
849 max_size = std::min(static_cast<size_t>(bufsize) - 1, str.size());
850 memcpy(infolog, str.c_str(), max_size);
851 infolog[max_size] = '\0';
852 GPU_CLIENT_LOG("------\n" << infolog << "\n------");
855 if (length != NULL) {
856 *length = max_size;
858 CheckGLError();
860 void GLES2Implementation::GetShaderSource(GLuint shader,
861 GLsizei bufsize,
862 GLsizei* length,
863 char* source) {
864 GPU_CLIENT_SINGLE_THREAD_CHECK();
865 GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(GLsizei, length);
866 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetShaderSource"
867 << "(" << shader << ", " << bufsize << ", "
868 << static_cast<void*>(length) << ", "
869 << static_cast<void*>(source) << ")");
870 helper_->SetBucketSize(kResultBucketId, 0);
871 helper_->GetShaderSource(shader, kResultBucketId);
872 std::string str;
873 GLsizei max_size = 0;
874 if (GetBucketAsString(kResultBucketId, &str)) {
875 if (bufsize > 0) {
876 max_size = std::min(static_cast<size_t>(bufsize) - 1, str.size());
877 memcpy(source, str.c_str(), max_size);
878 source[max_size] = '\0';
879 GPU_CLIENT_LOG("------\n" << source << "\n------");
882 if (length != NULL) {
883 *length = max_size;
885 CheckGLError();
887 void GLES2Implementation::GetTexParameterfv(GLenum target,
888 GLenum pname,
889 GLfloat* params) {
890 GPU_CLIENT_SINGLE_THREAD_CHECK();
891 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetTexParameterfv("
892 << GLES2Util::GetStringGetTexParamTarget(target) << ", "
893 << GLES2Util::GetStringTextureParameter(pname) << ", "
894 << static_cast<const void*>(params) << ")");
895 TRACE_EVENT0("gpu", "GLES2Implementation::GetTexParameterfv");
896 if (GetTexParameterfvHelper(target, pname, params)) {
897 return;
899 typedef cmds::GetTexParameterfv::Result Result;
900 Result* result = GetResultAs<Result*>();
901 if (!result) {
902 return;
904 result->SetNumResults(0);
905 helper_->GetTexParameterfv(
906 target, pname, GetResultShmId(), GetResultShmOffset());
907 WaitForCmd();
908 result->CopyResult(params);
909 GPU_CLIENT_LOG_CODE_BLOCK({
910 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
911 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
914 CheckGLError();
916 void GLES2Implementation::GetTexParameteriv(GLenum target,
917 GLenum pname,
918 GLint* params) {
919 GPU_CLIENT_SINGLE_THREAD_CHECK();
920 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
921 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetTexParameteriv("
922 << GLES2Util::GetStringGetTexParamTarget(target) << ", "
923 << GLES2Util::GetStringTextureParameter(pname) << ", "
924 << static_cast<const void*>(params) << ")");
925 TRACE_EVENT0("gpu", "GLES2Implementation::GetTexParameteriv");
926 if (GetTexParameterivHelper(target, pname, params)) {
927 return;
929 typedef cmds::GetTexParameteriv::Result Result;
930 Result* result = GetResultAs<Result*>();
931 if (!result) {
932 return;
934 result->SetNumResults(0);
935 helper_->GetTexParameteriv(
936 target, pname, GetResultShmId(), GetResultShmOffset());
937 WaitForCmd();
938 result->CopyResult(params);
939 GPU_CLIENT_LOG_CODE_BLOCK({
940 for (int32_t i = 0; i < result->GetNumResults(); ++i) {
941 GPU_CLIENT_LOG(" " << i << ": " << result->GetData()[i]);
944 CheckGLError();
946 void GLES2Implementation::Hint(GLenum target, GLenum mode) {
947 GPU_CLIENT_SINGLE_THREAD_CHECK();
948 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glHint("
949 << GLES2Util::GetStringHintTarget(target) << ", "
950 << GLES2Util::GetStringHintMode(mode) << ")");
951 helper_->Hint(target, mode);
952 CheckGLError();
955 GLboolean GLES2Implementation::IsBuffer(GLuint buffer) {
956 GPU_CLIENT_SINGLE_THREAD_CHECK();
957 TRACE_EVENT0("gpu", "GLES2Implementation::IsBuffer");
958 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsBuffer(" << buffer << ")");
959 typedef cmds::IsBuffer::Result Result;
960 Result* result = GetResultAs<Result*>();
961 if (!result) {
962 return GL_FALSE;
964 *result = 0;
965 helper_->IsBuffer(buffer, GetResultShmId(), GetResultShmOffset());
966 WaitForCmd();
967 GLboolean result_value = *result;
968 GPU_CLIENT_LOG("returned " << result_value);
969 CheckGLError();
970 return result_value;
973 GLboolean GLES2Implementation::IsFramebuffer(GLuint framebuffer) {
974 GPU_CLIENT_SINGLE_THREAD_CHECK();
975 TRACE_EVENT0("gpu", "GLES2Implementation::IsFramebuffer");
976 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsFramebuffer(" << framebuffer
977 << ")");
978 typedef cmds::IsFramebuffer::Result Result;
979 Result* result = GetResultAs<Result*>();
980 if (!result) {
981 return GL_FALSE;
983 *result = 0;
984 helper_->IsFramebuffer(framebuffer, GetResultShmId(), GetResultShmOffset());
985 WaitForCmd();
986 GLboolean result_value = *result;
987 GPU_CLIENT_LOG("returned " << result_value);
988 CheckGLError();
989 return result_value;
992 GLboolean GLES2Implementation::IsProgram(GLuint program) {
993 GPU_CLIENT_SINGLE_THREAD_CHECK();
994 TRACE_EVENT0("gpu", "GLES2Implementation::IsProgram");
995 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsProgram(" << program << ")");
996 typedef cmds::IsProgram::Result Result;
997 Result* result = GetResultAs<Result*>();
998 if (!result) {
999 return GL_FALSE;
1001 *result = 0;
1002 helper_->IsProgram(program, GetResultShmId(), GetResultShmOffset());
1003 WaitForCmd();
1004 GLboolean result_value = *result;
1005 GPU_CLIENT_LOG("returned " << result_value);
1006 CheckGLError();
1007 return result_value;
1010 GLboolean GLES2Implementation::IsRenderbuffer(GLuint renderbuffer) {
1011 GPU_CLIENT_SINGLE_THREAD_CHECK();
1012 TRACE_EVENT0("gpu", "GLES2Implementation::IsRenderbuffer");
1013 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsRenderbuffer(" << renderbuffer
1014 << ")");
1015 typedef cmds::IsRenderbuffer::Result Result;
1016 Result* result = GetResultAs<Result*>();
1017 if (!result) {
1018 return GL_FALSE;
1020 *result = 0;
1021 helper_->IsRenderbuffer(renderbuffer, GetResultShmId(), GetResultShmOffset());
1022 WaitForCmd();
1023 GLboolean result_value = *result;
1024 GPU_CLIENT_LOG("returned " << result_value);
1025 CheckGLError();
1026 return result_value;
1029 GLboolean GLES2Implementation::IsShader(GLuint shader) {
1030 GPU_CLIENT_SINGLE_THREAD_CHECK();
1031 TRACE_EVENT0("gpu", "GLES2Implementation::IsShader");
1032 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsShader(" << shader << ")");
1033 typedef cmds::IsShader::Result Result;
1034 Result* result = GetResultAs<Result*>();
1035 if (!result) {
1036 return GL_FALSE;
1038 *result = 0;
1039 helper_->IsShader(shader, GetResultShmId(), GetResultShmOffset());
1040 WaitForCmd();
1041 GLboolean result_value = *result;
1042 GPU_CLIENT_LOG("returned " << result_value);
1043 CheckGLError();
1044 return result_value;
1047 GLboolean GLES2Implementation::IsTexture(GLuint texture) {
1048 GPU_CLIENT_SINGLE_THREAD_CHECK();
1049 TRACE_EVENT0("gpu", "GLES2Implementation::IsTexture");
1050 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsTexture(" << texture << ")");
1051 typedef cmds::IsTexture::Result Result;
1052 Result* result = GetResultAs<Result*>();
1053 if (!result) {
1054 return GL_FALSE;
1056 *result = 0;
1057 helper_->IsTexture(texture, GetResultShmId(), GetResultShmOffset());
1058 WaitForCmd();
1059 GLboolean result_value = *result;
1060 GPU_CLIENT_LOG("returned " << result_value);
1061 CheckGLError();
1062 return result_value;
1065 void GLES2Implementation::LineWidth(GLfloat width) {
1066 GPU_CLIENT_SINGLE_THREAD_CHECK();
1067 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glLineWidth(" << width << ")");
1068 helper_->LineWidth(width);
1069 CheckGLError();
1072 void GLES2Implementation::PolygonOffset(GLfloat factor, GLfloat units) {
1073 GPU_CLIENT_SINGLE_THREAD_CHECK();
1074 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPolygonOffset(" << factor << ", "
1075 << units << ")");
1076 helper_->PolygonOffset(factor, units);
1077 CheckGLError();
1080 void GLES2Implementation::ReleaseShaderCompiler() {
1081 GPU_CLIENT_SINGLE_THREAD_CHECK();
1082 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glReleaseShaderCompiler("
1083 << ")");
1084 helper_->ReleaseShaderCompiler();
1085 CheckGLError();
1088 void GLES2Implementation::RenderbufferStorage(GLenum target,
1089 GLenum internalformat,
1090 GLsizei width,
1091 GLsizei height) {
1092 GPU_CLIENT_SINGLE_THREAD_CHECK();
1093 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glRenderbufferStorage("
1094 << GLES2Util::GetStringRenderBufferTarget(target) << ", "
1095 << GLES2Util::GetStringRenderBufferFormat(internalformat)
1096 << ", " << width << ", " << height << ")");
1097 if (width < 0) {
1098 SetGLError(GL_INVALID_VALUE, "glRenderbufferStorage", "width < 0");
1099 return;
1101 if (height < 0) {
1102 SetGLError(GL_INVALID_VALUE, "glRenderbufferStorage", "height < 0");
1103 return;
1105 helper_->RenderbufferStorage(target, internalformat, width, height);
1106 CheckGLError();
1109 void GLES2Implementation::SampleCoverage(GLclampf value, GLboolean invert) {
1110 GPU_CLIENT_SINGLE_THREAD_CHECK();
1111 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glSampleCoverage(" << value << ", "
1112 << GLES2Util::GetStringBool(invert) << ")");
1113 helper_->SampleCoverage(value, invert);
1114 CheckGLError();
1117 void GLES2Implementation::Scissor(GLint x,
1118 GLint y,
1119 GLsizei width,
1120 GLsizei height) {
1121 GPU_CLIENT_SINGLE_THREAD_CHECK();
1122 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glScissor(" << x << ", " << y
1123 << ", " << width << ", " << height << ")");
1124 if (width < 0) {
1125 SetGLError(GL_INVALID_VALUE, "glScissor", "width < 0");
1126 return;
1128 if (height < 0) {
1129 SetGLError(GL_INVALID_VALUE, "glScissor", "height < 0");
1130 return;
1132 helper_->Scissor(x, y, width, height);
1133 CheckGLError();
1136 void GLES2Implementation::StencilFunc(GLenum func, GLint ref, GLuint mask) {
1137 GPU_CLIENT_SINGLE_THREAD_CHECK();
1138 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilFunc("
1139 << GLES2Util::GetStringCmpFunction(func) << ", " << ref
1140 << ", " << mask << ")");
1141 helper_->StencilFunc(func, ref, mask);
1142 CheckGLError();
1145 void GLES2Implementation::StencilFuncSeparate(GLenum face,
1146 GLenum func,
1147 GLint ref,
1148 GLuint mask) {
1149 GPU_CLIENT_SINGLE_THREAD_CHECK();
1150 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilFuncSeparate("
1151 << GLES2Util::GetStringFaceType(face) << ", "
1152 << GLES2Util::GetStringCmpFunction(func) << ", " << ref
1153 << ", " << mask << ")");
1154 helper_->StencilFuncSeparate(face, func, ref, mask);
1155 CheckGLError();
1158 void GLES2Implementation::StencilMask(GLuint mask) {
1159 GPU_CLIENT_SINGLE_THREAD_CHECK();
1160 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilMask(" << mask << ")");
1161 helper_->StencilMask(mask);
1162 CheckGLError();
1165 void GLES2Implementation::StencilMaskSeparate(GLenum face, GLuint mask) {
1166 GPU_CLIENT_SINGLE_THREAD_CHECK();
1167 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilMaskSeparate("
1168 << GLES2Util::GetStringFaceType(face) << ", " << mask
1169 << ")");
1170 helper_->StencilMaskSeparate(face, mask);
1171 CheckGLError();
1174 void GLES2Implementation::StencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
1175 GPU_CLIENT_SINGLE_THREAD_CHECK();
1176 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilOp("
1177 << GLES2Util::GetStringStencilOp(fail) << ", "
1178 << GLES2Util::GetStringStencilOp(zfail) << ", "
1179 << GLES2Util::GetStringStencilOp(zpass) << ")");
1180 helper_->StencilOp(fail, zfail, zpass);
1181 CheckGLError();
1184 void GLES2Implementation::StencilOpSeparate(GLenum face,
1185 GLenum fail,
1186 GLenum zfail,
1187 GLenum zpass) {
1188 GPU_CLIENT_SINGLE_THREAD_CHECK();
1189 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilOpSeparate("
1190 << GLES2Util::GetStringFaceType(face) << ", "
1191 << GLES2Util::GetStringStencilOp(fail) << ", "
1192 << GLES2Util::GetStringStencilOp(zfail) << ", "
1193 << GLES2Util::GetStringStencilOp(zpass) << ")");
1194 helper_->StencilOpSeparate(face, fail, zfail, zpass);
1195 CheckGLError();
1198 void GLES2Implementation::TexParameterf(GLenum target,
1199 GLenum pname,
1200 GLfloat param) {
1201 GPU_CLIENT_SINGLE_THREAD_CHECK();
1202 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexParameterf("
1203 << GLES2Util::GetStringTextureBindTarget(target) << ", "
1204 << GLES2Util::GetStringTextureParameter(pname) << ", "
1205 << param << ")");
1206 helper_->TexParameterf(target, pname, param);
1207 CheckGLError();
1210 void GLES2Implementation::TexParameterfv(GLenum target,
1211 GLenum pname,
1212 const GLfloat* params) {
1213 GPU_CLIENT_SINGLE_THREAD_CHECK();
1214 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexParameterfv("
1215 << GLES2Util::GetStringTextureBindTarget(target) << ", "
1216 << GLES2Util::GetStringTextureParameter(pname) << ", "
1217 << static_cast<const void*>(params) << ")");
1218 GPU_CLIENT_LOG("values: " << params[0]);
1219 helper_->TexParameterfvImmediate(target, pname, params);
1220 CheckGLError();
1223 void GLES2Implementation::TexParameteri(GLenum target,
1224 GLenum pname,
1225 GLint param) {
1226 GPU_CLIENT_SINGLE_THREAD_CHECK();
1227 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexParameteri("
1228 << GLES2Util::GetStringTextureBindTarget(target) << ", "
1229 << GLES2Util::GetStringTextureParameter(pname) << ", "
1230 << param << ")");
1231 helper_->TexParameteri(target, pname, param);
1232 CheckGLError();
1235 void GLES2Implementation::TexParameteriv(GLenum target,
1236 GLenum pname,
1237 const GLint* params) {
1238 GPU_CLIENT_SINGLE_THREAD_CHECK();
1239 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexParameteriv("
1240 << GLES2Util::GetStringTextureBindTarget(target) << ", "
1241 << GLES2Util::GetStringTextureParameter(pname) << ", "
1242 << static_cast<const void*>(params) << ")");
1243 GPU_CLIENT_LOG("values: " << params[0]);
1244 helper_->TexParameterivImmediate(target, pname, params);
1245 CheckGLError();
1248 void GLES2Implementation::Uniform1f(GLint location, GLfloat x) {
1249 GPU_CLIENT_SINGLE_THREAD_CHECK();
1250 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1f(" << location << ", "
1251 << x << ")");
1252 helper_->Uniform1f(location, x);
1253 CheckGLError();
1256 void GLES2Implementation::Uniform1fv(GLint location,
1257 GLsizei count,
1258 const GLfloat* v) {
1259 GPU_CLIENT_SINGLE_THREAD_CHECK();
1260 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1fv(" << location << ", "
1261 << count << ", " << static_cast<const void*>(v) << ")");
1262 GPU_CLIENT_LOG_CODE_BLOCK({
1263 for (GLsizei i = 0; i < count; ++i) {
1264 GPU_CLIENT_LOG(" " << i << ": " << v[0 + i * 1]);
1267 if (count < 0) {
1268 SetGLError(GL_INVALID_VALUE, "glUniform1fv", "count < 0");
1269 return;
1271 helper_->Uniform1fvImmediate(location, count, v);
1272 CheckGLError();
1275 void GLES2Implementation::Uniform1i(GLint location, GLint x) {
1276 GPU_CLIENT_SINGLE_THREAD_CHECK();
1277 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1i(" << location << ", "
1278 << x << ")");
1279 helper_->Uniform1i(location, x);
1280 CheckGLError();
1283 void GLES2Implementation::Uniform1iv(GLint location,
1284 GLsizei count,
1285 const GLint* v) {
1286 GPU_CLIENT_SINGLE_THREAD_CHECK();
1287 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform1iv(" << location << ", "
1288 << count << ", " << static_cast<const void*>(v) << ")");
1289 GPU_CLIENT_LOG_CODE_BLOCK({
1290 for (GLsizei i = 0; i < count; ++i) {
1291 GPU_CLIENT_LOG(" " << i << ": " << v[0 + i * 1]);
1294 if (count < 0) {
1295 SetGLError(GL_INVALID_VALUE, "glUniform1iv", "count < 0");
1296 return;
1298 helper_->Uniform1ivImmediate(location, count, v);
1299 CheckGLError();
1302 void GLES2Implementation::Uniform2f(GLint location, GLfloat x, GLfloat y) {
1303 GPU_CLIENT_SINGLE_THREAD_CHECK();
1304 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform2f(" << location << ", "
1305 << x << ", " << y << ")");
1306 helper_->Uniform2f(location, x, y);
1307 CheckGLError();
1310 void GLES2Implementation::Uniform2fv(GLint location,
1311 GLsizei count,
1312 const GLfloat* v) {
1313 GPU_CLIENT_SINGLE_THREAD_CHECK();
1314 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform2fv(" << location << ", "
1315 << count << ", " << static_cast<const void*>(v) << ")");
1316 GPU_CLIENT_LOG_CODE_BLOCK({
1317 for (GLsizei i = 0; i < count; ++i) {
1318 GPU_CLIENT_LOG(" " << i << ": " << v[0 + i * 2] << ", " << v[1 + i * 2]);
1321 if (count < 0) {
1322 SetGLError(GL_INVALID_VALUE, "glUniform2fv", "count < 0");
1323 return;
1325 helper_->Uniform2fvImmediate(location, count, v);
1326 CheckGLError();
1329 void GLES2Implementation::Uniform2i(GLint location, GLint x, GLint y) {
1330 GPU_CLIENT_SINGLE_THREAD_CHECK();
1331 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform2i(" << location << ", "
1332 << x << ", " << y << ")");
1333 helper_->Uniform2i(location, x, y);
1334 CheckGLError();
1337 void GLES2Implementation::Uniform2iv(GLint location,
1338 GLsizei count,
1339 const GLint* v) {
1340 GPU_CLIENT_SINGLE_THREAD_CHECK();
1341 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform2iv(" << location << ", "
1342 << count << ", " << static_cast<const void*>(v) << ")");
1343 GPU_CLIENT_LOG_CODE_BLOCK({
1344 for (GLsizei i = 0; i < count; ++i) {
1345 GPU_CLIENT_LOG(" " << i << ": " << v[0 + i * 2] << ", " << v[1 + i * 2]);
1348 if (count < 0) {
1349 SetGLError(GL_INVALID_VALUE, "glUniform2iv", "count < 0");
1350 return;
1352 helper_->Uniform2ivImmediate(location, count, v);
1353 CheckGLError();
1356 void GLES2Implementation::Uniform3f(GLint location,
1357 GLfloat x,
1358 GLfloat y,
1359 GLfloat z) {
1360 GPU_CLIENT_SINGLE_THREAD_CHECK();
1361 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform3f(" << location << ", "
1362 << x << ", " << y << ", " << z << ")");
1363 helper_->Uniform3f(location, x, y, z);
1364 CheckGLError();
1367 void GLES2Implementation::Uniform3fv(GLint location,
1368 GLsizei count,
1369 const GLfloat* v) {
1370 GPU_CLIENT_SINGLE_THREAD_CHECK();
1371 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform3fv(" << location << ", "
1372 << count << ", " << static_cast<const void*>(v) << ")");
1373 GPU_CLIENT_LOG_CODE_BLOCK({
1374 for (GLsizei i = 0; i < count; ++i) {
1375 GPU_CLIENT_LOG(" " << i << ": " << v[0 + i * 3] << ", " << v[1 + i * 3]
1376 << ", " << v[2 + i * 3]);
1379 if (count < 0) {
1380 SetGLError(GL_INVALID_VALUE, "glUniform3fv", "count < 0");
1381 return;
1383 helper_->Uniform3fvImmediate(location, count, v);
1384 CheckGLError();
1387 void GLES2Implementation::Uniform3i(GLint location, GLint x, GLint y, GLint z) {
1388 GPU_CLIENT_SINGLE_THREAD_CHECK();
1389 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform3i(" << location << ", "
1390 << x << ", " << y << ", " << z << ")");
1391 helper_->Uniform3i(location, x, y, z);
1392 CheckGLError();
1395 void GLES2Implementation::Uniform3iv(GLint location,
1396 GLsizei count,
1397 const GLint* v) {
1398 GPU_CLIENT_SINGLE_THREAD_CHECK();
1399 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform3iv(" << location << ", "
1400 << count << ", " << static_cast<const void*>(v) << ")");
1401 GPU_CLIENT_LOG_CODE_BLOCK({
1402 for (GLsizei i = 0; i < count; ++i) {
1403 GPU_CLIENT_LOG(" " << i << ": " << v[0 + i * 3] << ", " << v[1 + i * 3]
1404 << ", " << v[2 + i * 3]);
1407 if (count < 0) {
1408 SetGLError(GL_INVALID_VALUE, "glUniform3iv", "count < 0");
1409 return;
1411 helper_->Uniform3ivImmediate(location, count, v);
1412 CheckGLError();
1415 void GLES2Implementation::Uniform4f(GLint location,
1416 GLfloat x,
1417 GLfloat y,
1418 GLfloat z,
1419 GLfloat w) {
1420 GPU_CLIENT_SINGLE_THREAD_CHECK();
1421 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform4f(" << location << ", "
1422 << x << ", " << y << ", " << z << ", " << w << ")");
1423 helper_->Uniform4f(location, x, y, z, w);
1424 CheckGLError();
1427 void GLES2Implementation::Uniform4fv(GLint location,
1428 GLsizei count,
1429 const GLfloat* v) {
1430 GPU_CLIENT_SINGLE_THREAD_CHECK();
1431 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform4fv(" << location << ", "
1432 << count << ", " << static_cast<const void*>(v) << ")");
1433 GPU_CLIENT_LOG_CODE_BLOCK({
1434 for (GLsizei i = 0; i < count; ++i) {
1435 GPU_CLIENT_LOG(" " << i << ": " << v[0 + i * 4] << ", " << v[1 + i * 4]
1436 << ", " << v[2 + i * 4] << ", " << v[3 + i * 4]);
1439 if (count < 0) {
1440 SetGLError(GL_INVALID_VALUE, "glUniform4fv", "count < 0");
1441 return;
1443 helper_->Uniform4fvImmediate(location, count, v);
1444 CheckGLError();
1447 void GLES2Implementation::Uniform4i(GLint location,
1448 GLint x,
1449 GLint y,
1450 GLint z,
1451 GLint w) {
1452 GPU_CLIENT_SINGLE_THREAD_CHECK();
1453 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform4i(" << location << ", "
1454 << x << ", " << y << ", " << z << ", " << w << ")");
1455 helper_->Uniform4i(location, x, y, z, w);
1456 CheckGLError();
1459 void GLES2Implementation::Uniform4iv(GLint location,
1460 GLsizei count,
1461 const GLint* v) {
1462 GPU_CLIENT_SINGLE_THREAD_CHECK();
1463 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniform4iv(" << location << ", "
1464 << count << ", " << static_cast<const void*>(v) << ")");
1465 GPU_CLIENT_LOG_CODE_BLOCK({
1466 for (GLsizei i = 0; i < count; ++i) {
1467 GPU_CLIENT_LOG(" " << i << ": " << v[0 + i * 4] << ", " << v[1 + i * 4]
1468 << ", " << v[2 + i * 4] << ", " << v[3 + i * 4]);
1471 if (count < 0) {
1472 SetGLError(GL_INVALID_VALUE, "glUniform4iv", "count < 0");
1473 return;
1475 helper_->Uniform4ivImmediate(location, count, v);
1476 CheckGLError();
1479 void GLES2Implementation::UniformMatrix2fv(GLint location,
1480 GLsizei count,
1481 GLboolean transpose,
1482 const GLfloat* value) {
1483 GPU_CLIENT_SINGLE_THREAD_CHECK();
1484 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix2fv(" << location
1485 << ", " << count << ", "
1486 << GLES2Util::GetStringBool(transpose) << ", "
1487 << static_cast<const void*>(value) << ")");
1488 GPU_CLIENT_LOG_CODE_BLOCK({
1489 for (GLsizei i = 0; i < count; ++i) {
1490 GPU_CLIENT_LOG(" " << i << ": " << value[0 + i * 4] << ", "
1491 << value[1 + i * 4] << ", " << value[2 + i * 4]
1492 << ", " << value[3 + i * 4]);
1495 if (count < 0) {
1496 SetGLError(GL_INVALID_VALUE, "glUniformMatrix2fv", "count < 0");
1497 return;
1499 if (transpose != false) {
1500 SetGLError(
1501 GL_INVALID_VALUE, "glUniformMatrix2fv", "transpose GL_INVALID_VALUE");
1502 return;
1504 helper_->UniformMatrix2fvImmediate(location, count, value);
1505 CheckGLError();
1508 void GLES2Implementation::UniformMatrix3fv(GLint location,
1509 GLsizei count,
1510 GLboolean transpose,
1511 const GLfloat* value) {
1512 GPU_CLIENT_SINGLE_THREAD_CHECK();
1513 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix3fv(" << location
1514 << ", " << count << ", "
1515 << GLES2Util::GetStringBool(transpose) << ", "
1516 << static_cast<const void*>(value) << ")");
1517 GPU_CLIENT_LOG_CODE_BLOCK({
1518 for (GLsizei i = 0; i < count; ++i) {
1519 GPU_CLIENT_LOG(" " << i << ": " << value[0 + i * 9] << ", "
1520 << value[1 + i * 9] << ", " << value[2 + i * 9]
1521 << ", " << value[3 + i * 9] << ", "
1522 << value[4 + i * 9] << ", " << value[5 + i * 9]
1523 << ", " << value[6 + i * 9] << ", "
1524 << value[7 + i * 9] << ", " << value[8 + i * 9]);
1527 if (count < 0) {
1528 SetGLError(GL_INVALID_VALUE, "glUniformMatrix3fv", "count < 0");
1529 return;
1531 if (transpose != false) {
1532 SetGLError(
1533 GL_INVALID_VALUE, "glUniformMatrix3fv", "transpose GL_INVALID_VALUE");
1534 return;
1536 helper_->UniformMatrix3fvImmediate(location, count, value);
1537 CheckGLError();
1540 void GLES2Implementation::UniformMatrix4fv(GLint location,
1541 GLsizei count,
1542 GLboolean transpose,
1543 const GLfloat* value) {
1544 GPU_CLIENT_SINGLE_THREAD_CHECK();
1545 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUniformMatrix4fv(" << location
1546 << ", " << count << ", "
1547 << GLES2Util::GetStringBool(transpose) << ", "
1548 << static_cast<const void*>(value) << ")");
1549 GPU_CLIENT_LOG_CODE_BLOCK({
1550 for (GLsizei i = 0; i < count; ++i) {
1551 GPU_CLIENT_LOG(
1552 " " << i << ": " << value[0 + i * 16] << ", " << value[1 + i * 16]
1553 << ", " << value[2 + i * 16] << ", " << value[3 + i * 16] << ", "
1554 << value[4 + i * 16] << ", " << value[5 + i * 16] << ", "
1555 << value[6 + i * 16] << ", " << value[7 + i * 16] << ", "
1556 << value[8 + i * 16] << ", " << value[9 + i * 16] << ", "
1557 << value[10 + i * 16] << ", " << value[11 + i * 16] << ", "
1558 << value[12 + i * 16] << ", " << value[13 + i * 16] << ", "
1559 << value[14 + i * 16] << ", " << value[15 + i * 16]);
1562 if (count < 0) {
1563 SetGLError(GL_INVALID_VALUE, "glUniformMatrix4fv", "count < 0");
1564 return;
1566 if (transpose != false) {
1567 SetGLError(
1568 GL_INVALID_VALUE, "glUniformMatrix4fv", "transpose GL_INVALID_VALUE");
1569 return;
1571 helper_->UniformMatrix4fvImmediate(location, count, value);
1572 CheckGLError();
1575 void GLES2Implementation::UseProgram(GLuint program) {
1576 GPU_CLIENT_SINGLE_THREAD_CHECK();
1577 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glUseProgram(" << program << ")");
1578 if (IsProgramReservedId(program)) {
1579 SetGLError(GL_INVALID_OPERATION, "UseProgram", "program reserved id");
1580 return;
1582 if (UseProgramHelper(program)) {
1583 helper_->UseProgram(program);
1585 CheckGLError();
1588 void GLES2Implementation::ValidateProgram(GLuint program) {
1589 GPU_CLIENT_SINGLE_THREAD_CHECK();
1590 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glValidateProgram(" << program
1591 << ")");
1592 helper_->ValidateProgram(program);
1593 CheckGLError();
1596 void GLES2Implementation::VertexAttrib1f(GLuint indx, GLfloat x) {
1597 GPU_CLIENT_SINGLE_THREAD_CHECK();
1598 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib1f(" << indx << ", "
1599 << x << ")");
1600 helper_->VertexAttrib1f(indx, x);
1601 CheckGLError();
1604 void GLES2Implementation::VertexAttrib1fv(GLuint indx, const GLfloat* values) {
1605 GPU_CLIENT_SINGLE_THREAD_CHECK();
1606 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib1fv(" << indx << ", "
1607 << static_cast<const void*>(values) << ")");
1608 GPU_CLIENT_LOG("values: " << values[0]);
1609 helper_->VertexAttrib1fvImmediate(indx, values);
1610 CheckGLError();
1613 void GLES2Implementation::VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) {
1614 GPU_CLIENT_SINGLE_THREAD_CHECK();
1615 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib2f(" << indx << ", "
1616 << x << ", " << y << ")");
1617 helper_->VertexAttrib2f(indx, x, y);
1618 CheckGLError();
1621 void GLES2Implementation::VertexAttrib2fv(GLuint indx, const GLfloat* values) {
1622 GPU_CLIENT_SINGLE_THREAD_CHECK();
1623 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib2fv(" << indx << ", "
1624 << static_cast<const void*>(values) << ")");
1625 GPU_CLIENT_LOG("values: " << values[0] << ", " << values[1]);
1626 helper_->VertexAttrib2fvImmediate(indx, values);
1627 CheckGLError();
1630 void GLES2Implementation::VertexAttrib3f(GLuint indx,
1631 GLfloat x,
1632 GLfloat y,
1633 GLfloat z) {
1634 GPU_CLIENT_SINGLE_THREAD_CHECK();
1635 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib3f(" << indx << ", "
1636 << x << ", " << y << ", " << z << ")");
1637 helper_->VertexAttrib3f(indx, x, y, z);
1638 CheckGLError();
1641 void GLES2Implementation::VertexAttrib3fv(GLuint indx, const GLfloat* values) {
1642 GPU_CLIENT_SINGLE_THREAD_CHECK();
1643 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib3fv(" << indx << ", "
1644 << static_cast<const void*>(values) << ")");
1645 GPU_CLIENT_LOG("values: " << values[0] << ", " << values[1] << ", "
1646 << values[2]);
1647 helper_->VertexAttrib3fvImmediate(indx, values);
1648 CheckGLError();
1651 void GLES2Implementation::VertexAttrib4f(GLuint indx,
1652 GLfloat x,
1653 GLfloat y,
1654 GLfloat z,
1655 GLfloat w) {
1656 GPU_CLIENT_SINGLE_THREAD_CHECK();
1657 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib4f(" << indx << ", "
1658 << x << ", " << y << ", " << z << ", " << w << ")");
1659 helper_->VertexAttrib4f(indx, x, y, z, w);
1660 CheckGLError();
1663 void GLES2Implementation::VertexAttrib4fv(GLuint indx, const GLfloat* values) {
1664 GPU_CLIENT_SINGLE_THREAD_CHECK();
1665 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttrib4fv(" << indx << ", "
1666 << static_cast<const void*>(values) << ")");
1667 GPU_CLIENT_LOG("values: " << values[0] << ", " << values[1] << ", "
1668 << values[2] << ", " << values[3]);
1669 helper_->VertexAttrib4fvImmediate(indx, values);
1670 CheckGLError();
1673 void GLES2Implementation::Viewport(GLint x,
1674 GLint y,
1675 GLsizei width,
1676 GLsizei height) {
1677 GPU_CLIENT_SINGLE_THREAD_CHECK();
1678 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glViewport(" << x << ", " << y
1679 << ", " << width << ", " << height << ")");
1680 if (width < 0) {
1681 SetGLError(GL_INVALID_VALUE, "glViewport", "width < 0");
1682 return;
1684 if (height < 0) {
1685 SetGLError(GL_INVALID_VALUE, "glViewport", "height < 0");
1686 return;
1688 helper_->Viewport(x, y, width, height);
1689 CheckGLError();
1692 void GLES2Implementation::BlitFramebufferCHROMIUM(GLint srcX0,
1693 GLint srcY0,
1694 GLint srcX1,
1695 GLint srcY1,
1696 GLint dstX0,
1697 GLint dstY0,
1698 GLint dstX1,
1699 GLint dstY1,
1700 GLbitfield mask,
1701 GLenum filter) {
1702 GPU_CLIENT_SINGLE_THREAD_CHECK();
1703 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlitFramebufferCHROMIUM("
1704 << srcX0 << ", " << srcY0 << ", " << srcX1 << ", " << srcY1
1705 << ", " << dstX0 << ", " << dstY0 << ", " << dstX1 << ", "
1706 << dstY1 << ", " << mask << ", "
1707 << GLES2Util::GetStringBlitFilter(filter) << ")");
1708 helper_->BlitFramebufferCHROMIUM(
1709 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
1710 CheckGLError();
1713 void GLES2Implementation::RenderbufferStorageMultisampleCHROMIUM(
1714 GLenum target,
1715 GLsizei samples,
1716 GLenum internalformat,
1717 GLsizei width,
1718 GLsizei height) {
1719 GPU_CLIENT_SINGLE_THREAD_CHECK();
1720 GPU_CLIENT_LOG(
1721 "[" << GetLogPrefix() << "] glRenderbufferStorageMultisampleCHROMIUM("
1722 << GLES2Util::GetStringRenderBufferTarget(target) << ", " << samples
1723 << ", " << GLES2Util::GetStringRenderBufferFormat(internalformat)
1724 << ", " << width << ", " << height << ")");
1725 if (samples < 0) {
1726 SetGLError(GL_INVALID_VALUE,
1727 "glRenderbufferStorageMultisampleCHROMIUM",
1728 "samples < 0");
1729 return;
1731 if (width < 0) {
1732 SetGLError(GL_INVALID_VALUE,
1733 "glRenderbufferStorageMultisampleCHROMIUM",
1734 "width < 0");
1735 return;
1737 if (height < 0) {
1738 SetGLError(GL_INVALID_VALUE,
1739 "glRenderbufferStorageMultisampleCHROMIUM",
1740 "height < 0");
1741 return;
1743 helper_->RenderbufferStorageMultisampleCHROMIUM(
1744 target, samples, internalformat, width, height);
1745 CheckGLError();
1748 void GLES2Implementation::RenderbufferStorageMultisampleEXT(
1749 GLenum target,
1750 GLsizei samples,
1751 GLenum internalformat,
1752 GLsizei width,
1753 GLsizei height) {
1754 GPU_CLIENT_SINGLE_THREAD_CHECK();
1755 GPU_CLIENT_LOG(
1756 "[" << GetLogPrefix() << "] glRenderbufferStorageMultisampleEXT("
1757 << GLES2Util::GetStringRenderBufferTarget(target) << ", " << samples
1758 << ", " << GLES2Util::GetStringRenderBufferFormat(internalformat)
1759 << ", " << width << ", " << height << ")");
1760 if (samples < 0) {
1761 SetGLError(
1762 GL_INVALID_VALUE, "glRenderbufferStorageMultisampleEXT", "samples < 0");
1763 return;
1765 if (width < 0) {
1766 SetGLError(
1767 GL_INVALID_VALUE, "glRenderbufferStorageMultisampleEXT", "width < 0");
1768 return;
1770 if (height < 0) {
1771 SetGLError(
1772 GL_INVALID_VALUE, "glRenderbufferStorageMultisampleEXT", "height < 0");
1773 return;
1775 helper_->RenderbufferStorageMultisampleEXT(
1776 target, samples, internalformat, width, height);
1777 CheckGLError();
1780 void GLES2Implementation::FramebufferTexture2DMultisampleEXT(GLenum target,
1781 GLenum attachment,
1782 GLenum textarget,
1783 GLuint texture,
1784 GLint level,
1785 GLsizei samples) {
1786 GPU_CLIENT_SINGLE_THREAD_CHECK();
1787 GPU_CLIENT_LOG("[" << GetLogPrefix()
1788 << "] glFramebufferTexture2DMultisampleEXT("
1789 << GLES2Util::GetStringFrameBufferTarget(target) << ", "
1790 << GLES2Util::GetStringAttachment(attachment) << ", "
1791 << GLES2Util::GetStringTextureTarget(textarget) << ", "
1792 << texture << ", " << level << ", " << samples << ")");
1793 if (level != 0) {
1794 SetGLError(GL_INVALID_VALUE,
1795 "glFramebufferTexture2DMultisampleEXT",
1796 "level GL_INVALID_VALUE");
1797 return;
1799 if (samples < 0) {
1800 SetGLError(GL_INVALID_VALUE,
1801 "glFramebufferTexture2DMultisampleEXT",
1802 "samples < 0");
1803 return;
1805 helper_->FramebufferTexture2DMultisampleEXT(
1806 target, attachment, textarget, texture, samples);
1807 CheckGLError();
1810 void GLES2Implementation::TexStorage2DEXT(GLenum target,
1811 GLsizei levels,
1812 GLenum internalFormat,
1813 GLsizei width,
1814 GLsizei height) {
1815 GPU_CLIENT_SINGLE_THREAD_CHECK();
1816 GPU_CLIENT_LOG(
1817 "[" << GetLogPrefix() << "] glTexStorage2DEXT("
1818 << GLES2Util::GetStringTextureTarget(target) << ", " << levels << ", "
1819 << GLES2Util::GetStringTextureInternalFormatStorage(internalFormat)
1820 << ", " << width << ", " << height << ")");
1821 if (levels < 0) {
1822 SetGLError(GL_INVALID_VALUE, "glTexStorage2DEXT", "levels < 0");
1823 return;
1825 if (width < 0) {
1826 SetGLError(GL_INVALID_VALUE, "glTexStorage2DEXT", "width < 0");
1827 return;
1829 if (height < 0) {
1830 SetGLError(GL_INVALID_VALUE, "glTexStorage2DEXT", "height < 0");
1831 return;
1833 helper_->TexStorage2DEXT(target, levels, internalFormat, width, height);
1834 CheckGLError();
1837 void GLES2Implementation::GenQueriesEXT(GLsizei n, GLuint* queries) {
1838 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenQueriesEXT(" << n << ", "
1839 << static_cast<const void*>(queries) << ")");
1840 if (n < 0) {
1841 SetGLError(GL_INVALID_VALUE, "glGenQueriesEXT", "n < 0");
1842 return;
1844 GPU_CLIENT_SINGLE_THREAD_CHECK();
1845 IdAllocatorInterface* id_allocator = GetIdAllocator(id_namespaces::kQueries);
1846 for (GLsizei ii = 0; ii < n; ++ii)
1847 queries[ii] = id_allocator->AllocateID();
1848 GenQueriesEXTHelper(n, queries);
1849 helper_->GenQueriesEXTImmediate(n, queries);
1850 if (share_group_->bind_generates_resource())
1851 helper_->CommandBufferHelper::Flush();
1852 GPU_CLIENT_LOG_CODE_BLOCK({
1853 for (GLsizei i = 0; i < n; ++i) {
1854 GPU_CLIENT_LOG(" " << i << ": " << queries[i]);
1857 CheckGLError();
1860 void GLES2Implementation::DeleteQueriesEXT(GLsizei n, const GLuint* queries) {
1861 GPU_CLIENT_SINGLE_THREAD_CHECK();
1862 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteQueriesEXT(" << n << ", "
1863 << static_cast<const void*>(queries) << ")");
1864 GPU_CLIENT_LOG_CODE_BLOCK({
1865 for (GLsizei i = 0; i < n; ++i) {
1866 GPU_CLIENT_LOG(" " << i << ": " << queries[i]);
1869 GPU_CLIENT_DCHECK_CODE_BLOCK({
1870 for (GLsizei i = 0; i < n; ++i) {
1871 DCHECK(queries[i] != 0);
1874 if (n < 0) {
1875 SetGLError(GL_INVALID_VALUE, "glDeleteQueriesEXT", "n < 0");
1876 return;
1878 DeleteQueriesEXTHelper(n, queries);
1879 CheckGLError();
1882 void GLES2Implementation::GenVertexArraysOES(GLsizei n, GLuint* arrays) {
1883 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenVertexArraysOES(" << n << ", "
1884 << static_cast<const void*>(arrays) << ")");
1885 if (n < 0) {
1886 SetGLError(GL_INVALID_VALUE, "glGenVertexArraysOES", "n < 0");
1887 return;
1889 GPU_CLIENT_SINGLE_THREAD_CHECK();
1890 GetIdHandler(id_namespaces::kVertexArrays)->MakeIds(this, 0, n, arrays);
1891 GenVertexArraysOESHelper(n, arrays);
1892 helper_->GenVertexArraysOESImmediate(n, arrays);
1893 if (share_group_->bind_generates_resource())
1894 helper_->CommandBufferHelper::Flush();
1895 GPU_CLIENT_LOG_CODE_BLOCK({
1896 for (GLsizei i = 0; i < n; ++i) {
1897 GPU_CLIENT_LOG(" " << i << ": " << arrays[i]);
1900 CheckGLError();
1903 void GLES2Implementation::DeleteVertexArraysOES(GLsizei n,
1904 const GLuint* arrays) {
1905 GPU_CLIENT_SINGLE_THREAD_CHECK();
1906 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteVertexArraysOES(" << n
1907 << ", " << static_cast<const void*>(arrays) << ")");
1908 GPU_CLIENT_LOG_CODE_BLOCK({
1909 for (GLsizei i = 0; i < n; ++i) {
1910 GPU_CLIENT_LOG(" " << i << ": " << arrays[i]);
1913 GPU_CLIENT_DCHECK_CODE_BLOCK({
1914 for (GLsizei i = 0; i < n; ++i) {
1915 DCHECK(arrays[i] != 0);
1918 if (n < 0) {
1919 SetGLError(GL_INVALID_VALUE, "glDeleteVertexArraysOES", "n < 0");
1920 return;
1922 DeleteVertexArraysOESHelper(n, arrays);
1923 CheckGLError();
1926 GLboolean GLES2Implementation::IsVertexArrayOES(GLuint array) {
1927 GPU_CLIENT_SINGLE_THREAD_CHECK();
1928 TRACE_EVENT0("gpu", "GLES2Implementation::IsVertexArrayOES");
1929 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsVertexArrayOES(" << array
1930 << ")");
1931 typedef cmds::IsVertexArrayOES::Result Result;
1932 Result* result = GetResultAs<Result*>();
1933 if (!result) {
1934 return GL_FALSE;
1936 *result = 0;
1937 helper_->IsVertexArrayOES(array, GetResultShmId(), GetResultShmOffset());
1938 WaitForCmd();
1939 GLboolean result_value = *result;
1940 GPU_CLIENT_LOG("returned " << result_value);
1941 CheckGLError();
1942 return result_value;
1945 void GLES2Implementation::BindVertexArrayOES(GLuint array) {
1946 GPU_CLIENT_SINGLE_THREAD_CHECK();
1947 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindVertexArrayOES(" << array
1948 << ")");
1949 if (IsVertexArrayReservedId(array)) {
1950 SetGLError(GL_INVALID_OPERATION, "BindVertexArrayOES", "array reserved id");
1951 return;
1953 if (BindVertexArrayOESHelper(array)) {
1954 helper_->BindVertexArrayOES(array);
1956 CheckGLError();
1959 void GLES2Implementation::GetTranslatedShaderSourceANGLE(GLuint shader,
1960 GLsizei bufsize,
1961 GLsizei* length,
1962 char* source) {
1963 GPU_CLIENT_SINGLE_THREAD_CHECK();
1964 GPU_CLIENT_VALIDATE_DESTINATION_OPTIONAL_INITALIZATION(GLsizei, length);
1965 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetTranslatedShaderSourceANGLE"
1966 << "(" << shader << ", " << bufsize << ", "
1967 << static_cast<void*>(length) << ", "
1968 << static_cast<void*>(source) << ")");
1969 helper_->SetBucketSize(kResultBucketId, 0);
1970 helper_->GetTranslatedShaderSourceANGLE(shader, kResultBucketId);
1971 std::string str;
1972 GLsizei max_size = 0;
1973 if (GetBucketAsString(kResultBucketId, &str)) {
1974 if (bufsize > 0) {
1975 max_size = std::min(static_cast<size_t>(bufsize) - 1, str.size());
1976 memcpy(source, str.c_str(), max_size);
1977 source[max_size] = '\0';
1978 GPU_CLIENT_LOG("------\n" << source << "\n------");
1981 if (length != NULL) {
1982 *length = max_size;
1984 CheckGLError();
1986 void GLES2Implementation::TexImageIOSurface2DCHROMIUM(GLenum target,
1987 GLsizei width,
1988 GLsizei height,
1989 GLuint ioSurfaceId,
1990 GLuint plane) {
1991 GPU_CLIENT_SINGLE_THREAD_CHECK();
1992 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTexImageIOSurface2DCHROMIUM("
1993 << GLES2Util::GetStringTextureBindTarget(target) << ", "
1994 << width << ", " << height << ", " << ioSurfaceId << ", "
1995 << plane << ")");
1996 if (width < 0) {
1997 SetGLError(GL_INVALID_VALUE, "glTexImageIOSurface2DCHROMIUM", "width < 0");
1998 return;
2000 if (height < 0) {
2001 SetGLError(GL_INVALID_VALUE, "glTexImageIOSurface2DCHROMIUM", "height < 0");
2002 return;
2004 helper_->TexImageIOSurface2DCHROMIUM(
2005 target, width, height, ioSurfaceId, plane);
2006 CheckGLError();
2009 void GLES2Implementation::CopyTextureCHROMIUM(GLenum target,
2010 GLenum source_id,
2011 GLenum dest_id,
2012 GLint level,
2013 GLint internalformat,
2014 GLenum dest_type) {
2015 GPU_CLIENT_SINGLE_THREAD_CHECK();
2016 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCopyTextureCHROMIUM("
2017 << GLES2Util::GetStringEnum(target) << ", "
2018 << GLES2Util::GetStringEnum(source_id) << ", "
2019 << GLES2Util::GetStringEnum(dest_id) << ", " << level
2020 << ", " << internalformat << ", "
2021 << GLES2Util::GetStringPixelType(dest_type) << ")");
2022 helper_->CopyTextureCHROMIUM(
2023 target, source_id, dest_id, level, internalformat, dest_type);
2024 CheckGLError();
2027 void GLES2Implementation::BindTexImage2DCHROMIUM(GLenum target, GLint imageId) {
2028 GPU_CLIENT_SINGLE_THREAD_CHECK();
2029 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindTexImage2DCHROMIUM("
2030 << GLES2Util::GetStringTextureBindTarget(target) << ", "
2031 << imageId << ")");
2032 helper_->BindTexImage2DCHROMIUM(target, imageId);
2033 CheckGLError();
2036 void GLES2Implementation::ReleaseTexImage2DCHROMIUM(GLenum target,
2037 GLint imageId) {
2038 GPU_CLIENT_SINGLE_THREAD_CHECK();
2039 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glReleaseTexImage2DCHROMIUM("
2040 << GLES2Util::GetStringTextureBindTarget(target) << ", "
2041 << imageId << ")");
2042 helper_->ReleaseTexImage2DCHROMIUM(target, imageId);
2043 CheckGLError();
2046 void GLES2Implementation::DiscardFramebufferEXT(GLenum target,
2047 GLsizei count,
2048 const GLenum* attachments) {
2049 GPU_CLIENT_SINGLE_THREAD_CHECK();
2050 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDiscardFramebufferEXT("
2051 << GLES2Util::GetStringEnum(target) << ", " << count
2052 << ", " << static_cast<const void*>(attachments) << ")");
2053 GPU_CLIENT_LOG_CODE_BLOCK({
2054 for (GLsizei i = 0; i < count; ++i) {
2055 GPU_CLIENT_LOG(" " << i << ": " << attachments[0 + i * 1]);
2058 if (count < 0) {
2059 SetGLError(GL_INVALID_VALUE, "glDiscardFramebufferEXT", "count < 0");
2060 return;
2062 helper_->DiscardFramebufferEXTImmediate(target, count, attachments);
2063 CheckGLError();
2066 void GLES2Implementation::LoseContextCHROMIUM(GLenum current, GLenum other) {
2067 GPU_CLIENT_SINGLE_THREAD_CHECK();
2068 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glLoseContextCHROMIUM("
2069 << GLES2Util::GetStringResetStatus(current) << ", "
2070 << GLES2Util::GetStringResetStatus(other) << ")");
2071 helper_->LoseContextCHROMIUM(current, other);
2072 CheckGLError();
2075 void GLES2Implementation::WaitSyncPointCHROMIUM(GLuint sync_point) {
2076 GPU_CLIENT_SINGLE_THREAD_CHECK();
2077 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glWaitSyncPointCHROMIUM("
2078 << sync_point << ")");
2079 helper_->WaitSyncPointCHROMIUM(sync_point);
2080 CheckGLError();
2083 void GLES2Implementation::DrawBuffersEXT(GLsizei count, const GLenum* bufs) {
2084 GPU_CLIENT_SINGLE_THREAD_CHECK();
2085 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDrawBuffersEXT(" << count << ", "
2086 << static_cast<const void*>(bufs) << ")");
2087 GPU_CLIENT_LOG_CODE_BLOCK({
2088 for (GLsizei i = 0; i < count; ++i) {
2089 GPU_CLIENT_LOG(" " << i << ": " << bufs[0 + i * 1]);
2092 if (count < 0) {
2093 SetGLError(GL_INVALID_VALUE, "glDrawBuffersEXT", "count < 0");
2094 return;
2096 helper_->DrawBuffersEXTImmediate(count, bufs);
2097 CheckGLError();
2100 void GLES2Implementation::DiscardBackbufferCHROMIUM() {
2101 GPU_CLIENT_SINGLE_THREAD_CHECK();
2102 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDiscardBackbufferCHROMIUM("
2103 << ")");
2104 helper_->DiscardBackbufferCHROMIUM();
2105 CheckGLError();
2108 void GLES2Implementation::ScheduleOverlayPlaneCHROMIUM(
2109 GLint plane_z_order,
2110 GLenum plane_transform,
2111 GLuint overlay_texture_id,
2112 GLint bounds_x,
2113 GLint bounds_y,
2114 GLint bounds_width,
2115 GLint bounds_height,
2116 GLfloat uv_x,
2117 GLfloat uv_y,
2118 GLfloat uv_width,
2119 GLfloat uv_height) {
2120 GPU_CLIENT_SINGLE_THREAD_CHECK();
2121 GPU_CLIENT_LOG(
2122 "[" << GetLogPrefix() << "] glScheduleOverlayPlaneCHROMIUM("
2123 << plane_z_order << ", " << GLES2Util::GetStringEnum(plane_transform)
2124 << ", " << overlay_texture_id << ", " << bounds_x << ", " << bounds_y
2125 << ", " << bounds_width << ", " << bounds_height << ", " << uv_x
2126 << ", " << uv_y << ", " << uv_width << ", " << uv_height << ")");
2127 helper_->ScheduleOverlayPlaneCHROMIUM(plane_z_order,
2128 plane_transform,
2129 overlay_texture_id,
2130 bounds_x,
2131 bounds_y,
2132 bounds_width,
2133 bounds_height,
2134 uv_x,
2135 uv_y,
2136 uv_width,
2137 uv_height);
2138 CheckGLError();
2141 void GLES2Implementation::MatrixLoadfCHROMIUM(GLenum matrixMode,
2142 const GLfloat* m) {
2143 GPU_CLIENT_SINGLE_THREAD_CHECK();
2144 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMatrixLoadfCHROMIUM("
2145 << GLES2Util::GetStringMatrixMode(matrixMode) << ", "
2146 << static_cast<const void*>(m) << ")");
2147 GPU_CLIENT_LOG("values: " << m[0] << ", " << m[1] << ", " << m[2] << ", "
2148 << m[3] << ", " << m[4] << ", " << m[5] << ", "
2149 << m[6] << ", " << m[7] << ", " << m[8] << ", "
2150 << m[9] << ", " << m[10] << ", " << m[11] << ", "
2151 << m[12] << ", " << m[13] << ", " << m[14] << ", "
2152 << m[15]);
2153 helper_->MatrixLoadfCHROMIUMImmediate(matrixMode, m);
2154 CheckGLError();
2157 void GLES2Implementation::MatrixLoadIdentityCHROMIUM(GLenum matrixMode) {
2158 GPU_CLIENT_SINGLE_THREAD_CHECK();
2159 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glMatrixLoadIdentityCHROMIUM("
2160 << GLES2Util::GetStringMatrixMode(matrixMode) << ")");
2161 helper_->MatrixLoadIdentityCHROMIUM(matrixMode);
2162 CheckGLError();
2165 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_