OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file is auto-generated from | 5 // This file is auto-generated from |
6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
7 // DO NOT EDIT! | 7 // DO NOT EDIT! |
8 | 8 |
9 // This file is included by gles2_implementation.h to declare the | 9 // This file is included by gles2_implementation.h to declare the |
10 // GL api functions. | 10 // GL api functions. |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 return; | 242 return; |
243 } | 243 } |
244 DeleteFramebuffersHelper(n, framebuffers); | 244 DeleteFramebuffersHelper(n, framebuffers); |
245 helper_->DeleteFramebuffersImmediate(n, framebuffers); | 245 helper_->DeleteFramebuffersImmediate(n, framebuffers); |
246 Flush(); | 246 Flush(); |
247 } | 247 } |
248 | 248 |
249 void DeleteProgram(GLuint program) { | 249 void DeleteProgram(GLuint program) { |
250 GPU_CLIENT_LOG("[" << this << "] glDeleteProgram(" << program << ")"); | 250 GPU_CLIENT_LOG("[" << this << "] glDeleteProgram(" << program << ")"); |
251 GPU_CLIENT_DCHECK(program != 0); | 251 GPU_CLIENT_DCHECK(program != 0); |
252 program_and_shader_id_handler_->FreeIds(1, &program); | 252 DeleteProgramOrShaderHelper(program); |
253 helper_->DeleteProgram(program); | 253 helper_->DeleteProgram(program); |
254 Flush(); | 254 Flush(); |
255 } | 255 } |
256 | 256 |
257 void DeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) { | 257 void DeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) { |
258 GPU_CLIENT_LOG("[" << this << "] glDeleteRenderbuffers(" << n << ", " << stati
c_cast<const void*>(renderbuffers) << ")"); // NOLINT | 258 GPU_CLIENT_LOG("[" << this << "] glDeleteRenderbuffers(" << n << ", " << stati
c_cast<const void*>(renderbuffers) << ")"); // NOLINT |
259 GPU_CLIENT_LOG_CODE_BLOCK({ | 259 GPU_CLIENT_LOG_CODE_BLOCK({ |
260 for (GLsizei i = 0; i < n; ++i) { | 260 for (GLsizei i = 0; i < n; ++i) { |
261 GPU_CLIENT_LOG(" " << i << ": " << renderbuffers[i]); | 261 GPU_CLIENT_LOG(" " << i << ": " << renderbuffers[i]); |
262 } | 262 } |
263 }); | 263 }); |
264 GPU_CLIENT_DCHECK_CODE_BLOCK({ | 264 GPU_CLIENT_DCHECK_CODE_BLOCK({ |
265 for (GLsizei i = 0; i < n; ++i) { | 265 for (GLsizei i = 0; i < n; ++i) { |
266 GPU_DCHECK(renderbuffers[i] != 0); | 266 GPU_DCHECK(renderbuffers[i] != 0); |
267 } | 267 } |
268 }); | 268 }); |
269 if (n < 0) { | 269 if (n < 0) { |
270 SetGLError(GL_INVALID_VALUE, "glDeleteRenderbuffers: n < 0"); | 270 SetGLError(GL_INVALID_VALUE, "glDeleteRenderbuffers: n < 0"); |
271 return; | 271 return; |
272 } | 272 } |
273 DeleteRenderbuffersHelper(n, renderbuffers); | 273 DeleteRenderbuffersHelper(n, renderbuffers); |
274 helper_->DeleteRenderbuffersImmediate(n, renderbuffers); | 274 helper_->DeleteRenderbuffersImmediate(n, renderbuffers); |
275 Flush(); | 275 Flush(); |
276 } | 276 } |
277 | 277 |
278 void DeleteShader(GLuint shader) { | 278 void DeleteShader(GLuint shader) { |
279 GPU_CLIENT_LOG("[" << this << "] glDeleteShader(" << shader << ")"); | 279 GPU_CLIENT_LOG("[" << this << "] glDeleteShader(" << shader << ")"); |
280 GPU_CLIENT_DCHECK(shader != 0); | 280 GPU_CLIENT_DCHECK(shader != 0); |
281 program_and_shader_id_handler_->FreeIds(1, &shader); | 281 DeleteProgramOrShaderHelper(shader); |
282 helper_->DeleteShader(shader); | 282 helper_->DeleteShader(shader); |
283 Flush(); | 283 Flush(); |
284 } | 284 } |
285 | 285 |
286 void DeleteTextures(GLsizei n, const GLuint* textures) { | 286 void DeleteTextures(GLsizei n, const GLuint* textures) { |
287 GPU_CLIENT_LOG("[" << this << "] glDeleteTextures(" << n << ", " << static_cas
t<const void*>(textures) << ")"); // NOLINT | 287 GPU_CLIENT_LOG("[" << this << "] glDeleteTextures(" << n << ", " << static_cas
t<const void*>(textures) << ")"); // NOLINT |
288 GPU_CLIENT_LOG_CODE_BLOCK({ | 288 GPU_CLIENT_LOG_CODE_BLOCK({ |
289 for (GLsizei i = 0; i < n; ++i) { | 289 for (GLsizei i = 0; i < n; ++i) { |
290 GPU_CLIENT_LOG(" " << i << ": " << textures[i]); | 290 GPU_CLIENT_LOG(" " << i << ": " << textures[i]); |
291 } | 291 } |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 void GetProgramInfoLog( | 564 void GetProgramInfoLog( |
565 GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) { | 565 GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) { |
566 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLsizei, length); | 566 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLsizei, length); |
567 GPU_CLIENT_LOG("[" << this << "] glGetProgramInfoLog" << "(" | 567 GPU_CLIENT_LOG("[" << this << "] glGetProgramInfoLog" << "(" |
568 << program << ", " | 568 << program << ", " |
569 << bufsize << ", " | 569 << bufsize << ", " |
570 << static_cast<void*>(length) << ", " | 570 << static_cast<void*>(length) << ", " |
571 << static_cast<void*>(infolog) << ")"); | 571 << static_cast<void*>(infolog) << ")"); |
572 helper_->SetBucketSize(kResultBucketId, 0); | 572 helper_->SetBucketSize(kResultBucketId, 0); |
573 helper_->GetProgramInfoLog(program, kResultBucketId); | 573 helper_->GetProgramInfoLog(program, kResultBucketId); |
574 if (bufsize > 0) { | 574 std::string str; |
575 std::string str; | 575 GLsizei max_size = 0; |
576 if (GetBucketAsString(kResultBucketId, &str)) { | 576 if (GetBucketAsString(kResultBucketId, &str)) { |
577 GLsizei max_size = | 577 if (bufsize > 0) { |
| 578 max_size = |
578 std::min(static_cast<size_t>(bufsize) - 1, str.size()); | 579 std::min(static_cast<size_t>(bufsize) - 1, str.size()); |
579 if (length != NULL) { | |
580 *length = max_size; | |
581 } | |
582 memcpy(infolog, str.c_str(), max_size); | 580 memcpy(infolog, str.c_str(), max_size); |
583 infolog[max_size] = '\0'; | 581 infolog[max_size] = '\0'; |
584 GPU_CLIENT_LOG("------\n" << infolog << "\n------"); | 582 GPU_CLIENT_LOG("------\n" << infolog << "\n------"); |
585 } | 583 } |
586 } | 584 } |
| 585 if (length != NULL) { |
| 586 *length = max_size; |
| 587 } |
587 } | 588 } |
588 void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) { | 589 void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) { |
589 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params); | 590 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params); |
590 GPU_CLIENT_LOG("[" << this << "] glGetRenderbufferParameteriv(" << GLES2Util::
GetStringRenderBufferTarget(target) << ", " << GLES2Util::GetStringRenderBufferP
arameter(pname) << ", " << static_cast<const void*>(params) << ")"); // NOLINT | 591 GPU_CLIENT_LOG("[" << this << "] glGetRenderbufferParameteriv(" << GLES2Util::
GetStringRenderBufferTarget(target) << ", " << GLES2Util::GetStringRenderBufferP
arameter(pname) << ", " << static_cast<const void*>(params) << ")"); // NOLINT |
591 if (GetRenderbufferParameterivHelper(target, pname, params)) { | 592 if (GetRenderbufferParameterivHelper(target, pname, params)) { |
592 return; | 593 return; |
593 } | 594 } |
594 typedef GetRenderbufferParameteriv::Result Result; | 595 typedef GetRenderbufferParameteriv::Result Result; |
595 Result* result = GetResultAs<Result*>(); | 596 Result* result = GetResultAs<Result*>(); |
596 result->SetNumResults(0); | 597 result->SetNumResults(0); |
(...skipping 29 matching lines...) Expand all Loading... |
626 void GetShaderInfoLog( | 627 void GetShaderInfoLog( |
627 GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) { | 628 GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) { |
628 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLsizei, length); | 629 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLsizei, length); |
629 GPU_CLIENT_LOG("[" << this << "] glGetShaderInfoLog" << "(" | 630 GPU_CLIENT_LOG("[" << this << "] glGetShaderInfoLog" << "(" |
630 << shader << ", " | 631 << shader << ", " |
631 << bufsize << ", " | 632 << bufsize << ", " |
632 << static_cast<void*>(length) << ", " | 633 << static_cast<void*>(length) << ", " |
633 << static_cast<void*>(infolog) << ")"); | 634 << static_cast<void*>(infolog) << ")"); |
634 helper_->SetBucketSize(kResultBucketId, 0); | 635 helper_->SetBucketSize(kResultBucketId, 0); |
635 helper_->GetShaderInfoLog(shader, kResultBucketId); | 636 helper_->GetShaderInfoLog(shader, kResultBucketId); |
636 if (bufsize > 0) { | 637 std::string str; |
637 std::string str; | 638 GLsizei max_size = 0; |
638 if (GetBucketAsString(kResultBucketId, &str)) { | 639 if (GetBucketAsString(kResultBucketId, &str)) { |
639 GLsizei max_size = | 640 if (bufsize > 0) { |
| 641 max_size = |
640 std::min(static_cast<size_t>(bufsize) - 1, str.size()); | 642 std::min(static_cast<size_t>(bufsize) - 1, str.size()); |
641 if (length != NULL) { | |
642 *length = max_size; | |
643 } | |
644 memcpy(infolog, str.c_str(), max_size); | 643 memcpy(infolog, str.c_str(), max_size); |
645 infolog[max_size] = '\0'; | 644 infolog[max_size] = '\0'; |
646 GPU_CLIENT_LOG("------\n" << infolog << "\n------"); | 645 GPU_CLIENT_LOG("------\n" << infolog << "\n------"); |
647 } | 646 } |
648 } | 647 } |
| 648 if (length != NULL) { |
| 649 *length = max_size; |
| 650 } |
649 } | 651 } |
650 void GetShaderPrecisionFormat( | 652 void GetShaderPrecisionFormat( |
651 GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); | 653 GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); |
652 | 654 |
653 void GetShaderSource( | 655 void GetShaderSource( |
654 GLuint shader, GLsizei bufsize, GLsizei* length, char* source) { | 656 GLuint shader, GLsizei bufsize, GLsizei* length, char* source) { |
655 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLsizei, length); | 657 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLsizei, length); |
656 GPU_CLIENT_LOG("[" << this << "] glGetShaderSource" << "(" | 658 GPU_CLIENT_LOG("[" << this << "] glGetShaderSource" << "(" |
657 << shader << ", " | 659 << shader << ", " |
658 << bufsize << ", " | 660 << bufsize << ", " |
659 << static_cast<void*>(length) << ", " | 661 << static_cast<void*>(length) << ", " |
660 << static_cast<void*>(source) << ")"); | 662 << static_cast<void*>(source) << ")"); |
661 helper_->SetBucketSize(kResultBucketId, 0); | 663 helper_->SetBucketSize(kResultBucketId, 0); |
662 helper_->GetShaderSource(shader, kResultBucketId); | 664 helper_->GetShaderSource(shader, kResultBucketId); |
663 if (bufsize > 0) { | 665 std::string str; |
664 std::string str; | 666 GLsizei max_size = 0; |
665 if (GetBucketAsString(kResultBucketId, &str)) { | 667 if (GetBucketAsString(kResultBucketId, &str)) { |
666 GLsizei max_size = | 668 if (bufsize > 0) { |
| 669 max_size = |
667 std::min(static_cast<size_t>(bufsize) - 1, str.size()); | 670 std::min(static_cast<size_t>(bufsize) - 1, str.size()); |
668 if (length != NULL) { | |
669 *length = max_size; | |
670 } | |
671 memcpy(source, str.c_str(), max_size); | 671 memcpy(source, str.c_str(), max_size); |
672 source[max_size] = '\0'; | 672 source[max_size] = '\0'; |
673 GPU_CLIENT_LOG("------\n" << source << "\n------"); | 673 GPU_CLIENT_LOG("------\n" << source << "\n------"); |
674 } | 674 } |
675 } | 675 } |
| 676 if (length != NULL) { |
| 677 *length = max_size; |
| 678 } |
676 } | 679 } |
677 const GLubyte* GetString(GLenum name); | 680 const GLubyte* GetString(GLenum name); |
678 | 681 |
679 void GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) { | 682 void GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) { |
680 GPU_CLIENT_LOG("[" << this << "] glGetTexParameterfv(" << GLES2Util::GetString
GetTexParamTarget(target) << ", " << GLES2Util::GetStringTextureParameter(pname)
<< ", " << static_cast<const void*>(params) << ")"); // NOLINT | 683 GPU_CLIENT_LOG("[" << this << "] glGetTexParameterfv(" << GLES2Util::GetString
GetTexParamTarget(target) << ", " << GLES2Util::GetStringTextureParameter(pname)
<< ", " << static_cast<const void*>(params) << ")"); // NOLINT |
681 if (GetTexParameterfvHelper(target, pname, params)) { | 684 if (GetTexParameterfvHelper(target, pname, params)) { |
682 return; | 685 return; |
683 } | 686 } |
684 typedef GetTexParameterfv::Result Result; | 687 typedef GetTexParameterfv::Result Result; |
685 Result* result = GetResultAs<Result*>(); | 688 Result* result = GetResultAs<Result*>(); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 WaitForCmd(); | 805 WaitForCmd(); |
803 GPU_CLIENT_LOG("returned " << *result); | 806 GPU_CLIENT_LOG("returned " << *result); |
804 return *result; | 807 return *result; |
805 } | 808 } |
806 | 809 |
807 void LineWidth(GLfloat width) { | 810 void LineWidth(GLfloat width) { |
808 GPU_CLIENT_LOG("[" << this << "] glLineWidth(" << width << ")"); | 811 GPU_CLIENT_LOG("[" << this << "] glLineWidth(" << width << ")"); |
809 helper_->LineWidth(width); | 812 helper_->LineWidth(width); |
810 } | 813 } |
811 | 814 |
812 void LinkProgram(GLuint program) { | 815 void LinkProgram(GLuint program); |
813 GPU_CLIENT_LOG("[" << this << "] glLinkProgram(" << program << ")"); | |
814 helper_->LinkProgram(program); | |
815 } | |
816 | 816 |
817 void PixelStorei(GLenum pname, GLint param); | 817 void PixelStorei(GLenum pname, GLint param); |
818 | 818 |
819 void PolygonOffset(GLfloat factor, GLfloat units) { | 819 void PolygonOffset(GLfloat factor, GLfloat units) { |
820 GPU_CLIENT_LOG("[" << this << "] glPolygonOffset(" << factor << ", " << units
<< ")"); // NOLINT | 820 GPU_CLIENT_LOG("[" << this << "] glPolygonOffset(" << factor << ", " << units
<< ")"); // NOLINT |
821 helper_->PolygonOffset(factor, units); | 821 helper_->PolygonOffset(factor, units); |
822 } | 822 } |
823 | 823 |
824 void ReadPixels( | 824 void ReadPixels( |
825 GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, | 825 GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 } | 1286 } |
1287 | 1287 |
1288 void GetMultipleIntegervCHROMIUM( | 1288 void GetMultipleIntegervCHROMIUM( |
1289 const GLenum* pnames, GLuint count, GLint* results, GLsizeiptr size); | 1289 const GLenum* pnames, GLuint count, GLint* results, GLsizeiptr size); |
1290 | 1290 |
1291 void GetProgramInfoCHROMIUM( | 1291 void GetProgramInfoCHROMIUM( |
1292 GLuint program, GLsizei bufsize, GLsizei* size, void* info); | 1292 GLuint program, GLsizei bufsize, GLsizei* size, void* info); |
1293 | 1293 |
1294 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_AUTOGEN_H_ | 1294 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_AUTOGEN_H_ |
1295 | 1295 |
OLD | NEW |