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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 template <typename T, typename Command> | 63 template <typename T, typename Command> |
64 T GetImmediateDataAs(Command* cmd) { | 64 T GetImmediateDataAs(Command* cmd) { |
65 return reinterpret_cast<T>(ImmediateDataAddress(cmd)); | 65 return reinterpret_cast<T>(ImmediateDataAddress(cmd)); |
66 } | 66 } |
67 | 67 |
68 void ClearSharedMemory() { | 68 void ClearSharedMemory() { |
69 engine_->ClearSharedMemory(); | 69 engine_->ClearSharedMemory(); |
70 } | 70 } |
71 | 71 |
72 virtual void SetUp() override; | 72 void SetUp() override; |
73 virtual void TearDown() override; | 73 void TearDown() override; |
74 | 74 |
75 template <typename T> | 75 template <typename T> |
76 error::Error ExecuteCmd(const T& cmd) { | 76 error::Error ExecuteCmd(const T& cmd) { |
77 COMPILE_ASSERT(T::kArgFlags == cmd::kFixed, Cmd_kArgFlags_not_kFixed); | 77 COMPILE_ASSERT(T::kArgFlags == cmd::kFixed, Cmd_kArgFlags_not_kFixed); |
78 return decoder_->DoCommands( | 78 return decoder_->DoCommands( |
79 1, (const void*)&cmd, ComputeNumEntries(sizeof(cmd)), 0); | 79 1, (const void*)&cmd, ComputeNumEntries(sizeof(cmd)), 0); |
80 } | 80 } |
81 | 81 |
82 template <typename T> | 82 template <typename T> |
83 error::Error ExecuteImmediateCmd(const T& cmd, size_t data_size) { | 83 error::Error ExecuteImmediateCmd(const T& cmd, size_t data_size) { |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 MockGLStates gl_states_; | 620 MockGLStates gl_states_; |
621 }; | 621 }; |
622 | 622 |
623 class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase { | 623 class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase { |
624 public: | 624 public: |
625 GLES2DecoderWithShaderTestBase() | 625 GLES2DecoderWithShaderTestBase() |
626 : GLES2DecoderTestBase() { | 626 : GLES2DecoderTestBase() { |
627 } | 627 } |
628 | 628 |
629 protected: | 629 protected: |
630 virtual void SetUp() override; | 630 void SetUp() override; |
631 virtual void TearDown() override; | 631 void TearDown() override; |
632 | |
633 }; | 632 }; |
634 | 633 |
635 // SpecializedSetup specializations that are needed in multiple unittest files. | 634 // SpecializedSetup specializations that are needed in multiple unittest files. |
636 template <> | 635 template <> |
637 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); | 636 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); |
638 | 637 |
639 } // namespace gles2 | 638 } // namespace gles2 |
640 } // namespace gpu | 639 } // namespace gpu |
641 | 640 |
642 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 641 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
OLD | NEW |