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

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: [WIP] gpu: Reuse transfer buffers more aggresively Created 6 years, 11 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 "gpu/command_buffer/common/command_buffer.h" 10 #include "gpu/command_buffer/common/command_buffer.h"
(...skipping 18 matching lines...) Expand all
29 virtual State GetLastState() OVERRIDE; 29 virtual State GetLastState() OVERRIDE;
30 virtual int32 GetLastToken() OVERRIDE; 30 virtual int32 GetLastToken() OVERRIDE;
31 virtual void Flush(int32 put_offset) OVERRIDE; 31 virtual void Flush(int32 put_offset) OVERRIDE;
32 virtual State FlushSync(int32 put_offset, int32 last_known_get) OVERRIDE; 32 virtual State FlushSync(int32 put_offset, int32 last_known_get) OVERRIDE;
33 virtual void SetGetBuffer(int32 transfer_buffer_id) OVERRIDE; 33 virtual void SetGetBuffer(int32 transfer_buffer_id) OVERRIDE;
34 virtual void SetGetOffset(int32 get_offset) OVERRIDE; 34 virtual void SetGetOffset(int32 get_offset) OVERRIDE;
35 virtual Buffer CreateTransferBuffer(size_t size, int32* id) OVERRIDE; 35 virtual Buffer CreateTransferBuffer(size_t size, int32* id) OVERRIDE;
36 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; 36 virtual void DestroyTransferBuffer(int32 id) OVERRIDE;
37 virtual Buffer GetTransferBuffer(int32 id) OVERRIDE; 37 virtual Buffer GetTransferBuffer(int32 id) OVERRIDE;
38 virtual void SetToken(int32 token) OVERRIDE; 38 virtual void SetToken(int32 token) OVERRIDE;
39 virtual void SetSerial(uint32 serial) OVERRIDE;
39 virtual void SetParseError(error::Error error) OVERRIDE; 40 virtual void SetParseError(error::Error error) OVERRIDE;
40 virtual void SetContextLostReason(error::ContextLostReason) OVERRIDE; 41 virtual void SetContextLostReason(error::ContextLostReason) OVERRIDE;
41 42
42 // Sets a callback that is called whenever the put offset is changed. When 43 // Sets a callback that is called whenever the put offset is changed. When
43 // called with sync==true, the callback must not return until some progress 44 // called with sync==true, the callback must not return until some progress
44 // has been made (unless the command buffer is empty), i.e. the get offset 45 // has been made (unless the command buffer is empty), i.e. the get offset
45 // must have changed. It need not process the entire command buffer though. 46 // must have changed. It need not process the entire command buffer though.
46 // This allows concurrency between the writer and the reader while giving the 47 // This allows concurrency between the writer and the reader while giving the
47 // writer a means of waiting for the reader to make some progress before 48 // writer a means of waiting for the reader to make some progress before
48 // attempting to write more to the command buffer. Takes ownership of 49 // attempting to write more to the command buffer. Takes ownership of
(...skipping 23 matching lines...) Expand all
72 scoped_ptr<base::SharedMemory> shared_state_shm_; 73 scoped_ptr<base::SharedMemory> shared_state_shm_;
73 CommandBufferSharedState* shared_state_; 74 CommandBufferSharedState* shared_state_;
74 int32 num_entries_; 75 int32 num_entries_;
75 int32 get_offset_; 76 int32 get_offset_;
76 int32 put_offset_; 77 int32 put_offset_;
77 base::Closure put_offset_change_callback_; 78 base::Closure put_offset_change_callback_;
78 GetBufferChangedCallback get_buffer_change_callback_; 79 GetBufferChangedCallback get_buffer_change_callback_;
79 base::Closure parse_error_callback_; 80 base::Closure parse_error_callback_;
80 TransferBufferManagerInterface* transfer_buffer_manager_; 81 TransferBufferManagerInterface* transfer_buffer_manager_;
81 int32 token_; 82 int32 token_;
83 uint32 serial_;
82 uint32 generation_; 84 uint32 generation_;
83 error::Error error_; 85 error::Error error_;
84 error::ContextLostReason context_lost_reason_; 86 error::ContextLostReason context_lost_reason_;
85 87
86 DISALLOW_COPY_AND_ASSIGN(CommandBufferService); 88 DISALLOW_COPY_AND_ASSIGN(CommandBufferService);
87 }; 89 };
88 90
89 } // namespace gpu 91 } // namespace gpu
90 92
91 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ 93 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698