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 <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
8 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 12 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 13 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
11 #include "gpu/command_buffer/service/buffer_manager.h" | 14 #include "gpu/command_buffer/service/buffer_manager.h" |
12 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 15 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
13 #include "gpu/command_buffer/service/context_group.h" | 16 #include "gpu/command_buffer/service/context_group.h" |
14 #include "gpu/command_buffer/service/framebuffer_manager.h" | 17 #include "gpu/command_buffer/service/framebuffer_manager.h" |
15 #include "gpu/command_buffer/service/gl_context_mock.h" | 18 #include "gpu/command_buffer/service/gl_context_mock.h" |
16 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 19 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
17 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" | 20 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" |
18 #include "gpu/command_buffer/service/program_manager.h" | 21 #include "gpu/command_buffer/service/program_manager.h" |
19 #include "gpu/command_buffer/service/query_manager.h" | 22 #include "gpu/command_buffer/service/query_manager.h" |
20 #include "gpu/command_buffer/service/renderbuffer_manager.h" | 23 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
21 #include "gpu/command_buffer/service/sampler_manager.h" | 24 #include "gpu/command_buffer/service/sampler_manager.h" |
22 #include "gpu/command_buffer/service/shader_manager.h" | 25 #include "gpu/command_buffer/service/shader_manager.h" |
23 #include "gpu/command_buffer/service/test_helper.h" | 26 #include "gpu/command_buffer/service/test_helper.h" |
24 #include "gpu/command_buffer/service/texture_manager.h" | 27 #include "gpu/command_buffer/service/texture_manager.h" |
25 #include "gpu/command_buffer/service/valuebuffer_manager.h" | 28 #include "gpu/command_buffer/service/valuebuffer_manager.h" |
26 #include "gpu/command_buffer/service/vertex_array_manager.h" | 29 #include "gpu/command_buffer/service/vertex_array_manager.h" |
27 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
| 31 #include "ui/gl/gl_mock.h" |
28 #include "ui/gl/gl_surface_stub.h" | 32 #include "ui/gl/gl_surface_stub.h" |
29 #include "ui/gl/gl_mock.h" | |
30 #include "ui/gl/gl_version_info.h" | 33 #include "ui/gl/gl_version_info.h" |
31 | 34 |
32 namespace base { | 35 namespace base { |
33 class CommandLine; | 36 class CommandLine; |
34 } | 37 } |
35 | 38 |
36 namespace gpu { | 39 namespace gpu { |
37 namespace gles2 { | 40 namespace gles2 { |
38 | 41 |
39 class MemoryTracker; | 42 class MemoryTracker; |
40 | 43 |
41 class GLES2DecoderTestBase : public ::testing::TestWithParam<bool> { | 44 class GLES2DecoderTestBase : public ::testing::TestWithParam<bool> { |
42 public: | 45 public: |
43 GLES2DecoderTestBase(); | 46 GLES2DecoderTestBase(); |
44 virtual ~GLES2DecoderTestBase(); | 47 virtual ~GLES2DecoderTestBase(); |
45 | 48 |
46 // Template to call glGenXXX functions. | 49 // Template to call glGenXXX functions. |
47 template <typename T> | 50 template <typename T> |
48 void GenHelper(GLuint client_id) { | 51 void GenHelper(GLuint client_id) { |
49 int8 buffer[sizeof(T) + sizeof(client_id)]; | 52 int8_t buffer[sizeof(T) + sizeof(client_id)]; |
50 T& cmd = *reinterpret_cast<T*>(&buffer); | 53 T& cmd = *reinterpret_cast<T*>(&buffer); |
51 cmd.Init(1, &client_id); | 54 cmd.Init(1, &client_id); |
52 EXPECT_EQ(error::kNoError, | 55 EXPECT_EQ(error::kNoError, |
53 ExecuteImmediateCmd(cmd, sizeof(client_id))); | 56 ExecuteImmediateCmd(cmd, sizeof(client_id))); |
54 } | 57 } |
55 | 58 |
56 // This template exists solely so we can specialize it for | 59 // This template exists solely so we can specialize it for |
57 // certain commands. | 60 // certain commands. |
58 template <typename T, int id> | 61 template <typename T, int id> |
59 void SpecializedSetup(bool valid) { | 62 void SpecializedSetup(bool valid) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return decoder_->DoCommands( | 94 return decoder_->DoCommands( |
92 1, (const void*)&cmd, ComputeNumEntries(sizeof(cmd) + data_size), 0); | 95 1, (const void*)&cmd, ComputeNumEntries(sizeof(cmd) + data_size), 0); |
93 } | 96 } |
94 | 97 |
95 template <typename T> | 98 template <typename T> |
96 T GetSharedMemoryAs() { | 99 T GetSharedMemoryAs() { |
97 return reinterpret_cast<T>(shared_memory_address_); | 100 return reinterpret_cast<T>(shared_memory_address_); |
98 } | 101 } |
99 | 102 |
100 template <typename T> | 103 template <typename T> |
101 T GetSharedMemoryAsWithOffset(uint32 offset) { | 104 T GetSharedMemoryAsWithOffset(uint32_t offset) { |
102 void* ptr = reinterpret_cast<int8*>(shared_memory_address_) + offset; | 105 void* ptr = reinterpret_cast<int8_t*>(shared_memory_address_) + offset; |
103 return reinterpret_cast<T>(ptr); | 106 return reinterpret_cast<T>(ptr); |
104 } | 107 } |
105 | 108 |
106 Buffer* GetBuffer(GLuint service_id) { | 109 Buffer* GetBuffer(GLuint service_id) { |
107 return group_->buffer_manager()->GetBuffer(service_id); | 110 return group_->buffer_manager()->GetBuffer(service_id); |
108 } | 111 } |
109 | 112 |
110 Framebuffer* GetFramebuffer(GLuint service_id) { | 113 Framebuffer* GetFramebuffer(GLuint service_id) { |
111 return group_->framebuffer_manager()->GetFramebuffer(service_id); | 114 return group_->framebuffer_manager()->GetFramebuffer(service_id); |
112 } | 115 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return group_->feature_info(); | 174 return group_->feature_info(); |
172 } | 175 } |
173 | 176 |
174 ImageManager* GetImageManager() { return decoder_->GetImageManager(); } | 177 ImageManager* GetImageManager() { return decoder_->GetImageManager(); } |
175 | 178 |
176 void DoCreateProgram(GLuint client_id, GLuint service_id); | 179 void DoCreateProgram(GLuint client_id, GLuint service_id); |
177 void DoCreateShader(GLenum shader_type, GLuint client_id, GLuint service_id); | 180 void DoCreateShader(GLenum shader_type, GLuint client_id, GLuint service_id); |
178 void DoFenceSync(GLuint client_id, GLuint service_id); | 181 void DoFenceSync(GLuint client_id, GLuint service_id); |
179 | 182 |
180 void SetBucketData(uint32_t bucket_id, const void* data, uint32_t data_size); | 183 void SetBucketData(uint32_t bucket_id, const void* data, uint32_t data_size); |
181 void SetBucketAsCString(uint32 bucket_id, const char* str); | 184 void SetBucketAsCString(uint32_t bucket_id, const char* str); |
182 // If we want a valid bucket, just set |count_in_header| as |count|, | 185 // If we want a valid bucket, just set |count_in_header| as |count|, |
183 // and set |str_end| as 0. | 186 // and set |str_end| as 0. |
184 void SetBucketAsCStrings(uint32 bucket_id, GLsizei count, const char** str, | 187 void SetBucketAsCStrings(uint32_t bucket_id, |
185 GLsizei count_in_header, char str_end); | 188 GLsizei count, |
| 189 const char** str, |
| 190 GLsizei count_in_header, |
| 191 char str_end); |
186 | 192 |
187 void set_memory_tracker(MemoryTracker* memory_tracker) { | 193 void set_memory_tracker(MemoryTracker* memory_tracker) { |
188 memory_tracker_ = memory_tracker; | 194 memory_tracker_ = memory_tracker; |
189 } | 195 } |
190 | 196 |
191 struct InitState { | 197 struct InitState { |
192 InitState(); | 198 InitState(); |
193 | 199 |
194 std::string extensions; | 200 std::string extensions; |
195 std::string gl_version; | 201 std::string gl_version; |
(...skipping 24 matching lines...) Expand all Loading... |
220 } | 226 } |
221 | 227 |
222 ::testing::StrictMock< ::gfx::MockGLInterface>* GetGLMock() const { | 228 ::testing::StrictMock< ::gfx::MockGLInterface>* GetGLMock() const { |
223 return gl_.get(); | 229 return gl_.get(); |
224 } | 230 } |
225 | 231 |
226 GLES2Decoder* GetDecoder() const { | 232 GLES2Decoder* GetDecoder() const { |
227 return decoder_.get(); | 233 return decoder_.get(); |
228 } | 234 } |
229 | 235 |
230 uint32 GetAndClearBackbufferClearBitsForTest() const { | 236 uint32_t GetAndClearBackbufferClearBitsForTest() const { |
231 return decoder_->GetAndClearBackbufferClearBitsForTest(); | 237 return decoder_->GetAndClearBackbufferClearBitsForTest(); |
232 } | 238 } |
233 | 239 |
234 typedef TestHelper::AttribInfo AttribInfo; | 240 typedef TestHelper::AttribInfo AttribInfo; |
235 typedef TestHelper::UniformInfo UniformInfo; | 241 typedef TestHelper::UniformInfo UniformInfo; |
236 | 242 |
237 void SetupShader( | 243 void SetupShader( |
238 AttribInfo* attribs, size_t num_attribs, | 244 AttribInfo* attribs, size_t num_attribs, |
239 UniformInfo* uniforms, size_t num_uniforms, | 245 UniformInfo* uniforms, size_t num_uniforms, |
240 GLuint client_id, GLuint service_id, | 246 GLuint client_id, GLuint service_id, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 void DoDeleteBuffer(GLuint client_id, GLuint service_id); | 290 void DoDeleteBuffer(GLuint client_id, GLuint service_id); |
285 void DoDeleteFramebuffer( | 291 void DoDeleteFramebuffer( |
286 GLuint client_id, GLuint service_id, | 292 GLuint client_id, GLuint service_id, |
287 bool reset_draw, GLenum draw_target, GLuint draw_id, | 293 bool reset_draw, GLenum draw_target, GLuint draw_id, |
288 bool reset_read, GLenum read_target, GLuint read_id); | 294 bool reset_read, GLenum read_target, GLuint read_id); |
289 void DoDeleteProgram(GLuint client_id, GLuint service_id); | 295 void DoDeleteProgram(GLuint client_id, GLuint service_id); |
290 void DoDeleteRenderbuffer(GLuint client_id, GLuint service_id); | 296 void DoDeleteRenderbuffer(GLuint client_id, GLuint service_id); |
291 void DoDeleteShader(GLuint client_id, GLuint service_id); | 297 void DoDeleteShader(GLuint client_id, GLuint service_id); |
292 void DoDeleteTexture(GLuint client_id, GLuint service_id); | 298 void DoDeleteTexture(GLuint client_id, GLuint service_id); |
293 | 299 |
294 void DoCompressedTexImage2D( | 300 void DoCompressedTexImage2D(GLenum target, |
295 GLenum target, GLint level, GLenum format, | 301 GLint level, |
296 GLsizei width, GLsizei height, GLint border, | 302 GLenum format, |
297 GLsizei size, uint32 bucket_id); | 303 GLsizei width, |
| 304 GLsizei height, |
| 305 GLint border, |
| 306 GLsizei size, |
| 307 uint32_t bucket_id); |
298 void DoBindTexImage2DCHROMIUM(GLenum target, GLint image_id); | 308 void DoBindTexImage2DCHROMIUM(GLenum target, GLint image_id); |
299 void DoTexImage2D( | 309 void DoTexImage2D(GLenum target, |
300 GLenum target, GLint level, GLenum internal_format, | 310 GLint level, |
301 GLsizei width, GLsizei height, GLint border, | 311 GLenum internal_format, |
302 GLenum format, GLenum type, | 312 GLsizei width, |
303 uint32 shared_memory_id, uint32 shared_memory_offset); | 313 GLsizei height, |
304 void DoTexImage2DConvertInternalFormat( | 314 GLint border, |
305 GLenum target, GLint level, GLenum requested_internal_format, | 315 GLenum format, |
306 GLsizei width, GLsizei height, GLint border, | 316 GLenum type, |
307 GLenum format, GLenum type, | 317 uint32_t shared_memory_id, |
308 uint32 shared_memory_id, uint32 shared_memory_offset, | 318 uint32_t shared_memory_offset); |
309 GLenum expected_internal_format); | 319 void DoTexImage2DConvertInternalFormat(GLenum target, |
| 320 GLint level, |
| 321 GLenum requested_internal_format, |
| 322 GLsizei width, |
| 323 GLsizei height, |
| 324 GLint border, |
| 325 GLenum format, |
| 326 GLenum type, |
| 327 uint32_t shared_memory_id, |
| 328 uint32_t shared_memory_offset, |
| 329 GLenum expected_internal_format); |
310 void DoRenderbufferStorage( | 330 void DoRenderbufferStorage( |
311 GLenum target, GLenum internal_format, GLenum actual_format, | 331 GLenum target, GLenum internal_format, GLenum actual_format, |
312 GLsizei width, GLsizei height, GLenum error); | 332 GLsizei width, GLsizei height, GLenum error); |
313 void DoFramebufferRenderbuffer( | 333 void DoFramebufferRenderbuffer( |
314 GLenum target, | 334 GLenum target, |
315 GLenum attachment, | 335 GLenum attachment, |
316 GLenum renderbuffer_target, | 336 GLenum renderbuffer_target, |
317 GLuint renderbuffer_client_id, | 337 GLuint renderbuffer_client_id, |
318 GLuint renderbuffer_service_id, | 338 GLuint renderbuffer_service_id, |
319 GLenum error); | 339 GLenum error); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 447 |
428 void AddExpectationsForSimulatedAttrib0( | 448 void AddExpectationsForSimulatedAttrib0( |
429 GLsizei num_vertices, GLuint buffer_id); | 449 GLsizei num_vertices, GLuint buffer_id); |
430 | 450 |
431 void AddExpectationsForGenVertexArraysOES(); | 451 void AddExpectationsForGenVertexArraysOES(); |
432 void AddExpectationsForDeleteVertexArraysOES(); | 452 void AddExpectationsForDeleteVertexArraysOES(); |
433 void AddExpectationsForDeleteBoundVertexArraysOES(); | 453 void AddExpectationsForDeleteBoundVertexArraysOES(); |
434 void AddExpectationsForBindVertexArrayOES(); | 454 void AddExpectationsForBindVertexArrayOES(); |
435 void AddExpectationsForRestoreAttribState(GLuint attrib); | 455 void AddExpectationsForRestoreAttribState(GLuint attrib); |
436 | 456 |
437 GLvoid* BufferOffset(unsigned i) { | 457 GLvoid* BufferOffset(unsigned i) { return static_cast<int8_t*>(NULL) + (i); } |
438 return static_cast<int8 *>(NULL)+(i); | |
439 } | |
440 | 458 |
441 template <typename Command, typename Result> | 459 template <typename Command, typename Result> |
442 bool IsObjectHelper(GLuint client_id) { | 460 bool IsObjectHelper(GLuint client_id) { |
443 Result* result = static_cast<Result*>(shared_memory_address_); | 461 Result* result = static_cast<Result*>(shared_memory_address_); |
444 Command cmd; | 462 Command cmd; |
445 cmd.Init(client_id, kSharedMemoryId, kSharedMemoryOffset); | 463 cmd.Init(client_id, kSharedMemoryId, kSharedMemoryOffset); |
446 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 464 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
447 bool isObject = static_cast<bool>(*result); | 465 bool isObject = static_cast<bool>(*result); |
448 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 466 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
449 return isObject; | 467 return isObject; |
(...skipping 29 matching lines...) Expand all Loading... |
479 static const GLuint kServiceTextureId = 304; | 497 static const GLuint kServiceTextureId = 304; |
480 static const GLuint kServiceProgramId = 305; | 498 static const GLuint kServiceProgramId = 305; |
481 static const GLuint kServiceSamplerId = 306; | 499 static const GLuint kServiceSamplerId = 306; |
482 static const GLuint kServiceShaderId = 307; | 500 static const GLuint kServiceShaderId = 307; |
483 static const GLuint kServiceElementBufferId = 308; | 501 static const GLuint kServiceElementBufferId = 308; |
484 static const GLuint kServiceQueryId = 309; | 502 static const GLuint kServiceQueryId = 309; |
485 static const GLuint kServiceVertexArrayId = 310; | 503 static const GLuint kServiceVertexArrayId = 310; |
486 static const GLuint kServiceTransformFeedbackId = 311; | 504 static const GLuint kServiceTransformFeedbackId = 311; |
487 static const GLuint kServiceSyncId = 312; | 505 static const GLuint kServiceSyncId = 312; |
488 | 506 |
489 static const int32 kSharedMemoryId = 401; | 507 static const int32_t kSharedMemoryId = 401; |
490 static const size_t kSharedBufferSize = 2048; | 508 static const size_t kSharedBufferSize = 2048; |
491 static const uint32 kSharedMemoryOffset = 132; | 509 static const uint32_t kSharedMemoryOffset = 132; |
492 static const int32 kInvalidSharedMemoryId = 402; | 510 static const int32_t kInvalidSharedMemoryId = 402; |
493 static const uint32 kInvalidSharedMemoryOffset = kSharedBufferSize + 1; | 511 static const uint32_t kInvalidSharedMemoryOffset = kSharedBufferSize + 1; |
494 static const uint32 kInitialResult = 0xBDBDBDBDu; | 512 static const uint32_t kInitialResult = 0xBDBDBDBDu; |
495 static const uint8 kInitialMemoryValue = 0xBDu; | 513 static const uint8_t kInitialMemoryValue = 0xBDu; |
496 | 514 |
497 static const uint32 kNewClientId = 501; | 515 static const uint32_t kNewClientId = 501; |
498 static const uint32 kNewServiceId = 502; | 516 static const uint32_t kNewServiceId = 502; |
499 static const uint32 kInvalidClientId = 601; | 517 static const uint32_t kInvalidClientId = 601; |
500 | 518 |
501 static const GLuint kServiceVertexShaderId = 321; | 519 static const GLuint kServiceVertexShaderId = 321; |
502 static const GLuint kServiceFragmentShaderId = 322; | 520 static const GLuint kServiceFragmentShaderId = 322; |
503 | 521 |
504 static const GLuint kServiceCopyTextureChromiumShaderId = 701; | 522 static const GLuint kServiceCopyTextureChromiumShaderId = 701; |
505 static const GLuint kServiceCopyTextureChromiumProgramId = 721; | 523 static const GLuint kServiceCopyTextureChromiumProgramId = 721; |
506 | 524 |
507 static const GLuint kServiceCopyTextureChromiumTextureBufferId = 751; | 525 static const GLuint kServiceCopyTextureChromiumTextureBufferId = 751; |
508 static const GLuint kServiceCopyTextureChromiumVertexBufferId = 752; | 526 static const GLuint kServiceCopyTextureChromiumVertexBufferId = 752; |
509 static const GLuint kServiceCopyTextureChromiumFBOId = 753; | 527 static const GLuint kServiceCopyTextureChromiumFBOId = 753; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 GLuint client_texture_id_; | 628 GLuint client_texture_id_; |
611 GLuint client_element_buffer_id_; | 629 GLuint client_element_buffer_id_; |
612 GLuint client_vertex_shader_id_; | 630 GLuint client_vertex_shader_id_; |
613 GLuint client_fragment_shader_id_; | 631 GLuint client_fragment_shader_id_; |
614 GLuint client_query_id_; | 632 GLuint client_query_id_; |
615 GLuint client_vertexarray_id_; | 633 GLuint client_vertexarray_id_; |
616 GLuint client_valuebuffer_id_; | 634 GLuint client_valuebuffer_id_; |
617 GLuint client_transformfeedback_id_; | 635 GLuint client_transformfeedback_id_; |
618 GLuint client_sync_id_; | 636 GLuint client_sync_id_; |
619 | 637 |
620 uint32 shared_memory_id_; | 638 uint32_t shared_memory_id_; |
621 uint32 shared_memory_offset_; | 639 uint32_t shared_memory_offset_; |
622 void* shared_memory_address_; | 640 void* shared_memory_address_; |
623 void* shared_memory_base_; | 641 void* shared_memory_base_; |
624 | 642 |
625 GLuint service_renderbuffer_id_; | 643 GLuint service_renderbuffer_id_; |
626 bool service_renderbuffer_valid_; | 644 bool service_renderbuffer_valid_; |
627 | 645 |
628 uint32 immediate_buffer_[64]; | 646 uint32_t immediate_buffer_[64]; |
629 | 647 |
630 const bool ignore_cached_state_for_test_; | 648 const bool ignore_cached_state_for_test_; |
631 bool cached_color_mask_red_; | 649 bool cached_color_mask_red_; |
632 bool cached_color_mask_green_; | 650 bool cached_color_mask_green_; |
633 bool cached_color_mask_blue_; | 651 bool cached_color_mask_blue_; |
634 bool cached_color_mask_alpha_; | 652 bool cached_color_mask_alpha_; |
635 bool cached_depth_mask_; | 653 bool cached_depth_mask_; |
636 GLuint cached_stencil_front_mask_; | 654 GLuint cached_stencil_front_mask_; |
637 GLuint cached_stencil_back_mask_; | 655 GLuint cached_stencil_back_mask_; |
638 | 656 |
(...skipping 14 matching lines...) Expand all Loading... |
653 | 671 |
654 int shader_language_version_; | 672 int shader_language_version_; |
655 | 673 |
656 private: | 674 private: |
657 class MockCommandBufferEngine : public CommandBufferEngine { | 675 class MockCommandBufferEngine : public CommandBufferEngine { |
658 public: | 676 public: |
659 MockCommandBufferEngine(); | 677 MockCommandBufferEngine(); |
660 | 678 |
661 ~MockCommandBufferEngine() override; | 679 ~MockCommandBufferEngine() override; |
662 | 680 |
663 scoped_refptr<gpu::Buffer> GetSharedMemoryBuffer(int32 shm_id) override; | 681 scoped_refptr<gpu::Buffer> GetSharedMemoryBuffer(int32_t shm_id) override; |
664 | 682 |
665 void ClearSharedMemory() { | 683 void ClearSharedMemory() { |
666 memset(valid_buffer_->memory(), kInitialMemoryValue, kSharedBufferSize); | 684 memset(valid_buffer_->memory(), kInitialMemoryValue, kSharedBufferSize); |
667 } | 685 } |
668 | 686 |
669 void set_token(int32 token) override; | 687 void set_token(int32_t token) override; |
670 | 688 |
671 bool SetGetBuffer(int32 /* transfer_buffer_id */) override; | 689 bool SetGetBuffer(int32_t /* transfer_buffer_id */) override; |
672 | 690 |
673 // Overridden from CommandBufferEngine. | 691 // Overridden from CommandBufferEngine. |
674 bool SetGetOffset(int32 offset) override; | 692 bool SetGetOffset(int32_t offset) override; |
675 | 693 |
676 // Overridden from CommandBufferEngine. | 694 // Overridden from CommandBufferEngine. |
677 int32 GetGetOffset() override; | 695 int32_t GetGetOffset() override; |
678 | 696 |
679 private: | 697 private: |
680 scoped_refptr<gpu::Buffer> valid_buffer_; | 698 scoped_refptr<gpu::Buffer> valid_buffer_; |
681 scoped_refptr<gpu::Buffer> invalid_buffer_; | 699 scoped_refptr<gpu::Buffer> invalid_buffer_; |
682 }; | 700 }; |
683 | 701 |
684 // MockGLStates is used to track GL states and emulate driver | 702 // MockGLStates is used to track GL states and emulate driver |
685 // behaviors on top of MockGLInterface. | 703 // behaviors on top of MockGLInterface. |
686 class MockGLStates { | 704 class MockGLStates { |
687 public: | 705 public: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 }; | 755 }; |
738 | 756 |
739 // SpecializedSetup specializations that are needed in multiple unittest files. | 757 // SpecializedSetup specializations that are needed in multiple unittest files. |
740 template <> | 758 template <> |
741 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); | 759 void GLES2DecoderTestBase::SpecializedSetup<cmds::LinkProgram, 0>(bool valid); |
742 | 760 |
743 } // namespace gles2 | 761 } // namespace gles2 |
744 } // namespace gpu | 762 } // namespace gpu |
745 | 763 |
746 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ | 764 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_BASE_H_ |
OLD | NEW |