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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/gles2_cmd_utils.cc
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc
index 8417b060a7951933af0142faed80a6d8257f2c3e..03764259ce8dac984a9db6a7a8eba8638618cafe 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -739,6 +739,26 @@ size_t GLES2Util::GetGLTypeSizeForTexturesAndBuffers(uint32 type) {
}
}
+size_t GLES2Util::GetComponentCountForGLTransformType(uint32 type) {
+ switch (type) {
+ case GL_TRANSLATE_X_CHROMIUM:
+ case GL_TRANSLATE_Y_CHROMIUM:
+ return 1;
+ case GL_TRANSLATE_2D_CHROMIUM:
+ return 2;
+ case GL_TRANSLATE_3D_CHROMIUM:
+ return 3;
+ case GL_AFFINE_2D_CHROMIUM:
+ case GL_TRANSPOSE_AFFINE_2D_CHROMIUM:
+ return 6;
+ case GL_AFFINE_3D_CHROMIUM:
+ case GL_TRANSPOSE_AFFINE_3D_CHROMIUM:
+ return 12;
+ default:
+ return 0;
+ }
+}
+
size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) {
switch (type) {
case GL_BYTE:
@@ -756,6 +776,25 @@ size_t GLES2Util::GetGLTypeSizeForPathCoordType(uint32 type) {
}
}
+size_t GLES2Util::GetGLTypeSizeForGLPathNameType(uint32 type) {
+ switch (type) {
+ case GL_BYTE:
+ return sizeof(GLbyte); // NOLINT
+ case GL_UNSIGNED_BYTE:
+ return sizeof(GLubyte); // NOLINT
+ case GL_SHORT:
+ return sizeof(GLshort); // NOLINT
+ case GL_UNSIGNED_SHORT:
+ return sizeof(GLushort); // NOLINT
+ case GL_INT:
+ return sizeof(GLint); // NOLINT
+ case GL_UNSIGNED_INT:
+ return sizeof(GLuint); // NOLINT
+ default:
+ return 0;
+ }
+}
+
uint32 GLES2Util::GLErrorToErrorBit(uint32 error) {
switch (error) {
case GL_INVALID_ENUM:
« 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