| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
| 7 | 7 |
| 8 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 10 #include "gpu/command_buffer/service/buffer_manager.h" | 10 #include "gpu/command_buffer/service/buffer_manager.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 void ClearSharedMemory() { | 69 void ClearSharedMemory() { |
| 70 engine_->ClearSharedMemory(); | 70 engine_->ClearSharedMemory(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void SetUp() override; | 73 void SetUp() override; |
| 74 void TearDown() override; | 74 void TearDown() override; |
| 75 | 75 |
| 76 template <typename T> | 76 template <typename T> |
| 77 error::Error ExecuteCmd(const T& cmd) { | 77 error::Error ExecuteCmd(const T& cmd) { |
| 78 COMPILE_ASSERT(T::kArgFlags == cmd::kFixed, Cmd_kArgFlags_not_kFixed); | 78 static_assert(T::kArgFlags == cmd::kFixed, |
| 79 "T::kArgFlags should equal cmd::kFixed"); |
| 79 return decoder_->DoCommands( | 80 return decoder_->DoCommands( |
| 80 1, (const void*)&cmd, ComputeNumEntries(sizeof(cmd)), 0); | 81 1, (const void*)&cmd, ComputeNumEntries(sizeof(cmd)), 0); |
| 81 } | 82 } |
| 82 | 83 |
| 83 template <typename T> | 84 template <typename T> |
| 84 error::Error ExecuteImmediateCmd(const T& cmd, size_t data_size) { | 85 error::Error ExecuteImmediateCmd(const T& cmd, size_t data_size) { |
| 85 COMPILE_ASSERT(T::kArgFlags == cmd::kAtLeastN, Cmd_kArgFlags_not_kAtLeastN); | 86 static_assert(T::kArgFlags == cmd::kAtLeastN, |
| 87 "T::kArgFlags should equal cmd::kAtLeastN"); |
| 86 return decoder_->DoCommands( | 88 return decoder_->DoCommands( |
| 87 1, (const void*)&cmd, ComputeNumEntries(sizeof(cmd) + data_size), 0); | 89 1, (const void*)&cmd, ComputeNumEntries(sizeof(cmd) + data_size), 0); |
| 88 } | 90 } |
| 89 | 91 |
| 90 template <typename T> | 92 template <typename T> |
| 91 T GetSharedMemoryAs() { | 93 T GetSharedMemoryAs() { |
| 92 return reinterpret_cast<T>(shared_memory_address_); | 94 return reinterpret_cast<T>(shared_memory_address_); |
| 93 } | 95 } |
| 94 | 96 |
| 95 template <typename T> | 97 template <typename T> |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 }; | 661 }; |
| 660 | 662 |
| 661 // SpecializedSetup specializations that are needed in multiple unittest files. | 663 // SpecializedSetup specializations that are needed in multiple unittest files. |
| 662 template <> | 664 template <> |
| 663 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); | 665 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); |
| 664 | 666 |
| 665 } // namespace gles2 | 667 } // namespace gles2 |
| 666 } // namespace gpu | 668 } // namespace gpu |
| 667 | 669 |
| 668 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 670 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
| OLD | NEW |