| OLD | NEW |
| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // Setup the shared memory that shared state should be copied into. | 88 // Setup the shared memory that shared state should be copied into. |
| 89 void SetSharedStateBuffer(std::unique_ptr<BufferBacking> shared_state_buffer); | 89 void SetSharedStateBuffer(std::unique_ptr<BufferBacking> shared_state_buffer); |
| 90 | 90 |
| 91 // Copy the current state into the shared state transfer buffer. | 91 // Copy the current state into the shared state transfer buffer. |
| 92 void UpdateState(); | 92 void UpdateState(); |
| 93 | 93 |
| 94 // Registers an existing shared memory object and get an ID that can be used | 94 // Registers an existing shared memory object and get an ID that can be used |
| 95 // to identify it in the command buffer. | 95 // to identify it in the command buffer. |
| 96 bool RegisterTransferBuffer(int32_t id, | 96 bool RegisterTransferBuffer(int32_t id, |
| 97 std::unique_ptr<BufferBacking> buffer); | 97 std::unique_ptr<BufferBacking> buffer); |
| 98 scoped_refptr<Buffer> CreateTransferBufferWithId(size_t size, int32_t id); |
| 98 | 99 |
| 99 private: | 100 private: |
| 100 int32_t ring_buffer_id_; | 101 int32_t ring_buffer_id_; |
| 101 scoped_refptr<Buffer> ring_buffer_; | 102 scoped_refptr<Buffer> ring_buffer_; |
| 102 std::unique_ptr<BufferBacking> shared_state_buffer_; | 103 std::unique_ptr<BufferBacking> shared_state_buffer_; |
| 103 CommandBufferSharedState* shared_state_; | 104 CommandBufferSharedState* shared_state_; |
| 104 int32_t num_entries_; | 105 int32_t num_entries_; |
| 105 int32_t get_offset_; | 106 int32_t get_offset_; |
| 106 int32_t put_offset_; | 107 int32_t put_offset_; |
| 107 base::Closure put_offset_change_callback_; | 108 base::Closure put_offset_change_callback_; |
| 108 GetBufferChangedCallback get_buffer_change_callback_; | 109 GetBufferChangedCallback get_buffer_change_callback_; |
| 109 base::Closure parse_error_callback_; | 110 base::Closure parse_error_callback_; |
| 110 scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; | 111 scoped_refptr<TransferBufferManagerInterface> transfer_buffer_manager_; |
| 111 int32_t token_; | 112 int32_t token_; |
| 112 uint32_t generation_; | 113 uint32_t generation_; |
| 113 error::Error error_; | 114 error::Error error_; |
| 114 error::ContextLostReason context_lost_reason_; | 115 error::ContextLostReason context_lost_reason_; |
| 115 | 116 |
| 116 DISALLOW_COPY_AND_ASSIGN(CommandBufferService); | 117 DISALLOW_COPY_AND_ASSIGN(CommandBufferService); |
| 117 }; | 118 }; |
| 118 | 119 |
| 119 } // namespace gpu | 120 } // namespace gpu |
| 120 | 121 |
| 121 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ | 122 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ |
| OLD | NEW |