| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ | 5 #ifndef COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ |
| 6 #define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ | 6 #define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 namespace { | 28 namespace { |
| 29 class WaitableEvent; | 29 class WaitableEvent; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace gfx { | 32 namespace gfx { |
| 33 class GLContext; | 33 class GLContext; |
| 34 class GLSurface; | 34 class GLSurface; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace gpu { | 37 namespace gpu { |
| 38 class GpuControlClient; |
| 38 class SyncPointClient; | 39 class SyncPointClient; |
| 39 } | 40 } |
| 40 | 41 |
| 41 namespace mus { | 42 namespace mus { |
| 42 | 43 |
| 43 class CommandBufferDriver; | 44 class CommandBufferDriver; |
| 44 class CommandBufferLocalClient; | 45 class CommandBufferLocalClient; |
| 45 class GpuState; | 46 class GpuState; |
| 46 | 47 |
| 47 // This class provides a wrapper around a CommandBufferDriver and a GpuControl | 48 // This class provides a wrapper around a CommandBufferDriver and a GpuControl |
| (...skipping 19 matching lines...) Expand all Loading... |
| 67 void Flush(int32_t put_offset) override; | 68 void Flush(int32_t put_offset) override; |
| 68 void OrderingBarrier(int32_t put_offset) override; | 69 void OrderingBarrier(int32_t put_offset) override; |
| 69 void WaitForTokenInRange(int32_t start, int32_t end) override; | 70 void WaitForTokenInRange(int32_t start, int32_t end) override; |
| 70 void WaitForGetOffsetInRange(int32_t start, int32_t end) override; | 71 void WaitForGetOffsetInRange(int32_t start, int32_t end) override; |
| 71 void SetGetBuffer(int32_t buffer) override; | 72 void SetGetBuffer(int32_t buffer) override; |
| 72 scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, | 73 scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, |
| 73 int32_t* id) override; | 74 int32_t* id) override; |
| 74 void DestroyTransferBuffer(int32_t id) override; | 75 void DestroyTransferBuffer(int32_t id) override; |
| 75 | 76 |
| 76 // gpu::GpuControl implementation: | 77 // gpu::GpuControl implementation: |
| 78 void SetGpuControlClient(gpu::GpuControlClient*) override; |
| 77 gpu::Capabilities GetCapabilities() override; | 79 gpu::Capabilities GetCapabilities() override; |
| 78 int32_t CreateImage(ClientBuffer buffer, | 80 int32_t CreateImage(ClientBuffer buffer, |
| 79 size_t width, | 81 size_t width, |
| 80 size_t height, | 82 size_t height, |
| 81 unsigned internalformat) override; | 83 unsigned internalformat) override; |
| 82 void DestroyImage(int32_t id) override; | 84 void DestroyImage(int32_t id) override; |
| 83 int32_t CreateGpuMemoryBufferImage(size_t width, | 85 int32_t CreateGpuMemoryBufferImage(size_t width, |
| 84 size_t height, | 86 size_t height, |
| 85 unsigned internal_format, | 87 unsigned internal_format, |
| 86 unsigned usage) override; | 88 unsigned usage) override; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 void UpdateVSyncParametersOnClientThread(int64_t timebase, int64_t interval); | 139 void UpdateVSyncParametersOnClientThread(int64_t timebase, int64_t interval); |
| 138 void OnGpuCompletedSwapBuffersOnClientThread(gfx::SwapResult result); | 140 void OnGpuCompletedSwapBuffersOnClientThread(gfx::SwapResult result); |
| 139 | 141 |
| 140 gfx::AcceleratedWidget widget_; | 142 gfx::AcceleratedWidget widget_; |
| 141 scoped_refptr<GpuState> gpu_state_; | 143 scoped_refptr<GpuState> gpu_state_; |
| 142 scoped_ptr<CommandBufferDriver> driver_; | 144 scoped_ptr<CommandBufferDriver> driver_; |
| 143 CommandBufferLocalClient* client_; | 145 CommandBufferLocalClient* client_; |
| 144 scoped_refptr<base::SingleThreadTaskRunner> client_thread_task_runner_; | 146 scoped_refptr<base::SingleThreadTaskRunner> client_thread_task_runner_; |
| 145 | 147 |
| 146 // Members accessed on the client thread: | 148 // Members accessed on the client thread: |
| 149 gpu::GpuControlClient* gpu_control_client_; |
| 147 gpu::CommandBuffer::State last_state_; | 150 gpu::CommandBuffer::State last_state_; |
| 148 mojo::ScopedSharedBufferHandle shared_state_handle_; | 151 mojo::ScopedSharedBufferHandle shared_state_handle_; |
| 149 gpu::CommandBufferSharedState* shared_state_; | 152 gpu::CommandBufferSharedState* shared_state_; |
| 150 int32_t last_put_offset_; | 153 int32_t last_put_offset_; |
| 151 gpu::Capabilities capabilities_; | 154 gpu::Capabilities capabilities_; |
| 152 int32_t next_transfer_buffer_id_; | 155 int32_t next_transfer_buffer_id_; |
| 153 int32_t next_image_id_; | 156 int32_t next_image_id_; |
| 154 uint64_t next_fence_sync_release_; | 157 uint64_t next_fence_sync_release_; |
| 155 uint64_t flushed_fence_sync_release_; | 158 uint64_t flushed_fence_sync_release_; |
| 159 bool lost_context_; |
| 156 | 160 |
| 157 // This sync point client is only for out of order Wait on client thread. | 161 // This sync point client is only for out of order Wait on client thread. |
| 158 scoped_ptr<gpu::SyncPointClient> sync_point_client_waiter_; | 162 scoped_ptr<gpu::SyncPointClient> sync_point_client_waiter_; |
| 159 | 163 |
| 160 base::WeakPtr<CommandBufferLocal> weak_ptr_; | 164 base::WeakPtr<CommandBufferLocal> weak_ptr_; |
| 161 | 165 |
| 162 // This weak factory will be invalidated in the client thread, so all weak | 166 // This weak factory will be invalidated in the client thread, so all weak |
| 163 // pointers have to be dereferenced in the client thread too. | 167 // pointers have to be dereferenced in the client thread too. |
| 164 base::WeakPtrFactory<CommandBufferLocal> weak_factory_; | 168 base::WeakPtrFactory<CommandBufferLocal> weak_factory_; |
| 165 | 169 |
| 166 DISALLOW_COPY_AND_ASSIGN(CommandBufferLocal); | 170 DISALLOW_COPY_AND_ASSIGN(CommandBufferLocal); |
| 167 }; | 171 }; |
| 168 | 172 |
| 169 } // namespace mus | 173 } // namespace mus |
| 170 | 174 |
| 171 #endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ | 175 #endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ |
| OLD | NEW |