Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: gpu/command_buffer/service/common_decoder_unittest.cc

Issue 2275203002: Make command buffer commands and immediate data volatile (Closed)
Patch Set: std::copy->const_cast+memcpy Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/common_decoder.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698