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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 bool cached_stencil_test; | 547 bool cached_stencil_test; |
548 }; | 548 }; |
549 | 549 |
550 EnableFlags enable_flags_; | 550 EnableFlags enable_flags_; |
551 | 551 |
552 private: | 552 private: |
553 class MockCommandBufferEngine : public CommandBufferEngine { | 553 class MockCommandBufferEngine : public CommandBufferEngine { |
554 public: | 554 public: |
555 MockCommandBufferEngine(); | 555 MockCommandBufferEngine(); |
556 | 556 |
557 virtual ~MockCommandBufferEngine(); | 557 ~MockCommandBufferEngine() override; |
558 | 558 |
559 virtual scoped_refptr<gpu::Buffer> GetSharedMemoryBuffer(int32 shm_id) | 559 scoped_refptr<gpu::Buffer> GetSharedMemoryBuffer(int32 shm_id) override; |
560 override; | |
561 | 560 |
562 void ClearSharedMemory() { | 561 void ClearSharedMemory() { |
563 memset(valid_buffer_->memory(), kInitialMemoryValue, kSharedBufferSize); | 562 memset(valid_buffer_->memory(), kInitialMemoryValue, kSharedBufferSize); |
564 } | 563 } |
565 | 564 |
566 virtual void set_token(int32 token) override; | 565 void set_token(int32 token) override; |
567 | 566 |
568 virtual bool SetGetBuffer(int32 /* transfer_buffer_id */) override; | 567 bool SetGetBuffer(int32 /* transfer_buffer_id */) override; |
569 | 568 |
570 // Overridden from CommandBufferEngine. | 569 // Overridden from CommandBufferEngine. |
571 virtual bool SetGetOffset(int32 offset) override; | 570 bool SetGetOffset(int32 offset) override; |
572 | 571 |
573 // Overridden from CommandBufferEngine. | 572 // Overridden from CommandBufferEngine. |
574 virtual int32 GetGetOffset() override; | 573 int32 GetGetOffset() override; |
575 | 574 |
576 private: | 575 private: |
577 scoped_refptr<gpu::Buffer> valid_buffer_; | 576 scoped_refptr<gpu::Buffer> valid_buffer_; |
578 scoped_refptr<gpu::Buffer> invalid_buffer_; | 577 scoped_refptr<gpu::Buffer> invalid_buffer_; |
579 }; | 578 }; |
580 | 579 |
581 // MockGLStates is used to track GL states and emulate driver | 580 // MockGLStates is used to track GL states and emulate driver |
582 // behaviors on top of MockGLInterface. | 581 // behaviors on top of MockGLInterface. |
583 class MockGLStates { | 582 class MockGLStates { |
584 public: | 583 public: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 }; | 633 }; |
635 | 634 |
636 // SpecializedSetup specializations that are needed in multiple unittest files. | 635 // SpecializedSetup specializations that are needed in multiple unittest files. |
637 template <> | 636 template <> |
638 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); | 637 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); |
639 | 638 |
640 } // namespace gles2 | 639 } // namespace gles2 |
641 } // namespace gpu | 640 } // namespace gpu |
642 | 641 |
643 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 642 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
OLD | NEW |