OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 here so other GLES2 related files can have a common set of | 5 // This file is here so other GLES2 related files can have a common set of |
6 // includes where appropriate. | 6 // includes where appropriate. |
7 | 7 |
8 #include <sstream> | 8 #include <sstream> |
9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 return sizeof(GLuint); // NOLINT | 539 return sizeof(GLuint); // NOLINT |
540 case GL_FLOAT: | 540 case GL_FLOAT: |
541 return sizeof(GLfloat); // NOLINT | 541 return sizeof(GLfloat); // NOLINT |
542 case GL_FIXED: | 542 case GL_FIXED: |
543 return sizeof(GLfixed); // NOLINT | 543 return sizeof(GLfixed); // NOLINT |
544 default: | 544 default: |
545 return 0; | 545 return 0; |
546 } | 546 } |
547 } | 547 } |
548 | 548 |
| 549 size_t GLES2Util::GetComponentCountForGLTransformType(uint32 type) { |
| 550 switch (type) { |
| 551 case GL_TRANSLATE_X_CHROMIUM: |
| 552 case GL_TRANSLATE_Y_CHROMIUM: |
| 553 return 1; |
| 554 case GL_TRANSLATE_2D_CHROMIUM: |
| 555 return 2; |
| 556 case GL_TRANSLATE_3D_CHROMIUM: |
| 557 return 3; |
| 558 case GL_AFFINE_2D_CHROMIUM: |
| 559 case GL_TRANSPOSE_AFFINE_2D_CHROMIUM: |
| 560 return 6; |
| 561 case GL_AFFINE_3D_CHROMIUM: |
| 562 case GL_TRANSPOSE_AFFINE_3D_CHROMIUM: |
| 563 return 12; |
| 564 default: |
| 565 return 0; |
| 566 } |
| 567 } |
| 568 |
549 uint32 GLES2Util::GLErrorToErrorBit(uint32 error) { | 569 uint32 GLES2Util::GLErrorToErrorBit(uint32 error) { |
550 switch (error) { | 570 switch (error) { |
551 case GL_INVALID_ENUM: | 571 case GL_INVALID_ENUM: |
552 return gl_error_bit::kInvalidEnum; | 572 return gl_error_bit::kInvalidEnum; |
553 case GL_INVALID_VALUE: | 573 case GL_INVALID_VALUE: |
554 return gl_error_bit::kInvalidValue; | 574 return gl_error_bit::kInvalidValue; |
555 case GL_INVALID_OPERATION: | 575 case GL_INVALID_OPERATION: |
556 return gl_error_bit::kInvalidOperation; | 576 return gl_error_bit::kInvalidOperation; |
557 case GL_OUT_OF_MEMORY: | 577 case GL_OUT_OF_MEMORY: |
558 return gl_error_bit::kOutOfMemory; | 578 return gl_error_bit::kOutOfMemory; |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 } | 927 } |
908 | 928 |
909 return true; | 929 return true; |
910 } | 930 } |
911 | 931 |
912 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" | 932 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" |
913 | 933 |
914 } // namespace gles2 | 934 } // namespace gles2 |
915 } // namespace gpu | 935 } // namespace gpu |
916 | 936 |
OLD | NEW |