Style: Fix array initializations with size mismatches [4/8] #cleanup
Split 4/8 from: https://chromium-review.googlesource.com/c/chromium/src/+/6055399 This patch addresses inconsistencies in array initialization where the declared array size does not match the number of elements provided in the initializer list. This can lead to confusion and potential errors, as the remaining elements are implicitly initialized to zero. For example, initializing with = {2} might mislead developers into thinking the entire array is filled with 2s, when in fact only the first element is assigned that value. https://godbolt.org/z/4sbd9nreT The changes ensure that: - Array sizes accurately reflect the number of elements being explicitly initialized. - Zero-initialization is explicitly expressed using {} when intended. This improves code clarity and maintainability by making the initialization intent clear and consistent. This change also aims to allow the std::array rewriter to "crash" when encountering a mismatching size where it would be difficult to rewrite. Not having any occurrences of this pattern in the codebase will avoid the issue. Bug: 356643982 Change-Id: I9b7d34aada2302d2f027b9eeb41fc0d26b98a851 AX-Relnotes: n/a. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6062302 Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Colin Blundell <blundell@chromium.org> Cr-Commit-Position: refs/heads/main@{#1391058}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
7813bdeec9
commit
822abbc6ac
gpu
command_buffer
build_cmd_buffer_lib.py
client
gles2_implementation_unittest.ccgles2_implementation_unittest_autogen.hraster_implementation_unittest.ccraster_implementation_unittest_autogen.h
service
tests
ipc
service
perftests
@ -2197,7 +2197,7 @@ class GENnHandler(TypeHandler):
|
||||
"""Overrriden from TypeHandler."""
|
||||
code = """
|
||||
TEST_F(%(prefix)sImplementationTest, %(name)s) {
|
||||
GLuint ids[2] = { 0, };
|
||||
GLuint ids[2] = {};
|
||||
struct Cmds {
|
||||
cmds::%(name)sImmediate gen;
|
||||
GLuint data[2];
|
||||
@ -3302,7 +3302,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
|
||||
return;
|
||||
code = """
|
||||
TEST_F(%(prefix)sImplementationTest, %(name)s) {
|
||||
%(type)s data[%(count)d] = {0};
|
||||
%(type)s data[%(count)d] = {};
|
||||
struct Cmds {
|
||||
cmds::%(name)sImmediate cmd;
|
||||
%(type)s data[%(count)d];
|
||||
@ -3507,7 +3507,7 @@ TEST_P(%(test_name)s, %(name)sValidArgsCountTooLarge) {
|
||||
TEST_P(%(test_name)s, %(name)sValidArgs) {
|
||||
cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
|
||||
SpecializedSetup<cmds::%(name)s, 0>(true);
|
||||
%(data_type)s temp[%(data_count)s * 2] = { 0, };
|
||||
%(data_type)s temp[%(data_count)s * 2] = {};
|
||||
EXPECT_CALL(
|
||||
*gl_,
|
||||
%(gl_func_name)s(%(gl_args)s,
|
||||
@ -3540,7 +3540,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
|
||||
cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
|
||||
EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_any_args)s, _)).Times(0);
|
||||
SpecializedSetup<cmds::%(name)s, 0>(false);
|
||||
%(data_type)s temp[%(data_count)s * 2] = { 0, };
|
||||
%(data_type)s temp[%(data_count)s * 2] = {};
|
||||
cmd.Init(%(all_but_last_args)s, &temp[0]);
|
||||
EXPECT_EQ(error::%(parse_result)s,
|
||||
ExecuteImmediateCmd(cmd, sizeof(temp)));%(gl_error_test)s
|
||||
@ -3602,7 +3602,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
|
||||
|
||||
code = """
|
||||
TEST_F(%(prefix)sImplementationTest, %(name)s) {
|
||||
%(type)s data[%(count_param)d][%(count)d] = {{0}};
|
||||
%(type)s data[%(count_param)d][%(count)d] = {};
|
||||
struct Cmds {
|
||||
cmds::%(name)sImmediate cmd;
|
||||
%(type)s data[%(count_param)d][%(count)d];
|
||||
@ -3658,7 +3658,7 @@ TEST_F(%(prefix)sImplementationTest, %(name)s) {
|
||||
code = """
|
||||
TEST_F(%(prefix)sImplementationTest,
|
||||
%(name)sInvalidConstantArg%(invalid_index)d) {
|
||||
%(type)s data[%(count_param)d][%(count)d] = {{0}};
|
||||
%(type)s data[%(count_param)d][%(count)d] = {};
|
||||
for (int ii = 0; ii < %(count_param)d; ++ii) {
|
||||
for (int jj = 0; jj < %(count)d; ++jj) {
|
||||
data[ii][jj] = static_cast<%(type)s>(ii * %(count)d + jj);
|
||||
|
@ -1440,7 +1440,7 @@ TEST_F(GLES2ImplementationTest, GetVertexAttrib) {
|
||||
GLint stride = 0;
|
||||
GLint type = 0;
|
||||
GLint normalized = 1;
|
||||
float current[4] = { 0.0f, };
|
||||
float current[4] = {};
|
||||
|
||||
gl_->GetVertexAttribiv(
|
||||
kAttribIndex2, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &buffer_id);
|
||||
@ -3096,8 +3096,8 @@ TEST_F(GLES2ImplementationTest, MultiDrawArraysWEBGLLargerThanTransferBuffer) {
|
||||
const unsigned kDrawCount = kUsableSize / sizeof(int);
|
||||
const unsigned kChunkDrawCount = kDrawCount / 2;
|
||||
const unsigned kCountsOffset = kChunkDrawCount * sizeof(int);
|
||||
GLint firsts[kDrawCount] = {0};
|
||||
GLsizei counts[kDrawCount] = {0};
|
||||
GLint firsts[kDrawCount] = {};
|
||||
GLsizei counts[kDrawCount] = {};
|
||||
|
||||
ExpectedMemoryInfo mem1 = GetExpectedMemory(kUsableSize);
|
||||
ExpectedMemoryInfo mem2 = GetExpectedMemory(kUsableSize);
|
||||
|
@ -212,7 +212,7 @@ TEST_F(GLES2ImplementationTest, ClearBufferfi) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, ClearBufferfv) {
|
||||
GLfloat data[4] = {0};
|
||||
GLfloat data[4] = {};
|
||||
struct Cmds {
|
||||
cmds::ClearBufferfvImmediate cmd;
|
||||
GLfloat data[4];
|
||||
@ -228,7 +228,7 @@ TEST_F(GLES2ImplementationTest, ClearBufferfv) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, ClearBufferiv) {
|
||||
GLint data[4] = {0};
|
||||
GLint data[4] = {};
|
||||
struct Cmds {
|
||||
cmds::ClearBufferivImmediate cmd;
|
||||
GLint data[4];
|
||||
@ -244,7 +244,7 @@ TEST_F(GLES2ImplementationTest, ClearBufferiv) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, ClearBufferuiv) {
|
||||
GLuint data[4] = {0};
|
||||
GLuint data[4] = {};
|
||||
struct Cmds {
|
||||
cmds::ClearBufferuivImmediate cmd;
|
||||
GLuint data[4];
|
||||
@ -627,9 +627,7 @@ TEST_F(GLES2ImplementationTest, FrontFace) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, GenBuffers) {
|
||||
GLuint ids[2] = {
|
||||
0,
|
||||
};
|
||||
GLuint ids[2] = {};
|
||||
struct Cmds {
|
||||
cmds::GenBuffersImmediate gen;
|
||||
GLuint data[2];
|
||||
@ -656,9 +654,7 @@ TEST_F(GLES2ImplementationTest, GenerateMipmap) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, GenFramebuffers) {
|
||||
GLuint ids[2] = {
|
||||
0,
|
||||
};
|
||||
GLuint ids[2] = {};
|
||||
struct Cmds {
|
||||
cmds::GenFramebuffersImmediate gen;
|
||||
GLuint data[2];
|
||||
@ -674,9 +670,7 @@ TEST_F(GLES2ImplementationTest, GenFramebuffers) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, GenRenderbuffers) {
|
||||
GLuint ids[2] = {
|
||||
0,
|
||||
};
|
||||
GLuint ids[2] = {};
|
||||
struct Cmds {
|
||||
cmds::GenRenderbuffersImmediate gen;
|
||||
GLuint data[2];
|
||||
@ -692,9 +686,7 @@ TEST_F(GLES2ImplementationTest, GenRenderbuffers) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, GenSamplers) {
|
||||
GLuint ids[2] = {
|
||||
0,
|
||||
};
|
||||
GLuint ids[2] = {};
|
||||
struct Cmds {
|
||||
cmds::GenSamplersImmediate gen;
|
||||
GLuint data[2];
|
||||
@ -710,9 +702,7 @@ TEST_F(GLES2ImplementationTest, GenSamplers) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, GenTextures) {
|
||||
GLuint ids[2] = {
|
||||
0,
|
||||
};
|
||||
GLuint ids[2] = {};
|
||||
struct Cmds {
|
||||
cmds::GenTexturesImmediate gen;
|
||||
GLuint data[2];
|
||||
@ -728,9 +718,7 @@ TEST_F(GLES2ImplementationTest, GenTextures) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, GenTransformFeedbacks) {
|
||||
GLuint ids[2] = {
|
||||
0,
|
||||
};
|
||||
GLuint ids[2] = {};
|
||||
struct Cmds {
|
||||
cmds::GenTransformFeedbacksImmediate gen;
|
||||
GLuint data[2];
|
||||
@ -1162,7 +1150,7 @@ TEST_F(GLES2ImplementationTest, Hint) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, InvalidateFramebuffer) {
|
||||
GLenum data[2][1] = {{0}};
|
||||
GLenum data[2][1] = {};
|
||||
struct Cmds {
|
||||
cmds::InvalidateFramebufferImmediate cmd;
|
||||
GLenum data[2][1];
|
||||
@ -1180,7 +1168,7 @@ TEST_F(GLES2ImplementationTest, InvalidateFramebuffer) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, InvalidateSubFramebuffer) {
|
||||
GLenum data[2][1] = {{0}};
|
||||
GLenum data[2][1] = {};
|
||||
struct Cmds {
|
||||
cmds::InvalidateSubFramebufferImmediate cmd;
|
||||
GLenum data[2][1];
|
||||
@ -1490,7 +1478,7 @@ TEST_F(GLES2ImplementationTest, SamplerParameterf) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, SamplerParameterfv) {
|
||||
GLfloat data[1] = {0};
|
||||
GLfloat data[1] = {};
|
||||
struct Cmds {
|
||||
cmds::SamplerParameterfvImmediate cmd;
|
||||
GLfloat data[1];
|
||||
@ -1517,7 +1505,7 @@ TEST_F(GLES2ImplementationTest, SamplerParameteri) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, SamplerParameteriv) {
|
||||
GLint data[1] = {0};
|
||||
GLint data[1] = {};
|
||||
struct Cmds {
|
||||
cmds::SamplerParameterivImmediate cmd;
|
||||
GLint data[1];
|
||||
@ -1708,7 +1696,7 @@ TEST_F(GLES2ImplementationTest, TexParameterf) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, TexParameterfv) {
|
||||
GLfloat data[1] = {0};
|
||||
GLfloat data[1] = {};
|
||||
struct Cmds {
|
||||
cmds::TexParameterfvImmediate cmd;
|
||||
GLfloat data[1];
|
||||
@ -1735,7 +1723,7 @@ TEST_F(GLES2ImplementationTest, TexParameteri) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, TexParameteriv) {
|
||||
GLint data[1] = {0};
|
||||
GLint data[1] = {};
|
||||
struct Cmds {
|
||||
cmds::TexParameterivImmediate cmd;
|
||||
GLint data[1];
|
||||
@ -1821,7 +1809,7 @@ TEST_F(GLES2ImplementationTest, Uniform1f) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform1fv) {
|
||||
GLfloat data[2][1] = {{0}};
|
||||
GLfloat data[2][1] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform1fvImmediate cmd;
|
||||
GLfloat data[2][1];
|
||||
@ -1850,7 +1838,7 @@ TEST_F(GLES2ImplementationTest, Uniform1i) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform1iv) {
|
||||
GLint data[2][1] = {{0}};
|
||||
GLint data[2][1] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform1ivImmediate cmd;
|
||||
GLint data[2][1];
|
||||
@ -1879,7 +1867,7 @@ TEST_F(GLES2ImplementationTest, Uniform1ui) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform1uiv) {
|
||||
GLuint data[2][1] = {{0}};
|
||||
GLuint data[2][1] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform1uivImmediate cmd;
|
||||
GLuint data[2][1];
|
||||
@ -1908,7 +1896,7 @@ TEST_F(GLES2ImplementationTest, Uniform2f) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform2fv) {
|
||||
GLfloat data[2][2] = {{0}};
|
||||
GLfloat data[2][2] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform2fvImmediate cmd;
|
||||
GLfloat data[2][2];
|
||||
@ -1937,7 +1925,7 @@ TEST_F(GLES2ImplementationTest, Uniform2i) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform2iv) {
|
||||
GLint data[2][2] = {{0}};
|
||||
GLint data[2][2] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform2ivImmediate cmd;
|
||||
GLint data[2][2];
|
||||
@ -1966,7 +1954,7 @@ TEST_F(GLES2ImplementationTest, Uniform2ui) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform2uiv) {
|
||||
GLuint data[2][2] = {{0}};
|
||||
GLuint data[2][2] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform2uivImmediate cmd;
|
||||
GLuint data[2][2];
|
||||
@ -1995,7 +1983,7 @@ TEST_F(GLES2ImplementationTest, Uniform3f) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform3fv) {
|
||||
GLfloat data[2][3] = {{0}};
|
||||
GLfloat data[2][3] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform3fvImmediate cmd;
|
||||
GLfloat data[2][3];
|
||||
@ -2024,7 +2012,7 @@ TEST_F(GLES2ImplementationTest, Uniform3i) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform3iv) {
|
||||
GLint data[2][3] = {{0}};
|
||||
GLint data[2][3] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform3ivImmediate cmd;
|
||||
GLint data[2][3];
|
||||
@ -2053,7 +2041,7 @@ TEST_F(GLES2ImplementationTest, Uniform3ui) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform3uiv) {
|
||||
GLuint data[2][3] = {{0}};
|
||||
GLuint data[2][3] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform3uivImmediate cmd;
|
||||
GLuint data[2][3];
|
||||
@ -2082,7 +2070,7 @@ TEST_F(GLES2ImplementationTest, Uniform4f) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform4fv) {
|
||||
GLfloat data[2][4] = {{0}};
|
||||
GLfloat data[2][4] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform4fvImmediate cmd;
|
||||
GLfloat data[2][4];
|
||||
@ -2111,7 +2099,7 @@ TEST_F(GLES2ImplementationTest, Uniform4i) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform4iv) {
|
||||
GLint data[2][4] = {{0}};
|
||||
GLint data[2][4] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform4ivImmediate cmd;
|
||||
GLint data[2][4];
|
||||
@ -2140,7 +2128,7 @@ TEST_F(GLES2ImplementationTest, Uniform4ui) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, Uniform4uiv) {
|
||||
GLuint data[2][4] = {{0}};
|
||||
GLuint data[2][4] = {};
|
||||
struct Cmds {
|
||||
cmds::Uniform4uivImmediate cmd;
|
||||
GLuint data[2][4];
|
||||
@ -2169,7 +2157,7 @@ TEST_F(GLES2ImplementationTest, UniformBlockBinding) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, UniformMatrix2fv) {
|
||||
GLfloat data[2][4] = {{0}};
|
||||
GLfloat data[2][4] = {};
|
||||
struct Cmds {
|
||||
cmds::UniformMatrix2fvImmediate cmd;
|
||||
GLfloat data[2][4];
|
||||
@ -2187,7 +2175,7 @@ TEST_F(GLES2ImplementationTest, UniformMatrix2fv) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, UniformMatrix2x3fv) {
|
||||
GLfloat data[2][6] = {{0}};
|
||||
GLfloat data[2][6] = {};
|
||||
struct Cmds {
|
||||
cmds::UniformMatrix2x3fvImmediate cmd;
|
||||
GLfloat data[2][6];
|
||||
@ -2205,7 +2193,7 @@ TEST_F(GLES2ImplementationTest, UniformMatrix2x3fv) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, UniformMatrix2x4fv) {
|
||||
GLfloat data[2][8] = {{0}};
|
||||
GLfloat data[2][8] = {};
|
||||
struct Cmds {
|
||||
cmds::UniformMatrix2x4fvImmediate cmd;
|
||||
GLfloat data[2][8];
|
||||
@ -2223,7 +2211,7 @@ TEST_F(GLES2ImplementationTest, UniformMatrix2x4fv) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, UniformMatrix3fv) {
|
||||
GLfloat data[2][9] = {{0}};
|
||||
GLfloat data[2][9] = {};
|
||||
struct Cmds {
|
||||
cmds::UniformMatrix3fvImmediate cmd;
|
||||
GLfloat data[2][9];
|
||||
@ -2241,7 +2229,7 @@ TEST_F(GLES2ImplementationTest, UniformMatrix3fv) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, UniformMatrix3x2fv) {
|
||||
GLfloat data[2][6] = {{0}};
|
||||
GLfloat data[2][6] = {};
|
||||
struct Cmds {
|
||||
cmds::UniformMatrix3x2fvImmediate cmd;
|
||||
GLfloat data[2][6];
|
||||
@ -2259,7 +2247,7 @@ TEST_F(GLES2ImplementationTest, UniformMatrix3x2fv) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, UniformMatrix3x4fv) {
|
||||
GLfloat data[2][12] = {{0}};
|
||||
GLfloat data[2][12] = {};
|
||||
struct Cmds {
|
||||
cmds::UniformMatrix3x4fvImmediate cmd;
|
||||
GLfloat data[2][12];
|
||||
@ -2277,7 +2265,7 @@ TEST_F(GLES2ImplementationTest, UniformMatrix3x4fv) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, UniformMatrix4fv) {
|
||||
GLfloat data[2][16] = {{0}};
|
||||
GLfloat data[2][16] = {};
|
||||
struct Cmds {
|
||||
cmds::UniformMatrix4fvImmediate cmd;
|
||||
GLfloat data[2][16];
|
||||
@ -2295,7 +2283,7 @@ TEST_F(GLES2ImplementationTest, UniformMatrix4fv) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, UniformMatrix4x2fv) {
|
||||
GLfloat data[2][8] = {{0}};
|
||||
GLfloat data[2][8] = {};
|
||||
struct Cmds {
|
||||
cmds::UniformMatrix4x2fvImmediate cmd;
|
||||
GLfloat data[2][8];
|
||||
@ -2313,7 +2301,7 @@ TEST_F(GLES2ImplementationTest, UniformMatrix4x2fv) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, UniformMatrix4x3fv) {
|
||||
GLfloat data[2][12] = {{0}};
|
||||
GLfloat data[2][12] = {};
|
||||
struct Cmds {
|
||||
cmds::UniformMatrix4x3fvImmediate cmd;
|
||||
GLfloat data[2][12];
|
||||
@ -2367,7 +2355,7 @@ TEST_F(GLES2ImplementationTest, VertexAttrib1f) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, VertexAttrib1fv) {
|
||||
GLfloat data[1] = {0};
|
||||
GLfloat data[1] = {};
|
||||
struct Cmds {
|
||||
cmds::VertexAttrib1fvImmediate cmd;
|
||||
GLfloat data[1];
|
||||
@ -2394,7 +2382,7 @@ TEST_F(GLES2ImplementationTest, VertexAttrib2f) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, VertexAttrib2fv) {
|
||||
GLfloat data[2] = {0};
|
||||
GLfloat data[2] = {};
|
||||
struct Cmds {
|
||||
cmds::VertexAttrib2fvImmediate cmd;
|
||||
GLfloat data[2];
|
||||
@ -2421,7 +2409,7 @@ TEST_F(GLES2ImplementationTest, VertexAttrib3f) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, VertexAttrib3fv) {
|
||||
GLfloat data[3] = {0};
|
||||
GLfloat data[3] = {};
|
||||
struct Cmds {
|
||||
cmds::VertexAttrib3fvImmediate cmd;
|
||||
GLfloat data[3];
|
||||
@ -2448,7 +2436,7 @@ TEST_F(GLES2ImplementationTest, VertexAttrib4f) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, VertexAttrib4fv) {
|
||||
GLfloat data[4] = {0};
|
||||
GLfloat data[4] = {};
|
||||
struct Cmds {
|
||||
cmds::VertexAttrib4fvImmediate cmd;
|
||||
GLfloat data[4];
|
||||
@ -2475,7 +2463,7 @@ TEST_F(GLES2ImplementationTest, VertexAttribI4i) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, VertexAttribI4iv) {
|
||||
GLint data[4] = {0};
|
||||
GLint data[4] = {};
|
||||
struct Cmds {
|
||||
cmds::VertexAttribI4ivImmediate cmd;
|
||||
GLint data[4];
|
||||
@ -2502,7 +2490,7 @@ TEST_F(GLES2ImplementationTest, VertexAttribI4ui) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, VertexAttribI4uiv) {
|
||||
GLuint data[4] = {0};
|
||||
GLuint data[4] = {};
|
||||
struct Cmds {
|
||||
cmds::VertexAttribI4uivImmediate cmd;
|
||||
GLuint data[4];
|
||||
@ -2599,9 +2587,7 @@ TEST_F(GLES2ImplementationTest, TexStorage2DEXT) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, GenQueriesEXT) {
|
||||
GLuint ids[2] = {
|
||||
0,
|
||||
};
|
||||
GLuint ids[2] = {};
|
||||
struct Cmds {
|
||||
cmds::GenQueriesEXTImmediate gen;
|
||||
GLuint data[2];
|
||||
@ -2664,9 +2650,7 @@ TEST_F(GLES2ImplementationTest, PopGroupMarkerEXT) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, GenVertexArraysOES) {
|
||||
GLuint ids[2] = {
|
||||
0,
|
||||
};
|
||||
GLuint ids[2] = {};
|
||||
struct Cmds {
|
||||
cmds::GenVertexArraysOESImmediate gen;
|
||||
GLuint data[2];
|
||||
@ -2880,7 +2864,7 @@ TEST_F(GLES2ImplementationTest, VertexAttribDivisorANGLE) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, DiscardFramebufferEXT) {
|
||||
GLenum data[2][1] = {{0}};
|
||||
GLenum data[2][1] = {};
|
||||
struct Cmds {
|
||||
cmds::DiscardFramebufferEXTImmediate cmd;
|
||||
GLenum data[2][1];
|
||||
@ -2910,7 +2894,7 @@ TEST_F(GLES2ImplementationTest, LoseContextCHROMIUM) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, DrawBuffersEXT) {
|
||||
GLenum data[1][1] = {{0}};
|
||||
GLenum data[1][1] = {};
|
||||
struct Cmds {
|
||||
cmds::DrawBuffersEXTImmediate cmd;
|
||||
GLenum data[1][1];
|
||||
@ -2939,7 +2923,7 @@ TEST_F(GLES2ImplementationTest, FlushDriverCachesCHROMIUM) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, WindowRectanglesEXT) {
|
||||
GLint data[2][4] = {{0}};
|
||||
GLint data[2][4] = {};
|
||||
struct Cmds {
|
||||
cmds::WindowRectanglesEXTImmediate cmd;
|
||||
GLint data[2][4];
|
||||
@ -3001,7 +2985,7 @@ TEST_F(GLES2ImplementationTest, EndSharedImageAccessDirectCHROMIUM) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, CopySharedImageINTERNAL) {
|
||||
GLbyte data[32] = {0};
|
||||
GLbyte data[32] = {};
|
||||
struct Cmds {
|
||||
cmds::CopySharedImageINTERNALImmediate cmd;
|
||||
GLbyte data[32];
|
||||
@ -3017,7 +3001,7 @@ TEST_F(GLES2ImplementationTest, CopySharedImageINTERNAL) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, CopySharedImageToTextureINTERNAL) {
|
||||
GLbyte data[16] = {0};
|
||||
GLbyte data[16] = {};
|
||||
struct Cmds {
|
||||
cmds::CopySharedImageToTextureINTERNALImmediate cmd;
|
||||
GLbyte data[16];
|
||||
@ -3143,7 +3127,7 @@ TEST_F(GLES2ImplementationTest, FramebufferTexturePixelLocalStorageANGLE) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, FramebufferPixelLocalClearValuefvANGLE) {
|
||||
GLfloat data[4] = {0};
|
||||
GLfloat data[4] = {};
|
||||
struct Cmds {
|
||||
cmds::FramebufferPixelLocalClearValuefvANGLEImmediate cmd;
|
||||
GLfloat data[4];
|
||||
@ -3159,7 +3143,7 @@ TEST_F(GLES2ImplementationTest, FramebufferPixelLocalClearValuefvANGLE) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, FramebufferPixelLocalClearValueivANGLE) {
|
||||
GLint data[4] = {0};
|
||||
GLint data[4] = {};
|
||||
struct Cmds {
|
||||
cmds::FramebufferPixelLocalClearValueivANGLEImmediate cmd;
|
||||
GLint data[4];
|
||||
@ -3175,7 +3159,7 @@ TEST_F(GLES2ImplementationTest, FramebufferPixelLocalClearValueivANGLE) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, FramebufferPixelLocalClearValueuivANGLE) {
|
||||
GLuint data[4] = {0};
|
||||
GLuint data[4] = {};
|
||||
struct Cmds {
|
||||
cmds::FramebufferPixelLocalClearValueuivANGLEImmediate cmd;
|
||||
GLuint data[4];
|
||||
@ -3191,7 +3175,7 @@ TEST_F(GLES2ImplementationTest, FramebufferPixelLocalClearValueuivANGLE) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, BeginPixelLocalStorageANGLE) {
|
||||
GLenum data[1][1] = {{0}};
|
||||
GLenum data[1][1] = {};
|
||||
struct Cmds {
|
||||
cmds::BeginPixelLocalStorageANGLEImmediate cmd;
|
||||
GLenum data[1][1];
|
||||
@ -3209,7 +3193,7 @@ TEST_F(GLES2ImplementationTest, BeginPixelLocalStorageANGLE) {
|
||||
}
|
||||
|
||||
TEST_F(GLES2ImplementationTest, EndPixelLocalStorageANGLE) {
|
||||
GLenum data[1][1] = {{0}};
|
||||
GLenum data[1][1] = {};
|
||||
struct Cmds {
|
||||
cmds::EndPixelLocalStorageANGLEImmediate cmd;
|
||||
GLenum data[1][1];
|
||||
|
@ -387,9 +387,7 @@ TEST_F(RasterImplementationTest, BeginEndQueryEXT) {
|
||||
};
|
||||
GenCmds expected_gen_cmds;
|
||||
expected_gen_cmds.gen.Init(std::size(expected_ids), &expected_ids[0]);
|
||||
GLuint ids[std::size(expected_ids)] = {
|
||||
0,
|
||||
};
|
||||
GLuint ids[std::size(expected_ids)] = {};
|
||||
gl_->GenQueriesEXT(std::size(expected_ids), &ids[0]);
|
||||
EXPECT_EQ(0,
|
||||
memcmp(&expected_gen_cmds, commands_, sizeof(expected_gen_cmds)));
|
||||
|
@ -30,9 +30,7 @@ TEST_F(RasterImplementationTest, Flush) {
|
||||
}
|
||||
|
||||
TEST_F(RasterImplementationTest, GenQueriesEXT) {
|
||||
GLuint ids[2] = {
|
||||
0,
|
||||
};
|
||||
GLuint ids[2] = {};
|
||||
struct Cmds {
|
||||
cmds::GenQueriesEXTImmediate gen;
|
||||
GLuint data[2];
|
||||
|
@ -3193,7 +3193,7 @@ gpu::ContextResult GLES2DecoderImpl::Initialize(
|
||||
has_fragment_precision_high_ =
|
||||
PrecisionMeetsSpecForHighpFloat(range[0], range[1], precision);
|
||||
|
||||
GLint viewport_params[4] = { 0 };
|
||||
GLint viewport_params[4] = {};
|
||||
api()->glGetIntegervFn(GL_MAX_VIEWPORT_DIMS, viewport_params);
|
||||
viewport_max_width_ = viewport_params[0];
|
||||
viewport_max_height_ = viewport_params[1];
|
||||
|
@ -1264,9 +1264,7 @@ TEST_P(GLES2DecoderTest2, Uniform1fValidArgs) {
|
||||
TEST_P(GLES2DecoderTest2, Uniform1fvImmediateValidArgs) {
|
||||
cmds::Uniform1fvImmediate& cmd = *GetImmediateAs<cmds::Uniform1fvImmediate>();
|
||||
SpecializedSetup<cmds::Uniform1fvImmediate, 0>(true);
|
||||
GLfloat temp[1 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLfloat temp[1 * 2] = {};
|
||||
EXPECT_CALL(*gl_, Uniform1fv(1, 2, PointsToArray(temp, 1)));
|
||||
cmd.Init(1, 2, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -1285,9 +1283,7 @@ TEST_P(GLES2DecoderTest2, Uniform2fValidArgs) {
|
||||
TEST_P(GLES2DecoderTest2, Uniform2fvImmediateValidArgs) {
|
||||
cmds::Uniform2fvImmediate& cmd = *GetImmediateAs<cmds::Uniform2fvImmediate>();
|
||||
SpecializedSetup<cmds::Uniform2fvImmediate, 0>(true);
|
||||
GLfloat temp[2 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLfloat temp[2 * 2] = {};
|
||||
EXPECT_CALL(*gl_, Uniform2fv(1, 2, PointsToArray(temp, 2)));
|
||||
cmd.Init(1, 2, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -1306,9 +1302,7 @@ TEST_P(GLES2DecoderTest2, Uniform2iValidArgs) {
|
||||
TEST_P(GLES2DecoderTest2, Uniform2ivImmediateValidArgs) {
|
||||
cmds::Uniform2ivImmediate& cmd = *GetImmediateAs<cmds::Uniform2ivImmediate>();
|
||||
SpecializedSetup<cmds::Uniform2ivImmediate, 0>(true);
|
||||
GLint temp[2 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLint temp[2 * 2] = {};
|
||||
EXPECT_CALL(*gl_, Uniform2iv(1, 2, PointsToArray(temp, 2)));
|
||||
cmd.Init(1, 2, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -1327,9 +1321,7 @@ TEST_P(GLES2DecoderTest2, Uniform3fValidArgs) {
|
||||
TEST_P(GLES2DecoderTest2, Uniform3fvImmediateValidArgs) {
|
||||
cmds::Uniform3fvImmediate& cmd = *GetImmediateAs<cmds::Uniform3fvImmediate>();
|
||||
SpecializedSetup<cmds::Uniform3fvImmediate, 0>(true);
|
||||
GLfloat temp[3 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLfloat temp[3 * 2] = {};
|
||||
EXPECT_CALL(*gl_, Uniform3fv(1, 2, PointsToArray(temp, 3)));
|
||||
cmd.Init(1, 2, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -1348,9 +1340,7 @@ TEST_P(GLES2DecoderTest2, Uniform3iValidArgs) {
|
||||
TEST_P(GLES2DecoderTest2, Uniform3ivImmediateValidArgs) {
|
||||
cmds::Uniform3ivImmediate& cmd = *GetImmediateAs<cmds::Uniform3ivImmediate>();
|
||||
SpecializedSetup<cmds::Uniform3ivImmediate, 0>(true);
|
||||
GLint temp[3 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLint temp[3 * 2] = {};
|
||||
EXPECT_CALL(*gl_, Uniform3iv(1, 2, PointsToArray(temp, 3)));
|
||||
cmd.Init(1, 2, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
|
@ -24,9 +24,7 @@ TEST_P(GLES2DecoderTest3, Uniform4fValidArgs) {
|
||||
TEST_P(GLES2DecoderTest3, Uniform4fvImmediateValidArgs) {
|
||||
cmds::Uniform4fvImmediate& cmd = *GetImmediateAs<cmds::Uniform4fvImmediate>();
|
||||
SpecializedSetup<cmds::Uniform4fvImmediate, 0>(true);
|
||||
GLfloat temp[4 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLfloat temp[4 * 2] = {};
|
||||
EXPECT_CALL(*gl_, Uniform4fv(1, 2, PointsToArray(temp, 4)));
|
||||
cmd.Init(1, 2, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -45,9 +43,7 @@ TEST_P(GLES2DecoderTest3, Uniform4iValidArgs) {
|
||||
TEST_P(GLES2DecoderTest3, Uniform4ivImmediateValidArgs) {
|
||||
cmds::Uniform4ivImmediate& cmd = *GetImmediateAs<cmds::Uniform4ivImmediate>();
|
||||
SpecializedSetup<cmds::Uniform4ivImmediate, 0>(true);
|
||||
GLint temp[4 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLint temp[4 * 2] = {};
|
||||
EXPECT_CALL(*gl_, Uniform4iv(1, 2, PointsToArray(temp, 4)));
|
||||
cmd.Init(1, 2, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -58,9 +54,7 @@ TEST_P(GLES3DecoderTest3, UniformMatrix2x3fvImmediateValidArgs) {
|
||||
cmds::UniformMatrix2x3fvImmediate& cmd =
|
||||
*GetImmediateAs<cmds::UniformMatrix2x3fvImmediate>();
|
||||
SpecializedSetup<cmds::UniformMatrix2x3fvImmediate, 0>(true);
|
||||
GLfloat temp[6 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLfloat temp[6 * 2] = {};
|
||||
EXPECT_CALL(*gl_, UniformMatrix2x3fv(1, 2, true, PointsToArray(temp, 6)));
|
||||
cmd.Init(1, 2, true, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -71,9 +65,7 @@ TEST_P(GLES3DecoderTest3, UniformMatrix2x4fvImmediateValidArgs) {
|
||||
cmds::UniformMatrix2x4fvImmediate& cmd =
|
||||
*GetImmediateAs<cmds::UniformMatrix2x4fvImmediate>();
|
||||
SpecializedSetup<cmds::UniformMatrix2x4fvImmediate, 0>(true);
|
||||
GLfloat temp[8 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLfloat temp[8 * 2] = {};
|
||||
EXPECT_CALL(*gl_, UniformMatrix2x4fv(1, 2, true, PointsToArray(temp, 8)));
|
||||
cmd.Init(1, 2, true, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -84,9 +76,7 @@ TEST_P(GLES3DecoderTest3, UniformMatrix3x2fvImmediateValidArgs) {
|
||||
cmds::UniformMatrix3x2fvImmediate& cmd =
|
||||
*GetImmediateAs<cmds::UniformMatrix3x2fvImmediate>();
|
||||
SpecializedSetup<cmds::UniformMatrix3x2fvImmediate, 0>(true);
|
||||
GLfloat temp[6 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLfloat temp[6 * 2] = {};
|
||||
EXPECT_CALL(*gl_, UniformMatrix3x2fv(1, 2, true, PointsToArray(temp, 6)));
|
||||
cmd.Init(1, 2, true, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -97,9 +87,7 @@ TEST_P(GLES3DecoderTest3, UniformMatrix3x4fvImmediateValidArgs) {
|
||||
cmds::UniformMatrix3x4fvImmediate& cmd =
|
||||
*GetImmediateAs<cmds::UniformMatrix3x4fvImmediate>();
|
||||
SpecializedSetup<cmds::UniformMatrix3x4fvImmediate, 0>(true);
|
||||
GLfloat temp[12 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLfloat temp[12 * 2] = {};
|
||||
EXPECT_CALL(*gl_, UniformMatrix3x4fv(1, 2, true, PointsToArray(temp, 12)));
|
||||
cmd.Init(1, 2, true, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -110,9 +98,7 @@ TEST_P(GLES3DecoderTest3, UniformMatrix4x2fvImmediateValidArgs) {
|
||||
cmds::UniformMatrix4x2fvImmediate& cmd =
|
||||
*GetImmediateAs<cmds::UniformMatrix4x2fvImmediate>();
|
||||
SpecializedSetup<cmds::UniformMatrix4x2fvImmediate, 0>(true);
|
||||
GLfloat temp[8 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLfloat temp[8 * 2] = {};
|
||||
EXPECT_CALL(*gl_, UniformMatrix4x2fv(1, 2, true, PointsToArray(temp, 8)));
|
||||
cmd.Init(1, 2, true, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
@ -123,9 +109,7 @@ TEST_P(GLES3DecoderTest3, UniformMatrix4x3fvImmediateValidArgs) {
|
||||
cmds::UniformMatrix4x3fvImmediate& cmd =
|
||||
*GetImmediateAs<cmds::UniformMatrix4x3fvImmediate>();
|
||||
SpecializedSetup<cmds::UniformMatrix4x3fvImmediate, 0>(true);
|
||||
GLfloat temp[12 * 2] = {
|
||||
0,
|
||||
};
|
||||
GLfloat temp[12 * 2] = {};
|
||||
EXPECT_CALL(*gl_, UniformMatrix4x3fv(1, 2, true, PointsToArray(temp, 12)));
|
||||
cmd.Init(1, 2, true, &temp[0]);
|
||||
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
|
||||
|
@ -1645,7 +1645,10 @@ TEST_P(GLCopyTextureCHROMIUMTest, UninitializedSource) {
|
||||
}
|
||||
EXPECT_TRUE(GL_NO_ERROR == glGetError());
|
||||
|
||||
uint8_t pixels[kHeight][kWidth][4] = {{{1}}};
|
||||
uint8_t pixels[kHeight][kWidth][4] = {};
|
||||
pixels[0][0][0] = 1; // Set a pixel to a non-zero value, to ensure the zeroes
|
||||
// are indeed written by `glReadPixels`.
|
||||
|
||||
glReadPixels(0, 0, kWidth, kHeight, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||
for (int x = 0; x < kWidth; ++x) {
|
||||
for (int y = 0; y < kHeight; ++y) {
|
||||
|
@ -186,9 +186,7 @@ TEST_F(DepthTextureTest, RenderTo) {
|
||||
continue;
|
||||
}
|
||||
|
||||
uint8_t actual_pixels[kResolution * kResolution * 4] = {
|
||||
0,
|
||||
};
|
||||
uint8_t actual_pixels[kResolution * kResolution * 4] = {};
|
||||
glReadPixels(
|
||||
0, 0, kResolution, kResolution, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
actual_pixels);
|
||||
|
@ -55,7 +55,7 @@ TEST_F(SetAggressivelyFreeResourcesTest, FreeAllMemory_TransferBuffer) {
|
||||
glGenTextures(1, &texture);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
|
||||
const char kPixels[4 * 4 * 4] = {0};
|
||||
const char kPixels[4 * 4 * 4] = {};
|
||||
// Allocates transfer buffer space for the pixels.
|
||||
size_t old_size = gl_.GetSharedMemoryBytesAllocated();
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
@ -71,7 +71,7 @@ TEST_F(SetAggressivelyFreeResourcesTest, FreeAllMemory_MappedMemory) {
|
||||
GLuint buffer = 0;
|
||||
glGenBuffers(1, &buffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, buffer);
|
||||
const char kData[256] = {0};
|
||||
const char kData[256] = {};
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(kData), kData, GL_STATIC_DRAW);
|
||||
|
||||
size_t old_size = gl_.GetSharedMemoryBytesAllocated();
|
||||
@ -114,7 +114,7 @@ TEST_F(SetAggressivelyFreeResourcesTest, FreeAllMemory) {
|
||||
glGenTextures(1, &texture);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
|
||||
const char kPixels[4 * 4 * 4] = {0};
|
||||
const char kPixels[4 * 4 * 4] = {};
|
||||
// Allocates transfer buffer space for the pixels.
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
kPixels);
|
||||
@ -122,7 +122,7 @@ TEST_F(SetAggressivelyFreeResourcesTest, FreeAllMemory) {
|
||||
GLuint buffer = 0;
|
||||
glGenBuffers(1, &buffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, buffer);
|
||||
const char kData[256] = {0};
|
||||
const char kData[256] = {};
|
||||
// Allocates transfer buffer space for kData.
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(kData), kData, GL_STATIC_DRAW);
|
||||
|
||||
|
@ -143,7 +143,7 @@ TEST_F(TextureStorageTest, OneLevel) {
|
||||
|
||||
glTexStorage2DEXT(GL_TEXTURE_2D, 1, GL_RGBA8_OES, 4, 4);
|
||||
|
||||
uint8_t source_pixels[64] = {0};
|
||||
uint8_t source_pixels[64] = {};
|
||||
|
||||
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 4, 4,
|
||||
@ -160,7 +160,7 @@ TEST_F(TextureStorageTest, MultipleLevels) {
|
||||
|
||||
glTexStorage2DEXT(GL_TEXTURE_2D, 2, GL_RGBA8_OES, 2, 2);
|
||||
|
||||
uint8_t source_pixels[16] = {0};
|
||||
uint8_t source_pixels[16] = {};
|
||||
|
||||
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 2, 2,
|
||||
|
@ -837,7 +837,7 @@ void GpuWatchdogThread::UpdateActiveTTY() {
|
||||
last_active_tty_ = active_tty_;
|
||||
|
||||
active_tty_ = -1;
|
||||
char tty_string[8] = {0};
|
||||
char tty_string[8] = {};
|
||||
if (tty_file_ && !fseek(tty_file_.get(), 0, SEEK_SET) &&
|
||||
fread(tty_string, 1, 7, tty_file_.get())) {
|
||||
int tty_number;
|
||||
|
@ -152,7 +152,7 @@ bool CompareBufferToRGBABuffer(GLenum format,
|
||||
for (int x = 0; x < size.width(); ++x) {
|
||||
int rgba_index = y * rgba_stride + x * GLFormatBytePerPixel(GL_RGBA);
|
||||
int pixels_index = y * pixels_stride + x * bytes_per_pixel;
|
||||
uint8_t expected[4] = {0};
|
||||
uint8_t expected[4] = {0, 0, 0, 0};
|
||||
switch (format) {
|
||||
case GL_LUMINANCE: // (L_t, L_t, L_t, 1)
|
||||
expected[1] = pixels[pixels_index];
|
||||
|
Reference in New Issue
Block a user