Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: gpu/command_buffer/common/gles2_cmd_utils.cc

Issue 477623004: command_buffer: Support instanced path rendering in gpu command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-03-path-funcs
Patch Set: fix msvc signedness warning in an unittest Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 return sizeof(GLuint); // NOLINT 732 return sizeof(GLuint); // NOLINT
733 case GL_FLOAT: 733 case GL_FLOAT:
734 return sizeof(GLfloat); // NOLINT 734 return sizeof(GLfloat); // NOLINT
735 case GL_FIXED: 735 case GL_FIXED:
736 return sizeof(GLfixed); // NOLINT 736 return sizeof(GLfixed); // NOLINT
737 default: 737 default:
738 return 0; 738 return 0;
739 } 739 }
740 } 740 }
741 741
742 size_t GLES2Util::GetComponentCountForGLTransformType(uint32 type) {
743 switch (type) {
744 case GL_TRANSLATE_X_CHROMIUM:
745 case GL_TRANSLATE_Y_CHROMIUM:
746 return 1;
747 case GL_TRANSLATE_2D_CHROMIUM:
748 return 2;
749 case GL_TRANSLATE_3D_CHROMIUM:
750 return 3;
751 case GL_AFFINE_2D_CHROMIUM:
752 case GL_TRANSPOSE_AFFINE_2D_CHROMIUM:
753 return 6;
754 case GL_AFFINE_3D_CHROMIUM:
755 case GL_TRANSPOSE_AFFINE_3D_CHROMIUM:
756 return 12;
757 default:
758 return 0;
759 }
760 }
761
742 size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) { 762 size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) {
743 switch (type) { 763 switch (type) {
744 case GL_BYTE: 764 case GL_BYTE:
745 return sizeof(GLbyte); // NOLINT 765 return sizeof(GLbyte); // NOLINT
746 case GL_UNSIGNED_BYTE: 766 case GL_UNSIGNED_BYTE:
747 return sizeof(GLubyte); // NOLINT 767 return sizeof(GLubyte); // NOLINT
748 case GL_SHORT: 768 case GL_SHORT:
749 return sizeof(GLshort); // NOLINT 769 return sizeof(GLshort); // NOLINT
750 case GL_UNSIGNED_SHORT: 770 case GL_UNSIGNED_SHORT:
751 return sizeof(GLushort); // NOLINT 771 return sizeof(GLushort); // NOLINT
752 case GL_FLOAT: 772 case GL_FLOAT:
753 return sizeof(GLfloat); // NOLINT 773 return sizeof(GLfloat); // NOLINT
754 default: 774 default:
755 return 0; 775 return 0;
756 } 776 }
757 } 777 }
758 778
779 size_t GLES2Util::GetGLTypeSizeForGLPathNameType(uint32 type) {
780 switch (type) {
781 case GL_BYTE:
782 return sizeof(GLbyte); // NOLINT
783 case GL_UNSIGNED_BYTE:
784 return sizeof(GLubyte); // NOLINT
785 case GL_SHORT:
786 return sizeof(GLshort); // NOLINT
787 case GL_UNSIGNED_SHORT:
788 return sizeof(GLushort); // NOLINT
789 case GL_INT:
790 return sizeof(GLint); // NOLINT
791 case GL_UNSIGNED_INT:
792 return sizeof(GLuint); // NOLINT
793 default:
794 return 0;
795 }
796 }
797
759 uint32 GLES2Util::GLErrorToErrorBit(uint32 error) { 798 uint32 GLES2Util::GLErrorToErrorBit(uint32 error) {
760 switch (error) { 799 switch (error) {
761 case GL_INVALID_ENUM: 800 case GL_INVALID_ENUM:
762 return gl_error_bit::kInvalidEnum; 801 return gl_error_bit::kInvalidEnum;
763 case GL_INVALID_VALUE: 802 case GL_INVALID_VALUE:
764 return gl_error_bit::kInvalidValue; 803 return gl_error_bit::kInvalidValue;
765 case GL_INVALID_OPERATION: 804 case GL_INVALID_OPERATION:
766 return gl_error_bit::kInvalidOperation; 805 return gl_error_bit::kInvalidOperation;
767 case GL_OUT_OF_MEMORY: 806 case GL_OUT_OF_MEMORY:
768 return gl_error_bit::kOutOfMemory; 807 return gl_error_bit::kOutOfMemory;
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 } 1428 }
1390 1429
1391 return true; 1430 return true;
1392 } 1431 }
1393 1432
1394 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" 1433 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h"
1395 1434
1396 } // namespace gles2 1435 } // namespace gles2
1397 } // namespace gpu 1436 } // namespace gpu
1398 1437
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/common/gles2_cmd_utils_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698