| 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 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/common/gl_mock.h" | 7 #include "gpu/command_buffer/common/gl_mock.h" |
| 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/gles2_cmd_decoder_unittest_base.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 GLES2DecoderTest2() { } | 32 GLES2DecoderTest2() { } |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 template <> | 35 template <> |
| 36 void GLES2DecoderTestBase::SpecializedSetup<GenQueriesEXT, 0>( | 36 void GLES2DecoderTestBase::SpecializedSetup<GenQueriesEXT, 0>( |
| 37 bool valid) { | 37 bool valid) { |
| 38 if (!valid) { | 38 if (!valid) { |
| 39 // Make the client_query_id_ so that trying to make it again | 39 // Make the client_query_id_ so that trying to make it again |
| 40 // will fail. | 40 // will fail. |
| 41 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; | 41 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; |
| 42 EXPECT_CALL(*gl_, GenQueriesARB(1, _)) | |
| 43 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); | |
| 44 GenQueriesEXT cmd; | 42 GenQueriesEXT cmd; |
| 45 cmd.Init(1, shared_memory_id_, shared_memory_offset_); | 43 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 46 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 44 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 47 } | 45 } |
| 48 // In the valid case this deletes the one created in the test. In the invalid | |
| 49 // case it deleted the one above. | |
| 50 EXPECT_CALL(*gl_, DeleteQueriesARB(1, _)) | |
| 51 .Times(1) | |
| 52 .RetiresOnSaturation(); | |
| 53 }; | 46 }; |
| 54 | 47 |
| 55 template <> | 48 template <> |
| 56 void GLES2DecoderTestBase::SpecializedSetup<GenQueriesEXTImmediate, 0>( | 49 void GLES2DecoderTestBase::SpecializedSetup<GenQueriesEXTImmediate, 0>( |
| 57 bool valid) { | 50 bool valid) { |
| 58 if (!valid) { | 51 if (!valid) { |
| 59 // Make the client_query_id_ so that trying to make it again | 52 // Make the client_query_id_ so that trying to make it again |
| 60 // will fail. | 53 // will fail. |
| 61 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; | 54 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; |
| 62 EXPECT_CALL(*gl_, GenQueriesARB(1, _)) | |
| 63 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); | |
| 64 GenQueriesEXT cmd; | 55 GenQueriesEXT cmd; |
| 65 cmd.Init(1, shared_memory_id_, shared_memory_offset_); | 56 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 66 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 57 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 67 } | 58 } |
| 68 // In the valid case this deletes the one created in the test. In the invalid | |
| 69 // case it deleted the one above. | |
| 70 EXPECT_CALL(*gl_, DeleteQueriesARB(1, _)) | |
| 71 .Times(1) | |
| 72 .RetiresOnSaturation(); | |
| 73 }; | 59 }; |
| 74 | 60 |
| 75 template <> | 61 template <> |
| 76 void GLES2DecoderTestBase::SpecializedSetup<DeleteQueriesEXT, 0>( | 62 void GLES2DecoderTestBase::SpecializedSetup<DeleteQueriesEXT, 0>( |
| 77 bool valid) { | 63 bool valid) { |
| 78 if (valid) { | 64 if (valid) { |
| 79 // Make the client_query_id_ so that trying to delete it will succeed. | 65 // Make the client_query_id_ so that trying to delete it will succeed. |
| 80 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; | 66 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; |
| 81 EXPECT_CALL(*gl_, GenQueriesARB(1, _)) | |
| 82 .WillOnce(SetArgumentPointee<1>(kServiceQueryId)); | |
| 83 GenQueriesEXT cmd; | 67 GenQueriesEXT cmd; |
| 84 cmd.Init(1, shared_memory_id_, shared_memory_offset_); | 68 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 85 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 69 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 86 } | 70 } |
| 87 }; | 71 }; |
| 88 | 72 |
| 89 template <> | 73 template <> |
| 90 void GLES2DecoderTestBase::SpecializedSetup<DeleteQueriesEXTImmediate, 0>( | 74 void GLES2DecoderTestBase::SpecializedSetup<DeleteQueriesEXTImmediate, 0>( |
| 91 bool valid) { | 75 bool valid) { |
| 92 if (valid) { | 76 if (valid) { |
| 93 // Make the client_query_id_ so that trying to delete it will succeed. | 77 // Make the client_query_id_ so that trying to delete it will succeed. |
| 94 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; | 78 GetSharedMemoryAs<GLuint*>()[0] = client_query_id_; |
| 95 EXPECT_CALL(*gl_, GenQueriesARB(1, _)) | |
| 96 .WillOnce(SetArgumentPointee<1>(kServiceQueryId)); | |
| 97 GenQueriesEXT cmd; | 79 GenQueriesEXT cmd; |
| 98 cmd.Init(1, shared_memory_id_, shared_memory_offset_); | 80 cmd.Init(1, shared_memory_id_, shared_memory_offset_); |
| 99 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 81 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 100 } | 82 } |
| 101 }; | 83 }; |
| 102 | 84 |
| 103 template <> | 85 template <> |
| 104 void GLES2DecoderTestBase::SpecializedSetup<LinkProgram, 0>(bool /* valid */) { | 86 void GLES2DecoderTestBase::SpecializedSetup<LinkProgram, 0>(bool /* valid */) { |
| 105 const GLuint kClientVertexShaderId = 5001; | 87 const GLuint kClientVertexShaderId = 5001; |
| 106 const GLuint kServiceVertexShaderId = 6001; | 88 const GLuint kServiceVertexShaderId = 6001; |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 .WillOnce(Return(GL_NO_ERROR)) | 376 .WillOnce(Return(GL_NO_ERROR)) |
| 395 .RetiresOnSaturation(); | 377 .RetiresOnSaturation(); |
| 396 } | 378 } |
| 397 }; | 379 }; |
| 398 | 380 |
| 399 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h" | 381 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h" |
| 400 | 382 |
| 401 } // namespace gles2 | 383 } // namespace gles2 |
| 402 } // namespace gpu | 384 } // namespace gpu |
| 403 | 385 |
| OLD | NEW |