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

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

Issue 9581018: GPU: Build most of the gpu as a single DLL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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/DEPS ('k') | gpu/command_buffer/client/fenced_allocator.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) 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 // This file contains the command buffer helper class. 5 // This file contains the command buffer helper class.
6 6
7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ 7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_
8 #define GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ 8 #define GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_
9 9
10 #include <string.h> 10 #include <string.h>
11 #include <time.h> 11 #include <time.h>
12 12
13 #include "../../gpu_export.h"
13 #include "../common/logging.h" 14 #include "../common/logging.h"
14 #include "../common/constants.h" 15 #include "../common/constants.h"
15 #include "../common/cmd_buffer_common.h" 16 #include "../common/cmd_buffer_common.h"
16 #include "../common/command_buffer.h" 17 #include "../common/command_buffer.h"
17 18
18 namespace gpu { 19 namespace gpu {
19 20
20 // Command buffer helper class. This class simplifies ring buffer management: 21 // Command buffer helper class. This class simplifies ring buffer management:
21 // it will allocate the buffer, give it to the buffer interface, and let the 22 // it will allocate the buffer, give it to the buffer interface, and let the
22 // user add commands to it, while taking care of the synchronization (put and 23 // user add commands to it, while taking care of the synchronization (put and
23 // get). It also provides a way to ensure commands have been executed, through 24 // get). It also provides a way to ensure commands have been executed, through
24 // the token mechanism: 25 // the token mechanism:
25 // 26 //
26 // helper.AddCommand(...); 27 // helper.AddCommand(...);
27 // helper.AddCommand(...); 28 // helper.AddCommand(...);
28 // int32 token = helper.InsertToken(); 29 // int32 token = helper.InsertToken();
29 // helper.AddCommand(...); 30 // helper.AddCommand(...);
30 // helper.AddCommand(...); 31 // helper.AddCommand(...);
31 // [...] 32 // [...]
32 // 33 //
33 // helper.WaitForToken(token); // this doesn't return until the first two 34 // helper.WaitForToken(token); // this doesn't return until the first two
34 // // commands have been executed. 35 // // commands have been executed.
35 class CommandBufferHelper { 36 class GPU_EXPORT CommandBufferHelper {
36 public: 37 public:
37 explicit CommandBufferHelper(CommandBuffer* command_buffer); 38 explicit CommandBufferHelper(CommandBuffer* command_buffer);
38 virtual ~CommandBufferHelper(); 39 virtual ~CommandBufferHelper();
39 40
40 // Initializes the CommandBufferHelper. 41 // Initializes the CommandBufferHelper.
41 // Parameters: 42 // Parameters:
42 // ring_buffer_size: The size of the ring buffer portion of the command 43 // ring_buffer_size: The size of the ring buffer portion of the command
43 // buffer. 44 // buffer.
44 bool Initialize(int32 ring_buffer_size); 45 bool Initialize(int32 ring_buffer_size);
45 46
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // Using C runtime instead of base because this file cannot depend on base. 285 // Using C runtime instead of base because this file cannot depend on base.
285 clock_t last_flush_time_; 286 clock_t last_flush_time_;
286 287
287 friend class CommandBufferHelperTest; 288 friend class CommandBufferHelperTest;
288 DISALLOW_COPY_AND_ASSIGN(CommandBufferHelper); 289 DISALLOW_COPY_AND_ASSIGN(CommandBufferHelper);
289 }; 290 };
290 291
291 } // namespace gpu 292 } // namespace gpu
292 293
293 #endif // GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ 294 #endif // GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_
OLDNEW
« no previous file with comments | « gpu/DEPS ('k') | gpu/command_buffer/client/fenced_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698