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

Side by Side Diff: gpu/command_buffer/common/command_buffer_mock.h

Issue 7253052: Execute all GL commands up to the put offset reported by a flush. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/common/command_buffer.h ('k') | gpu/command_buffer/common/constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_COMMON_COMMAND_BUFFER_MOCK_H_ 5 #ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_
6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_ 6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_
7 7
8 #include "../common/command_buffer.h" 8 #include "../common/command_buffer.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 10
11 namespace base { 11 namespace base {
12 class SharedMemory; 12 class SharedMemory;
13 } 13 }
14 14
15 namespace gpu { 15 namespace gpu {
16 16
17 // An NPObject that implements a shared memory command buffer and a synchronous 17 // An NPObject that implements a shared memory command buffer and a synchronous
18 // API to manage the put and get pointers. 18 // API to manage the put and get pointers.
19 class MockCommandBuffer : public CommandBuffer { 19 class MockCommandBuffer : public CommandBuffer {
20 public: 20 public:
21 MockCommandBuffer(); 21 MockCommandBuffer();
22 virtual ~MockCommandBuffer(); 22 virtual ~MockCommandBuffer();
23 23
24 MOCK_METHOD1(Initialize, bool(int32 size)); 24 MOCK_METHOD1(Initialize, bool(int32 size));
25 MOCK_METHOD2(Initialize, bool(base::SharedMemory* buffer, int32 size)); 25 MOCK_METHOD2(Initialize, bool(base::SharedMemory* buffer, int32 size));
26 MOCK_METHOD0(GetRingBuffer, Buffer()); 26 MOCK_METHOD0(GetRingBuffer, Buffer());
27 MOCK_METHOD0(GetState, State()); 27 MOCK_METHOD0(GetState, State());
28 MOCK_METHOD0(GetLastState, State());
28 MOCK_METHOD1(Flush, void(int32 put_offset)); 29 MOCK_METHOD1(Flush, void(int32 put_offset));
29 MOCK_METHOD2(FlushSync, State(int32 put_offset, int32 last_known_get)); 30 MOCK_METHOD2(FlushSync, State(int32 put_offset, int32 last_known_get));
30 MOCK_METHOD1(SetGetOffset, void(int32 get_offset)); 31 MOCK_METHOD1(SetGetOffset, void(int32 get_offset));
31 MOCK_METHOD2(CreateTransferBuffer, int32(size_t size, int32 id_request)); 32 MOCK_METHOD2(CreateTransferBuffer, int32(size_t size, int32 id_request));
32 MOCK_METHOD1(DestroyTransferBuffer, void(int32 handle)); 33 MOCK_METHOD1(DestroyTransferBuffer, void(int32 handle));
33 MOCK_METHOD1(GetTransferBuffer, Buffer(int32 handle)); 34 MOCK_METHOD1(GetTransferBuffer, Buffer(int32 handle));
34 MOCK_METHOD3(RegisterTransferBuffer, int32(base::SharedMemory* shared_memory, 35 MOCK_METHOD3(RegisterTransferBuffer, int32(base::SharedMemory* shared_memory,
35 size_t size, 36 size_t size,
36 int32 id_request)); 37 int32 id_request));
37 MOCK_METHOD1(SetToken, void(int32 token)); 38 MOCK_METHOD1(SetToken, void(int32 token));
38 MOCK_METHOD1(SetParseError, void(error::Error error)); 39 MOCK_METHOD1(SetParseError, void(error::Error error));
39 MOCK_METHOD1(SetContextLostReason, 40 MOCK_METHOD1(SetContextLostReason,
40 void(error::ContextLostReason context_lost_reason)); 41 void(error::ContextLostReason context_lost_reason));
41 42
42 private: 43 private:
43 DISALLOW_COPY_AND_ASSIGN(MockCommandBuffer); 44 DISALLOW_COPY_AND_ASSIGN(MockCommandBuffer);
44 }; 45 };
45 46
46 } // namespace gpu 47 } // namespace gpu
47 48
48 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_ 49 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/command_buffer.h ('k') | gpu/command_buffer/common/constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698