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

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: address review comments Created 5 years, 2 months 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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 return sizeof(GLuint); // NOLINT 724 return sizeof(GLuint); // NOLINT
725 case GL_FLOAT: 725 case GL_FLOAT:
726 return sizeof(GLfloat); // NOLINT 726 return sizeof(GLfloat); // NOLINT
727 case GL_FIXED: 727 case GL_FIXED:
728 return sizeof(GLfixed); // NOLINT 728 return sizeof(GLfixed); // NOLINT
729 default: 729 default:
730 return 0; 730 return 0;
731 } 731 }
732 } 732 }
733 733
734 size_t GLES2Util::GetComponentCountForGLTransformType(uint32 type) {
735 switch (type) {
736 case GL_TRANSLATE_X_CHROMIUM:
737 case GL_TRANSLATE_Y_CHROMIUM:
738 return 1;
739 case GL_TRANSLATE_2D_CHROMIUM:
740 return 2;
741 case GL_TRANSLATE_3D_CHROMIUM:
742 return 3;
743 case GL_AFFINE_2D_CHROMIUM:
744 case GL_TRANSPOSE_AFFINE_2D_CHROMIUM:
745 return 6;
746 case GL_AFFINE_3D_CHROMIUM:
747 case GL_TRANSPOSE_AFFINE_3D_CHROMIUM:
748 return 12;
749 default:
750 return 0;
751 }
752 }
753
734 size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) { 754 size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) {
735 switch (type) { 755 switch (type) {
736 case GL_BYTE: 756 case GL_BYTE:
737 return sizeof(GLbyte); // NOLINT 757 return sizeof(GLbyte); // NOLINT
738 case GL_UNSIGNED_BYTE: 758 case GL_UNSIGNED_BYTE:
739 return sizeof(GLubyte); // NOLINT 759 return sizeof(GLubyte); // NOLINT
740 case GL_SHORT: 760 case GL_SHORT:
741 return sizeof(GLshort); // NOLINT 761 return sizeof(GLshort); // NOLINT
742 case GL_UNSIGNED_SHORT: 762 case GL_UNSIGNED_SHORT:
743 return sizeof(GLushort); // NOLINT 763 return sizeof(GLushort); // NOLINT
744 case GL_FLOAT: 764 case GL_FLOAT:
745 return sizeof(GLfloat); // NOLINT 765 return sizeof(GLfloat); // NOLINT
746 default: 766 default:
747 return 0; 767 return 0;
748 } 768 }
749 } 769 }
750 770
771 size_t GLES2Util::GetGLTypeSizeForGLPathNameType(uint32 type) {
772 switch (type) {
773 case GL_BYTE:
774 return sizeof(GLbyte); // NOLINT
775 case GL_UNSIGNED_BYTE:
776 return sizeof(GLubyte); // NOLINT
777 case GL_SHORT:
778 return sizeof(GLshort); // NOLINT
779 case GL_UNSIGNED_SHORT:
780 return sizeof(GLushort); // NOLINT
781 case GL_INT:
782 return sizeof(GLint); // NOLINT
783 case GL_UNSIGNED_INT:
784 return sizeof(GLuint); // NOLINT
785 default:
786 return 0;
787 }
788 }
789
751 uint32 GLES2Util::GLErrorToErrorBit(uint32 error) { 790 uint32 GLES2Util::GLErrorToErrorBit(uint32 error) {
752 switch (error) { 791 switch (error) {
753 case GL_INVALID_ENUM: 792 case GL_INVALID_ENUM:
754 return gl_error_bit::kInvalidEnum; 793 return gl_error_bit::kInvalidEnum;
755 case GL_INVALID_VALUE: 794 case GL_INVALID_VALUE:
756 return gl_error_bit::kInvalidValue; 795 return gl_error_bit::kInvalidValue;
757 case GL_INVALID_OPERATION: 796 case GL_INVALID_OPERATION:
758 return gl_error_bit::kInvalidOperation; 797 return gl_error_bit::kInvalidOperation;
759 case GL_OUT_OF_MEMORY: 798 case GL_OUT_OF_MEMORY:
760 return gl_error_bit::kOutOfMemory; 799 return gl_error_bit::kOutOfMemory;
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 } 1403 }
1365 1404
1366 return true; 1405 return true;
1367 } 1406 }
1368 1407
1369 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" 1408 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h"
1370 1409
1371 } // namespace gles2 1410 } // namespace gles2
1372 } // namespace gpu 1411 } // namespace gpu
1373 1412
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698