OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/gfx/gl/gl_context.h" | 8 #include "app/gfx/gl/gl_context.h" |
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 T GetSharedMemoryAs() { | 118 T GetSharedMemoryAs() { |
119 return reinterpret_cast<T>(shared_memory_address_); | 119 return reinterpret_cast<T>(shared_memory_address_); |
120 } | 120 } |
121 | 121 |
122 template <typename T> | 122 template <typename T> |
123 T GetSharedMemoryAsWithOffset(uint32 offset) { | 123 T GetSharedMemoryAsWithOffset(uint32 offset) { |
124 void* ptr = reinterpret_cast<int8*>(shared_memory_address_) + offset; | 124 void* ptr = reinterpret_cast<int8*>(shared_memory_address_) + offset; |
125 return reinterpret_cast<T>(ptr); | 125 return reinterpret_cast<T>(ptr); |
126 } | 126 } |
127 | 127 |
128 uint32 GetServiceId(uint32 client_id) { | |
129 return decoder_->GetServiceIdForTesting(client_id); | |
130 } | |
131 | |
132 BufferManager::BufferInfo* GetBufferInfo(GLuint service_id) { | 128 BufferManager::BufferInfo* GetBufferInfo(GLuint service_id) { |
133 return group_.buffer_manager()->GetBufferInfo(service_id); | 129 return group_.buffer_manager()->GetBufferInfo(service_id); |
134 } | 130 } |
135 | 131 |
136 FramebufferManager::FramebufferInfo* GetFramebufferInfo(GLuint service_id) { | 132 FramebufferManager::FramebufferInfo* GetFramebufferInfo(GLuint service_id) { |
137 return group_.framebuffer_manager()->GetFramebufferInfo(service_id); | 133 return group_.framebuffer_manager()->GetFramebufferInfo(service_id); |
138 } | 134 } |
139 | 135 |
140 RenderbufferManager::RenderbufferInfo* GetRenderbufferInfo( | 136 RenderbufferManager::RenderbufferInfo* GetRenderbufferInfo( |
141 GLuint service_id) { | 137 GLuint service_id) { |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 void DeleteVertexBuffer(); | 332 void DeleteVertexBuffer(); |
337 | 333 |
338 void DeleteIndexBuffer(); | 334 void DeleteIndexBuffer(); |
339 }; | 335 }; |
340 | 336 |
341 } // namespace gles2 | 337 } // namespace gles2 |
342 } // namespace gpu | 338 } // namespace gpu |
343 | 339 |
344 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 340 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
345 | 341 |
OLD | NEW |