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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation_unittest_autogen.h

Issue 1165553003: Fine tuning glGetInternalformativ. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 auto-generated from 5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py 6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style: 7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename 8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT! 9 // DO NOT EDIT!
10 10
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 ExpectedMemoryInfo result1 = 902 ExpectedMemoryInfo result1 =
903 GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType)); 903 GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
904 expected.cmd.Init(123, result1.id, result1.offset); 904 expected.cmd.Init(123, result1.id, result1.offset);
905 EXPECT_CALL(*command_buffer(), OnFlush()) 905 EXPECT_CALL(*command_buffer(), OnFlush())
906 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1))) 906 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
907 .RetiresOnSaturation(); 907 .RetiresOnSaturation();
908 gl_->GetIntegerv(123, &result); 908 gl_->GetIntegerv(123, &result);
909 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 909 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
910 EXPECT_EQ(static_cast<ResultType>(1), result); 910 EXPECT_EQ(static_cast<ResultType>(1), result);
911 } 911 }
912 912 // TODO(zmo): Implement unit test for GetInternalformativ
913 TEST_F(GLES2ImplementationTest, GetInternalformativ) {
914 struct Cmds {
915 cmds::GetInternalformativ cmd;
916 };
917 typedef cmds::GetInternalformativ::Result::Type ResultType;
918 ResultType result = 0;
919 Cmds expected;
920 ExpectedMemoryInfo result1 =
921 GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
922 expected.cmd.Init(123, GL_RGBA4, GL_NUM_SAMPLE_COUNTS, 4, result1.id,
923 result1.offset);
924 EXPECT_CALL(*command_buffer(), OnFlush())
925 .WillOnce(SetMemory(result1.ptr, SizedResultHelper<ResultType>(1)))
926 .RetiresOnSaturation();
927 gl_->GetInternalformativ(123, GL_RGBA4, GL_NUM_SAMPLE_COUNTS, 4, &result);
928 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
929 EXPECT_EQ(static_cast<ResultType>(1), result);
930 }
931 913
932 TEST_F(GLES2ImplementationTest, GetProgramiv) { 914 TEST_F(GLES2ImplementationTest, GetProgramiv) {
933 struct Cmds { 915 struct Cmds {
934 cmds::GetProgramiv cmd; 916 cmds::GetProgramiv cmd;
935 }; 917 };
936 typedef cmds::GetProgramiv::Result::Type ResultType; 918 typedef cmds::GetProgramiv::Result::Type ResultType;
937 ResultType result = 0; 919 ResultType result = 0;
938 Cmds expected; 920 Cmds expected;
939 ExpectedMemoryInfo result1 = 921 ExpectedMemoryInfo result1 =
940 GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType)); 922 GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType));
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after
3119 struct Cmds { 3101 struct Cmds {
3120 cmds::MatrixLoadIdentityCHROMIUM cmd; 3102 cmds::MatrixLoadIdentityCHROMIUM cmd;
3121 }; 3103 };
3122 Cmds expected; 3104 Cmds expected;
3123 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM); 3105 expected.cmd.Init(GL_PATH_PROJECTION_CHROMIUM);
3124 3106
3125 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); 3107 gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM);
3126 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 3108 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
3127 } 3109 }
3128 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_ 3110 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | gpu/command_buffer/common/gles2_cmd_format_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698