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

Side by Side Diff: gpu/command_buffer/client/client_test_helper.h

Issue 2550583002: gpu: Thread-safe command buffer state lookup. (Closed)
Patch Set: jbauman's review Created 4 years 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 // Helper classes for implementing gpu client side unit tests. 5 // Helper classes for implementing gpu client side unit tests.
6 6
7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_ 7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_
8 #define GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_ 8 #define GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 15 matching lines...) Expand all
26 26
27 class MockCommandBufferBase : public CommandBufferServiceBase { 27 class MockCommandBufferBase : public CommandBufferServiceBase {
28 public: 28 public:
29 static const int32_t kTransferBufferBaseId = 0x123; 29 static const int32_t kTransferBufferBaseId = 0x123;
30 static const int32_t kMaxTransferBuffers = 32; 30 static const int32_t kMaxTransferBuffers = 32;
31 31
32 MockCommandBufferBase(); 32 MockCommandBufferBase();
33 ~MockCommandBufferBase() override; 33 ~MockCommandBufferBase() override;
34 34
35 State GetLastState() override; 35 State GetLastState() override;
36 int32_t GetLastToken() override; 36 State WaitForTokenInRange(int32_t start, int32_t end) override;
37 void WaitForTokenInRange(int32_t start, int32_t end) override; 37 State WaitForGetOffsetInRange(int32_t start, int32_t end) override;
38 void WaitForGetOffsetInRange(int32_t start, int32_t end) override;
39 void SetGetBuffer(int transfer_buffer_id) override; 38 void SetGetBuffer(int transfer_buffer_id) override;
40 void SetGetOffset(int32_t get_offset) override; 39 void SetGetOffset(int32_t get_offset) override;
40 void SetReleaseCount(uint64_t release_count) override;
41 scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, 41 scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size,
42 int32_t* id) override; 42 int32_t* id) override;
43 scoped_refptr<gpu::Buffer> GetTransferBuffer(int32_t id) override; 43 scoped_refptr<gpu::Buffer> GetTransferBuffer(int32_t id) override;
44 void SetToken(int32_t token) override; 44 void SetToken(int32_t token) override;
45 void SetParseError(error::Error error) override; 45 void SetParseError(error::Error error) override;
46 void SetContextLostReason(error::ContextLostReason reason) override; 46 void SetContextLostReason(error::ContextLostReason reason) override;
47 int32_t GetPutOffset() override; 47 int32_t GetPutOffset() override;
48 48
49 // Get's the Id of the next transfer buffer that will be returned 49 // Get's the Id of the next transfer buffer that will be returned
50 // by CreateTransferBuffer. This is useful for testing expected ids. 50 // by CreateTransferBuffer. This is useful for testing expected ids.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 MOCK_METHOD1(CreateStreamTexture, uint32_t(uint32_t)); 112 MOCK_METHOD1(CreateStreamTexture, uint32_t(uint32_t));
113 MOCK_METHOD1(SetLock, void(base::Lock*)); 113 MOCK_METHOD1(SetLock, void(base::Lock*));
114 MOCK_METHOD0(EnsureWorkVisible, void()); 114 MOCK_METHOD0(EnsureWorkVisible, void());
115 MOCK_CONST_METHOD0(GetNamespaceID, CommandBufferNamespace()); 115 MOCK_CONST_METHOD0(GetNamespaceID, CommandBufferNamespace());
116 MOCK_CONST_METHOD0(GetCommandBufferID, CommandBufferId()); 116 MOCK_CONST_METHOD0(GetCommandBufferID, CommandBufferId());
117 MOCK_CONST_METHOD0(GetExtraCommandBufferData, int32_t()); 117 MOCK_CONST_METHOD0(GetExtraCommandBufferData, int32_t());
118 MOCK_METHOD0(GenerateFenceSyncRelease, uint64_t()); 118 MOCK_METHOD0(GenerateFenceSyncRelease, uint64_t());
119 MOCK_METHOD1(IsFenceSyncRelease, bool(uint64_t release)); 119 MOCK_METHOD1(IsFenceSyncRelease, bool(uint64_t release));
120 MOCK_METHOD1(IsFenceSyncFlushed, bool(uint64_t release)); 120 MOCK_METHOD1(IsFenceSyncFlushed, bool(uint64_t release));
121 MOCK_METHOD1(IsFenceSyncFlushReceived, bool(uint64_t release)); 121 MOCK_METHOD1(IsFenceSyncFlushReceived, bool(uint64_t release));
122 MOCK_METHOD1(IsFenceSyncReleased, bool(uint64_t release));
122 MOCK_METHOD2(SignalSyncToken, void(const SyncToken& sync_token, 123 MOCK_METHOD2(SignalSyncToken, void(const SyncToken& sync_token,
123 const base::Closure& callback)); 124 const base::Closure& callback));
124 MOCK_METHOD1(CanWaitUnverifiedSyncToken, bool(const SyncToken*)); 125 MOCK_METHOD1(CanWaitUnverifiedSyncToken, bool(const SyncToken*));
125 126
126 private: 127 private:
127 DISALLOW_COPY_AND_ASSIGN(MockClientGpuControl); 128 DISALLOW_COPY_AND_ASSIGN(MockClientGpuControl);
128 }; 129 };
129 130
130 } // namespace gpu 131 } // namespace gpu
131 132
132 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_ 133 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_
133 134
OLDNEW
« no previous file with comments | « content/renderer/pepper/ppb_graphics_3d_impl.cc ('k') | gpu/command_buffer/client/client_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698