| 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 <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/shared_memory.h" | 14 #include "base/shared_memory.h" |
| 15 #include "gpu/command_buffer/common/command_buffer.h" | 15 #include "gpu/command_buffer/common/command_buffer.h" |
| 16 #include "gpu/command_buffer/common/command_buffer_shared.h" | 16 #include "gpu/command_buffer/common/command_buffer_shared.h" |
| 17 | 17 |
| 18 namespace gpu { | 18 namespace gpu { |
| 19 | 19 |
| 20 // An object that implements a shared memory command buffer and a synchronous | 20 // An object that implements a shared memory command buffer and a synchronous |
| 21 // API to manage the put and get pointers. | 21 // API to manage the put and get pointers. |
| 22 class CommandBufferService : public CommandBuffer { | 22 class GPU_EXPORT CommandBufferService : public CommandBuffer { |
| 23 public: | 23 public: |
| 24 typedef base::Callback<bool(int32)> GetBufferChangedCallback; | 24 typedef base::Callback<bool(int32)> GetBufferChangedCallback; |
| 25 CommandBufferService(); | 25 CommandBufferService(); |
| 26 virtual ~CommandBufferService(); | 26 virtual ~CommandBufferService(); |
| 27 | 27 |
| 28 // CommandBuffer implementation: | 28 // CommandBuffer implementation: |
| 29 virtual bool Initialize() OVERRIDE; | 29 virtual bool Initialize() OVERRIDE; |
| 30 virtual State GetState() OVERRIDE; | 30 virtual State GetState() OVERRIDE; |
| 31 virtual State GetLastState() OVERRIDE; | 31 virtual State GetLastState() OVERRIDE; |
| 32 virtual void Flush(int32 put_offset) OVERRIDE; | 32 virtual void Flush(int32 put_offset) OVERRIDE; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 int32 token_; | 78 int32 token_; |
| 79 uint32 generation_; | 79 uint32 generation_; |
| 80 error::Error error_; | 80 error::Error error_; |
| 81 error::ContextLostReason context_lost_reason_; | 81 error::ContextLostReason context_lost_reason_; |
| 82 size_t shared_memory_bytes_allocated_; | 82 size_t shared_memory_bytes_allocated_; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace gpu | 85 } // namespace gpu |
| 86 | 86 |
| 87 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ | 87 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ |
| OLD | NEW |