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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 template <typename T> | 91 template <typename T> |
92 T GetSharedMemoryAsWithOffset(uint32 offset) { | 92 T GetSharedMemoryAsWithOffset(uint32 offset) { |
93 void* ptr = reinterpret_cast<int8*>(shared_memory_address_) + offset; | 93 void* ptr = reinterpret_cast<int8*>(shared_memory_address_) + offset; |
94 return reinterpret_cast<T>(ptr); | 94 return reinterpret_cast<T>(ptr); |
95 } | 95 } |
96 | 96 |
97 IdAllocatorInterface* GetIdAllocator(GLuint namespace_id) { | 97 IdAllocatorInterface* GetIdAllocator(GLuint namespace_id) { |
98 return group_->GetIdAllocator(namespace_id); | 98 return group_->GetIdAllocator(namespace_id); |
99 } | 99 } |
100 | 100 |
101 BufferManager::BufferInfo* GetBufferInfo(GLuint service_id) { | 101 BufferManager::Buffer* GetBuffer(GLuint service_id) { |
102 return group_->buffer_manager()->GetBufferInfo(service_id); | 102 return group_->buffer_manager()->GetBuffer(service_id); |
103 } | 103 } |
104 | 104 |
105 FramebufferManager::FramebufferInfo* GetFramebufferInfo(GLuint service_id) { | 105 Framebuffer* GetFramebuffer(GLuint service_id) { |
106 return group_->framebuffer_manager()->GetFramebufferInfo(service_id); | 106 return group_->framebuffer_manager()->GetFramebuffer(service_id); |
107 } | 107 } |
108 | 108 |
109 RenderbufferManager::RenderbufferInfo* GetRenderbufferInfo( | 109 Renderbuffer* GetRenderbuffer( |
110 GLuint service_id) { | 110 GLuint service_id) { |
111 return group_->renderbuffer_manager()->GetRenderbufferInfo(service_id); | 111 return group_->renderbuffer_manager()->GetRenderbuffer(service_id); |
112 } | 112 } |
113 | 113 |
114 TextureManager::TextureInfo* GetTextureInfo(GLuint client_id) { | 114 Texture* GetTexture(GLuint client_id) { |
115 return group_->texture_manager()->GetTextureInfo(client_id); | 115 return group_->texture_manager()->GetTexture(client_id); |
116 } | 116 } |
117 | 117 |
118 ShaderManager::ShaderInfo* GetShaderInfo(GLuint client_id) { | 118 Shader* GetShader(GLuint client_id) { |
119 return group_->shader_manager()->GetShaderInfo(client_id); | 119 return group_->shader_manager()->GetShader(client_id); |
120 } | 120 } |
121 | 121 |
122 ProgramManager::ProgramInfo* GetProgramInfo(GLuint client_id) { | 122 Program* GetProgram(GLuint client_id) { |
123 return group_->program_manager()->GetProgramInfo(client_id); | 123 return group_->program_manager()->GetProgram(client_id); |
124 } | 124 } |
125 | 125 |
126 QueryManager::Query* GetQueryInfo(GLuint client_id) { | 126 QueryManager::Query* GetQueryInfo(GLuint client_id) { |
127 return decoder_->GetQueryManager()->GetQuery(client_id); | 127 return decoder_->GetQueryManager()->GetQuery(client_id); |
128 } | 128 } |
129 | 129 |
130 // This name doesn't match the underlying function, but doing it this way | 130 // This name doesn't match the underlying function, but doing it this way |
131 // prevents the need to special-case the unit test generation | 131 // prevents the need to special-case the unit test generation |
132 VertexAttribManager* GetVertexArrayInfo(GLuint client_id) { | 132 VertexAttribManager* GetVertexArrayInfo(GLuint client_id) { |
133 return decoder_->GetVertexArrayManager()->GetVertexAttribManager(client_id); | 133 return decoder_->GetVertexArrayManager()->GetVertexAttribManager(client_id); |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 | 520 |
521 private: | 521 private: |
522 scoped_array<int8> data_; | 522 scoped_array<int8> data_; |
523 Buffer valid_buffer_; | 523 Buffer valid_buffer_; |
524 Buffer invalid_buffer_; | 524 Buffer invalid_buffer_; |
525 }; | 525 }; |
526 | 526 |
527 void AddExpectationsForVertexAttribManager(); | 527 void AddExpectationsForVertexAttribManager(); |
528 | 528 |
529 scoped_ptr< ::testing::StrictMock<MockCommandBufferEngine> > engine_; | 529 scoped_ptr< ::testing::StrictMock<MockCommandBufferEngine> > engine_; |
530 ContextGroup::Ref group_; | 530 scoped_refptr<ContextGroup> group_; |
531 }; | 531 }; |
532 | 532 |
533 class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase { | 533 class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase { |
534 public: | 534 public: |
535 GLES2DecoderWithShaderTestBase() | 535 GLES2DecoderWithShaderTestBase() |
536 : GLES2DecoderTestBase() { | 536 : GLES2DecoderTestBase() { |
537 } | 537 } |
538 | 538 |
539 protected: | 539 protected: |
540 virtual void SetUp() OVERRIDE; | 540 virtual void SetUp() OVERRIDE; |
541 virtual void TearDown() OVERRIDE; | 541 virtual void TearDown() OVERRIDE; |
542 | 542 |
543 }; | 543 }; |
544 | 544 |
545 } // namespace gles2 | 545 } // namespace gles2 |
546 } // namespace gpu | 546 } // namespace gpu |
547 | 547 |
548 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 548 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
OLD | NEW |