| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ | 5 #ifndef MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ |
| 6 #define MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ | 6 #define MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 void Initialize(CommandBufferSyncClientPtr sync_client, | 34 void Initialize(CommandBufferSyncClientPtr sync_client, |
| 35 CommandBufferSyncPointClientPtr sync_point_client, | 35 CommandBufferSyncPointClientPtr sync_point_client, |
| 36 ScopedSharedBufferHandle shared_state) override; | 36 ScopedSharedBufferHandle shared_state) override; |
| 37 void SetGetBuffer(int32_t buffer) override; | 37 void SetGetBuffer(int32_t buffer) override; |
| 38 void Flush(int32_t put_offset) override; | 38 void Flush(int32_t put_offset) override; |
| 39 void MakeProgress(int32_t last_get_offset) override; | 39 void MakeProgress(int32_t last_get_offset) override; |
| 40 void RegisterTransferBuffer(int32_t id, | 40 void RegisterTransferBuffer(int32_t id, |
| 41 ScopedSharedBufferHandle transfer_buffer, | 41 ScopedSharedBufferHandle transfer_buffer, |
| 42 uint32_t size) override; | 42 uint32_t size) override; |
| 43 void DestroyTransferBuffer(int32_t id) override; | 43 void DestroyTransferBuffer(int32_t id) override; |
| 44 void InsertSyncPoint() override; | 44 void InsertSyncPoint(bool retire) override; |
| 45 void RetireSyncPoint(uint32_t sync_point) override; |
| 45 void Echo(const Callback<void()>& callback) override; | 46 void Echo(const Callback<void()>& callback) override; |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 void BindToRequest(InterfaceRequest<CommandBuffer> request); | 49 void BindToRequest(InterfaceRequest<CommandBuffer> request); |
| 49 void OnContextLost(int32_t reason); | 50 void OnContextLost(int32_t reason); |
| 50 | 51 |
| 51 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; | 52 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; |
| 52 scoped_refptr<base::SingleThreadTaskRunner> driver_task_runner_; | 53 scoped_refptr<base::SingleThreadTaskRunner> driver_task_runner_; |
| 53 scoped_ptr<CommandBufferDriver> driver_; | 54 scoped_ptr<CommandBufferDriver> driver_; |
| 54 CommandBufferSyncPointClientPtr sync_point_client_; | 55 CommandBufferSyncPointClientPtr sync_point_client_; |
| 55 StrongBinding<CommandBuffer> binding_; | 56 StrongBinding<CommandBuffer> binding_; |
| 56 | 57 |
| 57 base::WeakPtrFactory<CommandBufferImpl> weak_factory_; | 58 base::WeakPtrFactory<CommandBufferImpl> weak_factory_; |
| 58 DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl); | 59 DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 } // namespace mojo | 62 } // namespace mojo |
| 62 | 63 |
| 63 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ | 64 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ |
| OLD | NEW |