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

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: rebas Created 5 years, 3 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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 return sizeof(GLuint); // NOLINT 707 return sizeof(GLuint); // NOLINT
708 case GL_FLOAT: 708 case GL_FLOAT:
709 return sizeof(GLfloat); // NOLINT 709 return sizeof(GLfloat); // NOLINT
710 case GL_FIXED: 710 case GL_FIXED:
711 return sizeof(GLfixed); // NOLINT 711 return sizeof(GLfixed); // NOLINT
712 default: 712 default:
713 return 0; 713 return 0;
714 } 714 }
715 } 715 }
716 716
717 size_t GLES2Util::GetComponentCountForGLTransformType(uint32 type) {
718 switch (type) {
719 case GL_TRANSLATE_X_CHROMIUM:
720 case GL_TRANSLATE_Y_CHROMIUM:
721 return 1;
722 case GL_TRANSLATE_2D_CHROMIUM:
723 return 2;
724 case GL_TRANSLATE_3D_CHROMIUM:
725 return 3;
726 case GL_AFFINE_2D_CHROMIUM:
727 case GL_TRANSPOSE_AFFINE_2D_CHROMIUM:
728 return 6;
729 case GL_AFFINE_3D_CHROMIUM:
730 case GL_TRANSPOSE_AFFINE_3D_CHROMIUM:
731 return 12;
732 default:
733 return 0;
734 }
735 }
736
717 size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) { 737 size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) {
718 switch (type) { 738 switch (type) {
719 case GL_BYTE: 739 case GL_BYTE:
720 return sizeof(GLbyte); // NOLINT 740 return sizeof(GLbyte); // NOLINT
721 case GL_UNSIGNED_BYTE: 741 case GL_UNSIGNED_BYTE:
722 return sizeof(GLubyte); // NOLINT 742 return sizeof(GLubyte); // NOLINT
723 case GL_SHORT: 743 case GL_SHORT:
724 return sizeof(GLshort); // NOLINT 744 return sizeof(GLshort); // NOLINT
725 case GL_UNSIGNED_SHORT: 745 case GL_UNSIGNED_SHORT:
726 return sizeof(GLushort); // NOLINT 746 return sizeof(GLushort); // NOLINT
727 case GL_FLOAT: 747 case GL_FLOAT:
728 return sizeof(GLfloat); // NOLINT 748 return sizeof(GLfloat); // NOLINT
729 default: 749 default:
730 return 0; 750 return 0;
731 } 751 }
732 } 752 }
733 753
754 size_t GLES2Util::GetGLTypeSizeForGLPathNameType(uint32 type) {
755 switch (type) {
756 case GL_BYTE:
757 return sizeof(GLbyte); // NOLINT
758 case GL_UNSIGNED_BYTE:
759 return sizeof(GLubyte); // NOLINT
760 case GL_SHORT:
761 return sizeof(GLshort); // NOLINT
762 case GL_UNSIGNED_SHORT:
763 return sizeof(GLushort); // NOLINT
764 case GL_INT:
765 return sizeof(GLint); // NOLINT
766 case GL_UNSIGNED_INT:
767 return sizeof(GLuint); // NOLINT
768 default:
769 return 0;
770 }
771 }
772
734 uint32 GLES2Util::GLErrorToErrorBit(uint32 error) { 773 uint32 GLES2Util::GLErrorToErrorBit(uint32 error) {
735 switch (error) { 774 switch (error) {
736 case GL_INVALID_ENUM: 775 case GL_INVALID_ENUM:
737 return gl_error_bit::kInvalidEnum; 776 return gl_error_bit::kInvalidEnum;
738 case GL_INVALID_VALUE: 777 case GL_INVALID_VALUE:
739 return gl_error_bit::kInvalidValue; 778 return gl_error_bit::kInvalidValue;
740 case GL_INVALID_OPERATION: 779 case GL_INVALID_OPERATION:
741 return gl_error_bit::kInvalidOperation; 780 return gl_error_bit::kInvalidOperation;
742 case GL_OUT_OF_MEMORY: 781 case GL_OUT_OF_MEMORY:
743 return gl_error_bit::kOutOfMemory; 782 return gl_error_bit::kOutOfMemory;
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 } 1387 }
1349 1388
1350 return true; 1389 return true;
1351 } 1390 }
1352 1391
1353 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" 1392 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h"
1354 1393
1355 } // namespace gles2 1394 } // namespace gles2
1356 } // namespace gpu 1395 } // namespace gpu
1357 1396
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698