| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 10 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 class TestCommonDecoder : public CommonDecoder { | 56 class TestCommonDecoder : public CommonDecoder { |
| 57 public: | 57 public: |
| 58 // Overridden from AsyncAPIInterface | 58 // Overridden from AsyncAPIInterface |
| 59 const char* GetCommandName(unsigned int command_id) const override { | 59 const char* GetCommandName(unsigned int command_id) const override { |
| 60 return GetCommonCommandName(static_cast<cmd::CommandId>(command_id)); | 60 return GetCommonCommandName(static_cast<cmd::CommandId>(command_id)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Overridden from AsyncAPIInterface | 63 // Overridden from AsyncAPIInterface |
| 64 error::Error DoCommand(unsigned int command, | 64 error::Error DoCommand(unsigned int command, |
| 65 unsigned int arg_count, | 65 unsigned int arg_count, |
| 66 const void* cmd_data) override { | 66 const volatile void* cmd_data) override { |
| 67 return DoCommonCommand(command, arg_count, cmd_data); | 67 return DoCommonCommand(command, arg_count, cmd_data); |
| 68 } | 68 } |
| 69 | 69 |
| 70 CommonDecoder::Bucket* GetBucket(uint32_t id) const { | 70 CommonDecoder::Bucket* GetBucket(uint32_t id) const { |
| 71 return CommonDecoder::GetBucket(id); | 71 return CommonDecoder::GetBucket(id); |
| 72 } | 72 } |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 class MockCommandBufferEngine : public CommandBufferEngine { | 75 class MockCommandBufferEngine : public CommandBufferEngine { |
| 76 public: | 76 public: |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); | 503 MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); |
| 504 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); | 504 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); |
| 505 | 505 |
| 506 // Check that it fails if the size is invalid | 506 // Check that it fails if the size is invalid |
| 507 cmd.Init(kBucketId, 0, sizeof(kData) + 1, | 507 cmd.Init(kBucketId, 0, sizeof(kData) + 1, |
| 508 MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); | 508 MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); |
| 509 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); | 509 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace gpu | 512 } // namespace gpu |
| OLD | NEW |