| OLD | NEW |
| 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 5220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5231 EXPECT_EQ(static_cast<uint32_t>(cmds::OverlayPromotionHintCHROMIUM::kCmdId), | 5231 EXPECT_EQ(static_cast<uint32_t>(cmds::OverlayPromotionHintCHROMIUM::kCmdId), |
| 5232 cmd.header.command); | 5232 cmd.header.command); |
| 5233 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); | 5233 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); |
| 5234 EXPECT_EQ(static_cast<GLuint>(11), cmd.texture); | 5234 EXPECT_EQ(static_cast<GLuint>(11), cmd.texture); |
| 5235 EXPECT_EQ(static_cast<GLboolean>(12), cmd.promotion_hint); | 5235 EXPECT_EQ(static_cast<GLboolean>(12), cmd.promotion_hint); |
| 5236 EXPECT_EQ(static_cast<GLint>(13), cmd.display_x); | 5236 EXPECT_EQ(static_cast<GLint>(13), cmd.display_x); |
| 5237 EXPECT_EQ(static_cast<GLint>(14), cmd.display_y); | 5237 EXPECT_EQ(static_cast<GLint>(14), cmd.display_y); |
| 5238 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); | 5238 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); |
| 5239 } | 5239 } |
| 5240 | 5240 |
| 5241 TEST_F(GLES2FormatTest, SwapBuffersWithDamageCHROMIUM) { | 5241 TEST_F(GLES2FormatTest, SwapBuffersWithBoundsCHROMIUMImmediate) { |
| 5242 cmds::SwapBuffersWithDamageCHROMIUM& cmd = | 5242 const int kSomeBaseValueToTestWith = 51; |
| 5243 *GetBufferAs<cmds::SwapBuffersWithDamageCHROMIUM>(); | 5243 static GLint data[] = { |
| 5244 void* next_cmd = cmd.Set(&cmd, static_cast<GLint>(11), static_cast<GLint>(12), | 5244 static_cast<GLint>(kSomeBaseValueToTestWith + 0), |
| 5245 static_cast<GLint>(13), static_cast<GLint>(14)); | 5245 static_cast<GLint>(kSomeBaseValueToTestWith + 1), |
| 5246 EXPECT_EQ(static_cast<uint32_t>(cmds::SwapBuffersWithDamageCHROMIUM::kCmdId), | 5246 static_cast<GLint>(kSomeBaseValueToTestWith + 2), |
| 5247 static_cast<GLint>(kSomeBaseValueToTestWith + 3), |
| 5248 }; |
| 5249 cmds::SwapBuffersWithBoundsCHROMIUMImmediate& cmd = |
| 5250 *GetBufferAs<cmds::SwapBuffersWithBoundsCHROMIUMImmediate>(); |
| 5251 const GLsizei kNumElements = 1; |
| 5252 const size_t kExpectedCmdSize = |
| 5253 sizeof(cmd) + kNumElements * sizeof(GLint) * 4; |
| 5254 void* next_cmd = cmd.Set(&cmd, static_cast<GLsizei>(1), data); |
| 5255 EXPECT_EQ(static_cast<uint32_t>( |
| 5256 cmds::SwapBuffersWithBoundsCHROMIUMImmediate::kCmdId), |
| 5247 cmd.header.command); | 5257 cmd.header.command); |
| 5248 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); | 5258 EXPECT_EQ(kExpectedCmdSize, cmd.header.size * 4u); |
| 5249 EXPECT_EQ(static_cast<GLint>(11), cmd.x); | 5259 EXPECT_EQ(static_cast<GLsizei>(1), cmd.count); |
| 5250 EXPECT_EQ(static_cast<GLint>(12), cmd.y); | 5260 CheckBytesWrittenMatchesExpectedSize( |
| 5251 EXPECT_EQ(static_cast<GLint>(13), cmd.width); | 5261 next_cmd, sizeof(cmd) + RoundSizeToMultipleOfEntries(sizeof(data))); |
| 5252 EXPECT_EQ(static_cast<GLint>(14), cmd.height); | |
| 5253 CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); | |
| 5254 } | 5262 } |
| 5255 | 5263 |
| 5256 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ | 5264 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_ |
| OLD | NEW |