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

Side by Side Diff: gpu/command_buffer/service/command_buffer_service.h

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Async upload token part of existing Async command; use separate shared memory to sync async upload … Created 6 years, 10 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/synchronization/lock.h"
piman 2014/02/07 22:58:20 You don't need this, or the other changes in this
jadahl 2014/02/08 09:18:25 Oops. Left them here unintentionally.
10 #include "gpu/command_buffer/common/command_buffer.h" 11 #include "gpu/command_buffer/common/command_buffer.h"
11 #include "gpu/command_buffer/common/command_buffer_shared.h" 12 #include "gpu/command_buffer/common/command_buffer_shared.h"
12 13
13 namespace gpu { 14 namespace gpu {
14 15
15 class TransferBufferManagerInterface; 16 class TransferBufferManagerInterface;
16 17
17 // An object that implements a shared memory command buffer and a synchronous 18 // An object that implements a shared memory command buffer and a synchronous
18 // API to manage the put and get pointers. 19 // API to manage the put and get pointers.
19 class GPU_EXPORT CommandBufferService : public CommandBuffer { 20 class GPU_EXPORT CommandBufferService : public CommandBuffer {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void UpdateState(); 61 void UpdateState();
61 62
62 // Register an existing shared memory object and get an ID that can be used 63 // Register an existing shared memory object and get an ID that can be used
63 // to identify it in the command buffer. Callee dups the handle until 64 // to identify it in the command buffer. Callee dups the handle until
64 // DestroyTransferBuffer is called. 65 // DestroyTransferBuffer is called.
65 bool RegisterTransferBuffer(int32 id, 66 bool RegisterTransferBuffer(int32 id,
66 base::SharedMemory* shared_memory, 67 base::SharedMemory* shared_memory,
67 size_t size); 68 size_t size);
68 69
69 private: 70 private:
71 State GetStateImpl();
72
70 int32 ring_buffer_id_; 73 int32 ring_buffer_id_;
71 Buffer ring_buffer_; 74 Buffer ring_buffer_;
72 scoped_ptr<base::SharedMemory> shared_state_shm_; 75 scoped_ptr<base::SharedMemory> shared_state_shm_;
73 CommandBufferSharedState* shared_state_; 76 CommandBufferSharedState* shared_state_;
74 int32 num_entries_; 77 int32 num_entries_;
75 int32 get_offset_; 78 int32 get_offset_;
76 int32 put_offset_; 79 int32 put_offset_;
77 base::Closure put_offset_change_callback_; 80 base::Closure put_offset_change_callback_;
78 GetBufferChangedCallback get_buffer_change_callback_; 81 GetBufferChangedCallback get_buffer_change_callback_;
79 base::Closure parse_error_callback_; 82 base::Closure parse_error_callback_;
80 TransferBufferManagerInterface* transfer_buffer_manager_; 83 TransferBufferManagerInterface* transfer_buffer_manager_;
81 int32 token_; 84 int32 token_;
85 uint32 async_token_;
82 uint32 generation_; 86 uint32 generation_;
83 error::Error error_; 87 error::Error error_;
84 error::ContextLostReason context_lost_reason_; 88 error::ContextLostReason context_lost_reason_;
89 base::Lock lock_;
85 90
86 DISALLOW_COPY_AND_ASSIGN(CommandBufferService); 91 DISALLOW_COPY_AND_ASSIGN(CommandBufferService);
87 }; 92 };
88 93
89 } // namespace gpu 94 } // namespace gpu
90 95
91 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ 96 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698