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

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

Issue 10441140: Make context groups share a TextureBufferManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
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/linked_ptr.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/shared_memory.h" 9 #include "base/shared_memory.h"
12 #include "gpu/command_buffer/common/command_buffer.h" 10 #include "gpu/command_buffer/common/command_buffer.h"
13 #include "gpu/command_buffer/common/command_buffer_shared.h" 11 #include "gpu/command_buffer/common/command_buffer_shared.h"
14 12
15 namespace gpu { 13 namespace gpu {
16 14
17 class TransferBufferManagerInterface; 15 class TransferBufferManagerInterface;
18 16
19 // An object that implements a shared memory command buffer and a synchronous 17 // An object that implements a shared memory command buffer and a synchronous
20 // API to manage the put and get pointers. 18 // API to manage the put and get pointers.
21 class GPU_EXPORT CommandBufferService : public CommandBuffer { 19 class GPU_EXPORT CommandBufferService : public CommandBuffer {
22 public: 20 public:
23 typedef base::Callback<bool(int32)> GetBufferChangedCallback; 21 typedef base::Callback<bool(int32)> GetBufferChangedCallback;
24 CommandBufferService(); 22 explicit CommandBufferService(
23 TransferBufferManagerInterface* transfer_buffer_manager);
25 virtual ~CommandBufferService(); 24 virtual ~CommandBufferService();
26 25
27 // CommandBuffer implementation: 26 // CommandBuffer implementation:
28 virtual bool Initialize() OVERRIDE; 27 virtual bool Initialize() OVERRIDE;
29 virtual State GetState() OVERRIDE; 28 virtual State GetState() OVERRIDE;
30 virtual State GetLastState() OVERRIDE; 29 virtual State GetLastState() OVERRIDE;
31 virtual void Flush(int32 put_offset) OVERRIDE; 30 virtual void Flush(int32 put_offset) OVERRIDE;
32 virtual State FlushSync(int32 put_offset, int32 last_known_get) OVERRIDE; 31 virtual State FlushSync(int32 put_offset, int32 last_known_get) OVERRIDE;
33 virtual void SetGetBuffer(int32 transfer_buffer_id) OVERRIDE; 32 virtual void SetGetBuffer(int32 transfer_buffer_id) OVERRIDE;
34 virtual void SetGetOffset(int32 get_offset) OVERRIDE; 33 virtual void SetGetOffset(int32 get_offset) OVERRIDE;
(...skipping 30 matching lines...) Expand all
65 private: 64 private:
66 int32 ring_buffer_id_; 65 int32 ring_buffer_id_;
67 Buffer ring_buffer_; 66 Buffer ring_buffer_;
68 CommandBufferSharedState* shared_state_; 67 CommandBufferSharedState* shared_state_;
69 int32 num_entries_; 68 int32 num_entries_;
70 int32 get_offset_; 69 int32 get_offset_;
71 int32 put_offset_; 70 int32 put_offset_;
72 base::Closure put_offset_change_callback_; 71 base::Closure put_offset_change_callback_;
73 GetBufferChangedCallback get_buffer_change_callback_; 72 GetBufferChangedCallback get_buffer_change_callback_;
74 base::Closure parse_error_callback_; 73 base::Closure parse_error_callback_;
75 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; 74 TransferBufferManagerInterface* transfer_buffer_manager_;
76 int32 token_; 75 int32 token_;
77 uint32 generation_; 76 uint32 generation_;
78 error::Error error_; 77 error::Error error_;
79 error::ContextLostReason context_lost_reason_; 78 error::ContextLostReason context_lost_reason_;
79
80 DISALLOW_COPY_AND_ASSIGN(CommandBufferService);
80 }; 81 };
81 82
82 } // namespace gpu 83 } // namespace gpu
83 84
84 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ 85 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698