diff options
author | digit@chromium.org <digit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-13 20:43:24 +0000 |
---|---|---|
committer | digit@chromium.org <digit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-13 20:43:24 +0000 |
commit | 9c95e30678a21a0fc9a438345c2fcbef0c574ba4 (patch) | |
tree | 379b02d0a4cc2a30e603495fa1909f49bf80ea82 /gpu | |
parent | 8d2cde3d0ccd9110878ba6e6d2762775c258b0bc (diff) | |
download | chromium_src-9c95e30678a21a0fc9a438345c2fcbef0c574ba4.zip chromium_src-9c95e30678a21a0fc9a438345c2fcbef0c574ba4.tar.gz chromium_src-9c95e30678a21a0fc9a438345c2fcbef0c574ba4.tar.bz2 |
Make some of the non-mutable tables in gpu/command_buffer 'const'.
These tables are never, ever, modified by the code or its clients.
Adding the 'const' moves them either to read-only sections, saving
private RAM when part of Chrome for Android.
(The issue doesn't exist on the desktop where the Chrome Zygote shares
these pages between all processes anyway. Not so on Android where the
library, libchromeview.so, has to be reloaded explicitely by each
renderer process).
BUG=none
Review URL: https://chromiumcodereview.appspot.com/16638010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
5 files changed, 121 insertions, 120 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 42a6a51..460ae72 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -7364,7 +7364,7 @@ void GLES2DecoderTestBase::SetupInitStateExpectations() { file.Write(""" namespace gles2 { -NameToFunc g_gles2_function_table[] = { +extern const NameToFunc g_gles2_function_table[] = { """) for func in self.original_functions: file.Write( @@ -7468,7 +7468,7 @@ NameToFunc g_gles2_function_table[] = { enums = sorted(_ENUM_LISTS.keys()) for enum in enums: if len(_ENUM_LISTS[enum]['valid']) > 0: - file.Write("static %s valid_%s_table[] = {\n" % + file.Write("static const %s valid_%s_table[] = {\n" % (_ENUM_LISTS[enum]['type'], ToUnderscore(enum))) for value in _ENUM_LISTS[enum]['valid']: file.Write(" %s,\n" % value) @@ -7524,12 +7524,13 @@ NameToFunc g_gles2_function_table[] = { dict[value] = name file = CHeaderWriter(filename) - file.Write("static GLES2Util::EnumToString enum_to_string_table[] = {\n") + file.Write("static const GLES2Util::EnumToString " + "enum_to_string_table[] = {\n") for value in dict: file.Write(' { %s, "%s", },\n' % (value, dict[value])) file.Write("""}; -const GLES2Util::EnumToString* GLES2Util::enum_to_string_table_ = +const GLES2Util::EnumToString* const GLES2Util::enum_to_string_table_ = enum_to_string_table; const size_t GLES2Util::enum_to_string_table_len_ = sizeof(enum_to_string_table) / sizeof(enum_to_string_table[0]); @@ -7542,7 +7543,7 @@ const size_t GLES2Util::enum_to_string_table_len_ = file.Write("std::string GLES2Util::GetString%s(uint32 value) {\n" % enum) if len(_ENUM_LISTS[enum]['valid']) > 0: - file.Write(" static EnumToString string_table[] = {\n") + file.Write(" static const EnumToString string_table[] = {\n") for value in _ENUM_LISTS[enum]['valid']: file.Write(' { %s, "%s" },\n' % (value, value)) file.Write(""" }; diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h index afbf489..cc9a5cf 100644 --- a/gpu/command_buffer/client/gles2_c_lib_autogen.h +++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h @@ -761,7 +761,7 @@ void GLES2DrawBuffersEXT(GLsizei count, const GLenum* bufs) { namespace gles2 { -NameToFunc g_gles2_function_table[] = { +extern const NameToFunc g_gles2_function_table[] = { { "glActiveTexture", reinterpret_cast<GLES2FunctionPointer>( glActiveTexture), }, { "glAttachShader", reinterpret_cast<GLES2FunctionPointer>( diff --git a/gpu/command_buffer/common/gles2_cmd_utils.h b/gpu/command_buffer/common/gles2_cmd_utils.h index b821600..4bc4b1b 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.h +++ b/gpu/command_buffer/common/gles2_cmd_utils.h @@ -167,7 +167,7 @@ class GLES2_UTILS_EXPORT GLES2Util { static std::string GetQualifiedEnumString( const EnumToString* table, size_t count, uint32 value); - static const EnumToString* enum_to_string_table_; + static const EnumToString* const enum_to_string_table_; static const size_t enum_to_string_table_len_; int num_compressed_texture_formats_; diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h index f043d68..c2fab6a 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h @@ -9,7 +9,7 @@ #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_IMPLEMENTATION_AUTOGEN_H_ #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_IMPLEMENTATION_AUTOGEN_H_ -static GLES2Util::EnumToString enum_to_string_table[] = { +static const GLES2Util::EnumToString enum_to_string_table[] = { { 0x78EC, "GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM", }, { 0x8825, "GL_DRAW_BUFFER0_NV", }, { 0x0BC1, "GL_ALPHA_TEST_FUNC_QCOM", }, @@ -673,13 +673,13 @@ static GLES2Util::EnumToString enum_to_string_table[] = { { 0x8BC6, "GL_PERFMON_RESULT_AMD", }, }; -const GLES2Util::EnumToString* GLES2Util::enum_to_string_table_ = +const GLES2Util::EnumToString* const GLES2Util::enum_to_string_table_ = enum_to_string_table; const size_t GLES2Util::enum_to_string_table_len_ = sizeof(enum_to_string_table) / sizeof(enum_to_string_table[0]); std::string GLES2Util::GetStringAttachment(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_COLOR_ATTACHMENT0, "GL_COLOR_ATTACHMENT0" }, { GL_DEPTH_ATTACHMENT, "GL_DEPTH_ATTACHMENT" }, { GL_STENCIL_ATTACHMENT, "GL_STENCIL_ATTACHMENT" }, @@ -689,7 +689,7 @@ std::string GLES2Util::GetStringAttachment(uint32 value) { } std::string GLES2Util::GetStringBackbufferAttachment(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_COLOR_EXT, "GL_COLOR_EXT" }, { GL_DEPTH_EXT, "GL_DEPTH_EXT" }, { GL_STENCIL_EXT, "GL_STENCIL_EXT" }, @@ -699,7 +699,7 @@ std::string GLES2Util::GetStringBackbufferAttachment(uint32 value) { } std::string GLES2Util::GetStringBlitFilter(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_NEAREST, "GL_NEAREST" }, { GL_LINEAR, "GL_LINEAR" }, }; @@ -708,7 +708,7 @@ std::string GLES2Util::GetStringBlitFilter(uint32 value) { } std::string GLES2Util::GetStringBufferParameter(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_BUFFER_SIZE, "GL_BUFFER_SIZE" }, { GL_BUFFER_USAGE, "GL_BUFFER_USAGE" }, }; @@ -717,7 +717,7 @@ std::string GLES2Util::GetStringBufferParameter(uint32 value) { } std::string GLES2Util::GetStringBufferTarget(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_ARRAY_BUFFER, "GL_ARRAY_BUFFER" }, { GL_ELEMENT_ARRAY_BUFFER, "GL_ELEMENT_ARRAY_BUFFER" }, }; @@ -726,7 +726,7 @@ std::string GLES2Util::GetStringBufferTarget(uint32 value) { } std::string GLES2Util::GetStringBufferUsage(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_STREAM_DRAW, "GL_STREAM_DRAW" }, { GL_STATIC_DRAW, "GL_STATIC_DRAW" }, { GL_DYNAMIC_DRAW, "GL_DYNAMIC_DRAW" }, @@ -736,7 +736,7 @@ std::string GLES2Util::GetStringBufferUsage(uint32 value) { } std::string GLES2Util::GetStringCapability(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_BLEND, "GL_BLEND" }, { GL_CULL_FACE, "GL_CULL_FACE" }, { GL_DEPTH_TEST, "GL_DEPTH_TEST" }, @@ -752,7 +752,7 @@ std::string GLES2Util::GetStringCapability(uint32 value) { } std::string GLES2Util::GetStringCmpFunction(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_NEVER, "GL_NEVER" }, { GL_LESS, "GL_LESS" }, { GL_EQUAL, "GL_EQUAL" }, @@ -772,7 +772,7 @@ std::string GLES2Util::GetStringCompressedTextureFormat(uint32 value) { } std::string GLES2Util::GetStringDrawMode(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_POINTS, "GL_POINTS" }, { GL_LINE_STRIP, "GL_LINE_STRIP" }, { GL_LINE_LOOP, "GL_LINE_LOOP" }, @@ -786,7 +786,7 @@ std::string GLES2Util::GetStringDrawMode(uint32 value) { } std::string GLES2Util::GetStringDstBlendFactor(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_ZERO, "GL_ZERO" }, { GL_ONE, "GL_ONE" }, { GL_SRC_COLOR, "GL_SRC_COLOR" }, @@ -807,7 +807,7 @@ std::string GLES2Util::GetStringDstBlendFactor(uint32 value) { } std::string GLES2Util::GetStringEquation(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_FUNC_ADD, "GL_FUNC_ADD" }, { GL_FUNC_SUBTRACT, "GL_FUNC_SUBTRACT" }, { GL_FUNC_REVERSE_SUBTRACT, "GL_FUNC_REVERSE_SUBTRACT" }, @@ -817,7 +817,7 @@ std::string GLES2Util::GetStringEquation(uint32 value) { } std::string GLES2Util::GetStringFaceMode(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_CW, "GL_CW" }, { GL_CCW, "GL_CCW" }, }; @@ -826,7 +826,7 @@ std::string GLES2Util::GetStringFaceMode(uint32 value) { } std::string GLES2Util::GetStringFaceType(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_FRONT, "GL_FRONT" }, { GL_BACK, "GL_BACK" }, { GL_FRONT_AND_BACK, "GL_FRONT_AND_BACK" }, @@ -836,7 +836,7 @@ std::string GLES2Util::GetStringFaceType(uint32 value) { } std::string GLES2Util::GetStringFrameBufferParameter(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" }, { GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, @@ -851,7 +851,7 @@ std::string GLES2Util::GetStringFrameBufferParameter(uint32 value) { } std::string GLES2Util::GetStringFrameBufferTarget(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_FRAMEBUFFER, "GL_FRAMEBUFFER" }, }; return GLES2Util::GetQualifiedEnumString( @@ -859,7 +859,7 @@ std::string GLES2Util::GetStringFrameBufferTarget(uint32 value) { } std::string GLES2Util::GetStringGLState(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_ACTIVE_TEXTURE, "GL_ACTIVE_TEXTURE" }, { GL_ALIASED_LINE_WIDTH_RANGE, "GL_ALIASED_LINE_WIDTH_RANGE" }, { GL_ALIASED_POINT_SIZE_RANGE, "GL_ALIASED_POINT_SIZE_RANGE" }, @@ -968,7 +968,7 @@ std::string GLES2Util::GetStringGLState(uint32 value) { } std::string GLES2Util::GetStringGetMaxIndexType(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_UNSIGNED_BYTE, "GL_UNSIGNED_BYTE" }, { GL_UNSIGNED_SHORT, "GL_UNSIGNED_SHORT" }, { GL_UNSIGNED_INT, "GL_UNSIGNED_INT" }, @@ -978,7 +978,7 @@ std::string GLES2Util::GetStringGetMaxIndexType(uint32 value) { } std::string GLES2Util::GetStringGetTexParamTarget(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_TEXTURE_2D, "GL_TEXTURE_2D" }, { GL_TEXTURE_CUBE_MAP, "GL_TEXTURE_CUBE_MAP" }, }; @@ -987,7 +987,7 @@ std::string GLES2Util::GetStringGetTexParamTarget(uint32 value) { } std::string GLES2Util::GetStringHintMode(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_FASTEST, "GL_FASTEST" }, { GL_NICEST, "GL_NICEST" }, { GL_DONT_CARE, "GL_DONT_CARE" }, @@ -997,7 +997,7 @@ std::string GLES2Util::GetStringHintMode(uint32 value) { } std::string GLES2Util::GetStringHintTarget(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_GENERATE_MIPMAP_HINT, "GL_GENERATE_MIPMAP_HINT" }, }; return GLES2Util::GetQualifiedEnumString( @@ -1005,7 +1005,7 @@ std::string GLES2Util::GetStringHintTarget(uint32 value) { } std::string GLES2Util::GetStringIndexType(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_UNSIGNED_BYTE, "GL_UNSIGNED_BYTE" }, { GL_UNSIGNED_SHORT, "GL_UNSIGNED_SHORT" }, }; @@ -1014,7 +1014,7 @@ std::string GLES2Util::GetStringIndexType(uint32 value) { } std::string GLES2Util::GetStringPixelStore(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_PACK_ALIGNMENT, "GL_PACK_ALIGNMENT" }, { GL_UNPACK_ALIGNMENT, "GL_UNPACK_ALIGNMENT" }, { GL_UNPACK_FLIP_Y_CHROMIUM, "GL_UNPACK_FLIP_Y_CHROMIUM" }, @@ -1028,7 +1028,7 @@ std::string GLES2Util::GetStringPixelStore(uint32 value) { } std::string GLES2Util::GetStringPixelType(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_UNSIGNED_BYTE, "GL_UNSIGNED_BYTE" }, { GL_UNSIGNED_SHORT_5_6_5, "GL_UNSIGNED_SHORT_5_6_5" }, { GL_UNSIGNED_SHORT_4_4_4_4, "GL_UNSIGNED_SHORT_4_4_4_4" }, @@ -1039,7 +1039,7 @@ std::string GLES2Util::GetStringPixelType(uint32 value) { } std::string GLES2Util::GetStringProgramParameter(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_DELETE_STATUS, "GL_DELETE_STATUS" }, { GL_LINK_STATUS, "GL_LINK_STATUS" }, { GL_VALIDATE_STATUS, "GL_VALIDATE_STATUS" }, @@ -1055,7 +1055,7 @@ std::string GLES2Util::GetStringProgramParameter(uint32 value) { } std::string GLES2Util::GetStringQueryObjectParameter(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_QUERY_RESULT_EXT, "GL_QUERY_RESULT_EXT" }, { GL_QUERY_RESULT_AVAILABLE_EXT, "GL_QUERY_RESULT_AVAILABLE_EXT" }, }; @@ -1064,7 +1064,7 @@ std::string GLES2Util::GetStringQueryObjectParameter(uint32 value) { } std::string GLES2Util::GetStringQueryParameter(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_CURRENT_QUERY_EXT, "GL_CURRENT_QUERY_EXT" }, }; return GLES2Util::GetQualifiedEnumString( @@ -1072,7 +1072,7 @@ std::string GLES2Util::GetStringQueryParameter(uint32 value) { } std::string GLES2Util::GetStringQueryTarget(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_ANY_SAMPLES_PASSED_EXT, "GL_ANY_SAMPLES_PASSED_EXT" }, { GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, "GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT" }, @@ -1086,7 +1086,7 @@ std::string GLES2Util::GetStringQueryTarget(uint32 value) { } std::string GLES2Util::GetStringReadPixelFormat(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_ALPHA, "GL_ALPHA" }, { GL_RGB, "GL_RGB" }, { GL_RGBA, "GL_RGBA" }, @@ -1096,7 +1096,7 @@ std::string GLES2Util::GetStringReadPixelFormat(uint32 value) { } std::string GLES2Util::GetStringReadPixelType(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_UNSIGNED_BYTE, "GL_UNSIGNED_BYTE" }, { GL_UNSIGNED_SHORT_5_6_5, "GL_UNSIGNED_SHORT_5_6_5" }, { GL_UNSIGNED_SHORT_4_4_4_4, "GL_UNSIGNED_SHORT_4_4_4_4" }, @@ -1107,7 +1107,7 @@ std::string GLES2Util::GetStringReadPixelType(uint32 value) { } std::string GLES2Util::GetStringRenderBufferFormat(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_RGBA4, "GL_RGBA4" }, { GL_RGB565, "GL_RGB565" }, { GL_RGB5_A1, "GL_RGB5_A1" }, @@ -1119,7 +1119,7 @@ std::string GLES2Util::GetStringRenderBufferFormat(uint32 value) { } std::string GLES2Util::GetStringRenderBufferParameter(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_RENDERBUFFER_RED_SIZE, "GL_RENDERBUFFER_RED_SIZE" }, { GL_RENDERBUFFER_GREEN_SIZE, "GL_RENDERBUFFER_GREEN_SIZE" }, { GL_RENDERBUFFER_BLUE_SIZE, "GL_RENDERBUFFER_BLUE_SIZE" }, @@ -1135,7 +1135,7 @@ std::string GLES2Util::GetStringRenderBufferParameter(uint32 value) { } std::string GLES2Util::GetStringRenderBufferTarget(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_RENDERBUFFER, "GL_RENDERBUFFER" }, }; return GLES2Util::GetQualifiedEnumString( @@ -1143,7 +1143,7 @@ std::string GLES2Util::GetStringRenderBufferTarget(uint32 value) { } std::string GLES2Util::GetStringResetStatus(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_GUILTY_CONTEXT_RESET_ARB, "GL_GUILTY_CONTEXT_RESET_ARB" }, { GL_INNOCENT_CONTEXT_RESET_ARB, "GL_INNOCENT_CONTEXT_RESET_ARB" }, { GL_UNKNOWN_CONTEXT_RESET_ARB, "GL_UNKNOWN_CONTEXT_RESET_ARB" }, @@ -1158,7 +1158,7 @@ std::string GLES2Util::GetStringShaderBinaryFormat(uint32 value) { } std::string GLES2Util::GetStringShaderParameter(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_SHADER_TYPE, "GL_SHADER_TYPE" }, { GL_DELETE_STATUS, "GL_DELETE_STATUS" }, { GL_COMPILE_STATUS, "GL_COMPILE_STATUS" }, @@ -1172,7 +1172,7 @@ std::string GLES2Util::GetStringShaderParameter(uint32 value) { } std::string GLES2Util::GetStringShaderPrecision(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_LOW_FLOAT, "GL_LOW_FLOAT" }, { GL_MEDIUM_FLOAT, "GL_MEDIUM_FLOAT" }, { GL_HIGH_FLOAT, "GL_HIGH_FLOAT" }, @@ -1185,7 +1185,7 @@ std::string GLES2Util::GetStringShaderPrecision(uint32 value) { } std::string GLES2Util::GetStringShaderType(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_VERTEX_SHADER, "GL_VERTEX_SHADER" }, { GL_FRAGMENT_SHADER, "GL_FRAGMENT_SHADER" }, }; @@ -1194,7 +1194,7 @@ std::string GLES2Util::GetStringShaderType(uint32 value) { } std::string GLES2Util::GetStringSrcBlendFactor(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_ZERO, "GL_ZERO" }, { GL_ONE, "GL_ONE" }, { GL_SRC_COLOR, "GL_SRC_COLOR" }, @@ -1216,7 +1216,7 @@ std::string GLES2Util::GetStringSrcBlendFactor(uint32 value) { } std::string GLES2Util::GetStringStencilOp(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_KEEP, "GL_KEEP" }, { GL_ZERO, "GL_ZERO" }, { GL_REPLACE, "GL_REPLACE" }, @@ -1231,7 +1231,7 @@ std::string GLES2Util::GetStringStencilOp(uint32 value) { } std::string GLES2Util::GetStringStringType(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_VENDOR, "GL_VENDOR" }, { GL_RENDERER, "GL_RENDERER" }, { GL_VERSION, "GL_VERSION" }, @@ -1243,7 +1243,7 @@ std::string GLES2Util::GetStringStringType(uint32 value) { } std::string GLES2Util::GetStringTextureBindTarget(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_TEXTURE_2D, "GL_TEXTURE_2D" }, { GL_TEXTURE_CUBE_MAP, "GL_TEXTURE_CUBE_MAP" }, }; @@ -1252,7 +1252,7 @@ std::string GLES2Util::GetStringTextureBindTarget(uint32 value) { } std::string GLES2Util::GetStringTextureFormat(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_ALPHA, "GL_ALPHA" }, { GL_LUMINANCE, "GL_LUMINANCE" }, { GL_LUMINANCE_ALPHA, "GL_LUMINANCE_ALPHA" }, @@ -1264,7 +1264,7 @@ std::string GLES2Util::GetStringTextureFormat(uint32 value) { } std::string GLES2Util::GetStringTextureInternalFormat(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_ALPHA, "GL_ALPHA" }, { GL_LUMINANCE, "GL_LUMINANCE" }, { GL_LUMINANCE_ALPHA, "GL_LUMINANCE_ALPHA" }, @@ -1276,7 +1276,7 @@ std::string GLES2Util::GetStringTextureInternalFormat(uint32 value) { } std::string GLES2Util::GetStringTextureInternalFormatStorage(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_RGB565, "GL_RGB565" }, { GL_RGBA4, "GL_RGBA4" }, { GL_RGB5_A1, "GL_RGB5_A1" }, @@ -1291,7 +1291,7 @@ std::string GLES2Util::GetStringTextureInternalFormatStorage(uint32 value) { } std::string GLES2Util::GetStringTextureMagFilterMode(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_NEAREST, "GL_NEAREST" }, { GL_LINEAR, "GL_LINEAR" }, }; @@ -1300,7 +1300,7 @@ std::string GLES2Util::GetStringTextureMagFilterMode(uint32 value) { } std::string GLES2Util::GetStringTextureMinFilterMode(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_NEAREST, "GL_NEAREST" }, { GL_LINEAR, "GL_LINEAR" }, { GL_NEAREST_MIPMAP_NEAREST, "GL_NEAREST_MIPMAP_NEAREST" }, @@ -1313,7 +1313,7 @@ std::string GLES2Util::GetStringTextureMinFilterMode(uint32 value) { } std::string GLES2Util::GetStringTextureParameter(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_TEXTURE_MAG_FILTER, "GL_TEXTURE_MAG_FILTER" }, { GL_TEXTURE_MIN_FILTER, "GL_TEXTURE_MIN_FILTER" }, { GL_TEXTURE_POOL_CHROMIUM, "GL_TEXTURE_POOL_CHROMIUM" }, @@ -1325,7 +1325,7 @@ std::string GLES2Util::GetStringTextureParameter(uint32 value) { } std::string GLES2Util::GetStringTexturePool(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_TEXTURE_POOL_MANAGED_CHROMIUM, "GL_TEXTURE_POOL_MANAGED_CHROMIUM" }, { GL_TEXTURE_POOL_UNMANAGED_CHROMIUM, "GL_TEXTURE_POOL_UNMANAGED_CHROMIUM" }, @@ -1335,7 +1335,7 @@ std::string GLES2Util::GetStringTexturePool(uint32 value) { } std::string GLES2Util::GetStringTextureTarget(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_TEXTURE_2D, "GL_TEXTURE_2D" }, { GL_TEXTURE_CUBE_MAP_POSITIVE_X, "GL_TEXTURE_CUBE_MAP_POSITIVE_X" }, { GL_TEXTURE_CUBE_MAP_NEGATIVE_X, "GL_TEXTURE_CUBE_MAP_NEGATIVE_X" }, @@ -1349,7 +1349,7 @@ std::string GLES2Util::GetStringTextureTarget(uint32 value) { } std::string GLES2Util::GetStringTextureUsage(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_NONE, "GL_NONE" }, { GL_FRAMEBUFFER_ATTACHMENT_ANGLE, "GL_FRAMEBUFFER_ATTACHMENT_ANGLE" }, }; @@ -1358,7 +1358,7 @@ std::string GLES2Util::GetStringTextureUsage(uint32 value) { } std::string GLES2Util::GetStringTextureWrapMode(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_CLAMP_TO_EDGE, "GL_CLAMP_TO_EDGE" }, { GL_MIRRORED_REPEAT, "GL_MIRRORED_REPEAT" }, { GL_REPEAT, "GL_REPEAT" }, @@ -1368,7 +1368,7 @@ std::string GLES2Util::GetStringTextureWrapMode(uint32 value) { } std::string GLES2Util::GetStringVertexAttribType(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_BYTE, "GL_BYTE" }, { GL_UNSIGNED_BYTE, "GL_UNSIGNED_BYTE" }, { GL_SHORT, "GL_SHORT" }, @@ -1380,7 +1380,7 @@ std::string GLES2Util::GetStringVertexAttribType(uint32 value) { } std::string GLES2Util::GetStringVertexAttribute(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED" }, { GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" }, @@ -1395,7 +1395,7 @@ std::string GLES2Util::GetStringVertexAttribute(uint32 value) { } std::string GLES2Util::GetStringVertexPointer(uint32 value) { - static EnumToString string_table[] = { + static const EnumToString string_table[] = { { GL_VERTEX_ATTRIB_ARRAY_POINTER, "GL_VERTEX_ATTRIB_ARRAY_POINTER" }, }; return GLES2Util::GetQualifiedEnumString( diff --git a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h index ebe7e07..444cec3 100644 --- a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h @@ -9,40 +9,40 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_ // NOLINT #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_ // NOLINT -static GLenum valid_attachment_table[] = { +static const GLenum valid_attachment_table[] = { GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT, }; -static GLenum valid_backbuffer_attachment_table[] = { +static const GLenum valid_backbuffer_attachment_table[] = { GL_COLOR_EXT, GL_DEPTH_EXT, GL_STENCIL_EXT, }; -static GLenum valid_blit_filter_table[] = { +static const GLenum valid_blit_filter_table[] = { GL_NEAREST, GL_LINEAR, }; -static GLenum valid_buffer_parameter_table[] = { +static const GLenum valid_buffer_parameter_table[] = { GL_BUFFER_SIZE, GL_BUFFER_USAGE, }; -static GLenum valid_buffer_target_table[] = { +static const GLenum valid_buffer_target_table[] = { GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER, }; -static GLenum valid_buffer_usage_table[] = { +static const GLenum valid_buffer_usage_table[] = { GL_STREAM_DRAW, GL_STATIC_DRAW, GL_DYNAMIC_DRAW, }; -static GLenum valid_capability_table[] = { +static const GLenum valid_capability_table[] = { GL_BLEND, GL_CULL_FACE, GL_DEPTH_TEST, @@ -54,7 +54,7 @@ static GLenum valid_capability_table[] = { GL_STENCIL_TEST, }; -static GLenum valid_cmp_function_table[] = { +static const GLenum valid_cmp_function_table[] = { GL_NEVER, GL_LESS, GL_EQUAL, @@ -65,7 +65,7 @@ static GLenum valid_cmp_function_table[] = { GL_ALWAYS, }; -static GLenum valid_draw_mode_table[] = { +static const GLenum valid_draw_mode_table[] = { GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, @@ -75,7 +75,7 @@ static GLenum valid_draw_mode_table[] = { GL_TRIANGLES, }; -static GLenum valid_dst_blend_factor_table[] = { +static const GLenum valid_dst_blend_factor_table[] = { GL_ZERO, GL_ONE, GL_SRC_COLOR, @@ -92,39 +92,39 @@ static GLenum valid_dst_blend_factor_table[] = { GL_ONE_MINUS_CONSTANT_ALPHA, }; -static GLenum valid_equation_table[] = { +static const GLenum valid_equation_table[] = { GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, }; -static GLenum valid_face_mode_table[] = { +static const GLenum valid_face_mode_table[] = { GL_CW, GL_CCW, }; -static GLenum valid_face_type_table[] = { +static const GLenum valid_face_type_table[] = { GL_FRONT, GL_BACK, GL_FRONT_AND_BACK, }; -static GLboolean valid_false_only_table[] = { +static const GLboolean valid_false_only_table[] = { false, }; -static GLenum valid_frame_buffer_parameter_table[] = { +static const GLenum valid_frame_buffer_parameter_table[] = { GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, }; -static GLenum valid_frame_buffer_target_table[] = { +static const GLenum valid_frame_buffer_target_table[] = { GL_FRAMEBUFFER, }; -static GLenum valid_g_l_state_table[] = { +static const GLenum valid_g_l_state_table[] = { GL_ACTIVE_TEXTURE, GL_ALIASED_LINE_WIDTH_RANGE, GL_ALIASED_POINT_SIZE_RANGE, @@ -225,33 +225,33 @@ static GLenum valid_g_l_state_table[] = { GL_STENCIL_TEST, }; -static GLenum valid_get_max_index_type_table[] = { +static const GLenum valid_get_max_index_type_table[] = { GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, GL_UNSIGNED_INT, }; -static GLenum valid_get_tex_param_target_table[] = { +static const GLenum valid_get_tex_param_target_table[] = { GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, }; -static GLenum valid_hint_mode_table[] = { +static const GLenum valid_hint_mode_table[] = { GL_FASTEST, GL_NICEST, GL_DONT_CARE, }; -static GLenum valid_hint_target_table[] = { +static const GLenum valid_hint_target_table[] = { GL_GENERATE_MIPMAP_HINT, }; -static GLenum valid_index_type_table[] = { +static const GLenum valid_index_type_table[] = { GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, }; -static GLenum valid_pixel_store_table[] = { +static const GLenum valid_pixel_store_table[] = { GL_PACK_ALIGNMENT, GL_UNPACK_ALIGNMENT, GL_UNPACK_FLIP_Y_CHROMIUM, @@ -259,21 +259,21 @@ static GLenum valid_pixel_store_table[] = { GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, }; -static GLint valid_pixel_store_alignment_table[] = { +static const GLint valid_pixel_store_alignment_table[] = { 1, 2, 4, 8, }; -static GLenum valid_pixel_type_table[] = { +static const GLenum valid_pixel_type_table[] = { GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_5_5_5_1, }; -static GLenum valid_program_parameter_table[] = { +static const GLenum valid_program_parameter_table[] = { GL_DELETE_STATUS, GL_LINK_STATUS, GL_VALIDATE_STATUS, @@ -285,16 +285,16 @@ static GLenum valid_program_parameter_table[] = { GL_ACTIVE_UNIFORM_MAX_LENGTH, }; -static GLenum valid_query_object_parameter_table[] = { +static const GLenum valid_query_object_parameter_table[] = { GL_QUERY_RESULT_EXT, GL_QUERY_RESULT_AVAILABLE_EXT, }; -static GLenum valid_query_parameter_table[] = { +static const GLenum valid_query_parameter_table[] = { GL_CURRENT_QUERY_EXT, }; -static GLenum valid_query_target_table[] = { +static const GLenum valid_query_target_table[] = { GL_ANY_SAMPLES_PASSED_EXT, GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, GL_COMMANDS_ISSUED_CHROMIUM, @@ -302,20 +302,20 @@ static GLenum valid_query_target_table[] = { GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM, }; -static GLenum valid_read_pixel_format_table[] = { +static const GLenum valid_read_pixel_format_table[] = { GL_ALPHA, GL_RGB, GL_RGBA, }; -static GLenum valid_read_pixel_type_table[] = { +static const GLenum valid_read_pixel_type_table[] = { GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_5_5_5_1, }; -static GLenum valid_render_buffer_format_table[] = { +static const GLenum valid_render_buffer_format_table[] = { GL_RGBA4, GL_RGB565, GL_RGB5_A1, @@ -323,7 +323,7 @@ static GLenum valid_render_buffer_format_table[] = { GL_STENCIL_INDEX8, }; -static GLenum valid_render_buffer_parameter_table[] = { +static const GLenum valid_render_buffer_parameter_table[] = { GL_RENDERBUFFER_RED_SIZE, GL_RENDERBUFFER_GREEN_SIZE, GL_RENDERBUFFER_BLUE_SIZE, @@ -335,17 +335,17 @@ static GLenum valid_render_buffer_parameter_table[] = { GL_RENDERBUFFER_INTERNAL_FORMAT, }; -static GLenum valid_render_buffer_target_table[] = { +static const GLenum valid_render_buffer_target_table[] = { GL_RENDERBUFFER, }; -static GLenum valid_reset_status_table[] = { +static const GLenum valid_reset_status_table[] = { GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB, GL_UNKNOWN_CONTEXT_RESET_ARB, }; -static GLenum valid_shader_parameter_table[] = { +static const GLenum valid_shader_parameter_table[] = { GL_SHADER_TYPE, GL_DELETE_STATUS, GL_COMPILE_STATUS, @@ -354,7 +354,7 @@ static GLenum valid_shader_parameter_table[] = { GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE, }; -static GLenum valid_shader_precision_table[] = { +static const GLenum valid_shader_precision_table[] = { GL_LOW_FLOAT, GL_MEDIUM_FLOAT, GL_HIGH_FLOAT, @@ -363,12 +363,12 @@ static GLenum valid_shader_precision_table[] = { GL_HIGH_INT, }; -static GLenum valid_shader_type_table[] = { +static const GLenum valid_shader_type_table[] = { GL_VERTEX_SHADER, GL_FRAGMENT_SHADER, }; -static GLenum valid_src_blend_factor_table[] = { +static const GLenum valid_src_blend_factor_table[] = { GL_ZERO, GL_ONE, GL_SRC_COLOR, @@ -386,7 +386,7 @@ static GLenum valid_src_blend_factor_table[] = { GL_SRC_ALPHA_SATURATE, }; -static GLenum valid_stencil_op_table[] = { +static const GLenum valid_stencil_op_table[] = { GL_KEEP, GL_ZERO, GL_REPLACE, @@ -397,7 +397,7 @@ static GLenum valid_stencil_op_table[] = { GL_INVERT, }; -static GLenum valid_string_type_table[] = { +static const GLenum valid_string_type_table[] = { GL_VENDOR, GL_RENDERER, GL_VERSION, @@ -405,16 +405,16 @@ static GLenum valid_string_type_table[] = { GL_EXTENSIONS, }; -static GLenum valid_texture_bind_target_table[] = { +static const GLenum valid_texture_bind_target_table[] = { GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, }; -static GLint valid_texture_border_table[] = { +static const GLint valid_texture_border_table[] = { 0, }; -static GLenum valid_texture_format_table[] = { +static const GLenum valid_texture_format_table[] = { GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, @@ -422,7 +422,7 @@ static GLenum valid_texture_format_table[] = { GL_RGBA, }; -static GLenum valid_texture_internal_format_table[] = { +static const GLenum valid_texture_internal_format_table[] = { GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, @@ -430,7 +430,7 @@ static GLenum valid_texture_internal_format_table[] = { GL_RGBA, }; -static GLenum valid_texture_internal_format_storage_table[] = { +static const GLenum valid_texture_internal_format_storage_table[] = { GL_RGB565, GL_RGBA4, GL_RGB5_A1, @@ -441,12 +441,12 @@ static GLenum valid_texture_internal_format_storage_table[] = { GL_RGBA8_OES, }; -static GLenum valid_texture_mag_filter_mode_table[] = { +static const GLenum valid_texture_mag_filter_mode_table[] = { GL_NEAREST, GL_LINEAR, }; -static GLenum valid_texture_min_filter_mode_table[] = { +static const GLenum valid_texture_min_filter_mode_table[] = { GL_NEAREST, GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST, @@ -455,7 +455,7 @@ static GLenum valid_texture_min_filter_mode_table[] = { GL_LINEAR_MIPMAP_LINEAR, }; -static GLenum valid_texture_parameter_table[] = { +static const GLenum valid_texture_parameter_table[] = { GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_POOL_CHROMIUM, @@ -463,12 +463,12 @@ static GLenum valid_texture_parameter_table[] = { GL_TEXTURE_WRAP_T, }; -static GLenum valid_texture_pool_table[] = { +static const GLenum valid_texture_pool_table[] = { GL_TEXTURE_POOL_MANAGED_CHROMIUM, GL_TEXTURE_POOL_UNMANAGED_CHROMIUM, }; -static GLenum valid_texture_target_table[] = { +static const GLenum valid_texture_target_table[] = { GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, @@ -478,25 +478,25 @@ static GLenum valid_texture_target_table[] = { GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, }; -static GLenum valid_texture_usage_table[] = { +static const GLenum valid_texture_usage_table[] = { GL_NONE, GL_FRAMEBUFFER_ATTACHMENT_ANGLE, }; -static GLenum valid_texture_wrap_mode_table[] = { +static const GLenum valid_texture_wrap_mode_table[] = { GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, GL_REPEAT, }; -static GLint valid_vertex_attrib_size_table[] = { +static const GLint valid_vertex_attrib_size_table[] = { 1, 2, 3, 4, }; -static GLenum valid_vertex_attrib_type_table[] = { +static const GLenum valid_vertex_attrib_type_table[] = { GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, @@ -504,7 +504,7 @@ static GLenum valid_vertex_attrib_type_table[] = { GL_FLOAT, }; -static GLenum valid_vertex_attribute_table[] = { +static const GLenum valid_vertex_attribute_table[] = { GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, GL_VERTEX_ATTRIB_ARRAY_ENABLED, @@ -514,11 +514,11 @@ static GLenum valid_vertex_attribute_table[] = { GL_CURRENT_VERTEX_ATTRIB, }; -static GLenum valid_vertex_pointer_table[] = { +static const GLenum valid_vertex_pointer_table[] = { GL_VERTEX_ATTRIB_ARRAY_POINTER, }; -static GLint valid_zero_only_table[] = { +static const GLint valid_zero_only_table[] = { 0, }; |