| 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_GLES2_COMMAND_BUFFER_CLIENT_IMPL_H_ | 5 #ifndef MOJO_GLES2_COMMAND_BUFFER_CLIENT_IMPL_H_ |
| 6 #define MOJO_GLES2_COMMAND_BUFFER_CLIENT_IMPL_H_ | 6 #define MOJO_GLES2_COMMAND_BUFFER_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 namespace gles2 { | 23 namespace gles2 { |
| 24 class CommandBufferClientImpl; | 24 class CommandBufferClientImpl; |
| 25 | 25 |
| 26 class CommandBufferDelegate { | 26 class CommandBufferDelegate { |
| 27 public: | 27 public: |
| 28 virtual ~CommandBufferDelegate(); | 28 virtual ~CommandBufferDelegate(); |
| 29 virtual void ContextLost(); | 29 virtual void ContextLost(); |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 class CommandBufferClientImpl : public mojo::CommandBufferLostContextObserver, | 32 class CommandBufferClientImpl |
| 33 public gpu::CommandBuffer, | 33 : public mus::mojom::CommandBufferLostContextObserver, |
| 34 public gpu::GpuControl { | 34 public gpu::CommandBuffer, |
| 35 public gpu::GpuControl { |
| 35 public: | 36 public: |
| 36 explicit CommandBufferClientImpl( | 37 explicit CommandBufferClientImpl( |
| 37 CommandBufferDelegate* delegate, | 38 CommandBufferDelegate* delegate, |
| 38 const std::vector<int32_t>& attribs, | 39 const std::vector<int32_t>& attribs, |
| 39 const MojoAsyncWaiter* async_waiter, | 40 const MojoAsyncWaiter* async_waiter, |
| 40 mojo::ScopedMessagePipeHandle command_buffer_handle); | 41 mojo::ScopedMessagePipeHandle command_buffer_handle); |
| 41 ~CommandBufferClientImpl() override; | 42 ~CommandBufferClientImpl() override; |
| 42 | 43 |
| 43 // CommandBuffer implementation: | 44 // CommandBuffer implementation: |
| 44 bool Initialize() override; | 45 bool Initialize() override; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 uint64_t GenerateFenceSyncRelease() override; | 80 uint64_t GenerateFenceSyncRelease() override; |
| 80 bool IsFenceSyncRelease(uint64_t release) override; | 81 bool IsFenceSyncRelease(uint64_t release) override; |
| 81 bool IsFenceSyncFlushed(uint64_t release) override; | 82 bool IsFenceSyncFlushed(uint64_t release) override; |
| 82 bool IsFenceSyncFlushReceived(uint64_t release) override; | 83 bool IsFenceSyncFlushReceived(uint64_t release) override; |
| 83 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; | 84 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; |
| 84 | 85 |
| 85 private: | 86 private: |
| 86 class SyncClientImpl; | 87 class SyncClientImpl; |
| 87 class SyncPointClientImpl; | 88 class SyncPointClientImpl; |
| 88 | 89 |
| 89 // mojo::CommandBufferLostContextObserver implementation: | 90 // mus::mojom::CommandBufferLostContextObserver implementation: |
| 90 void DidLoseContext(int32_t lost_reason) override; | 91 void DidLoseContext(int32_t lost_reason) override; |
| 91 | 92 |
| 92 void TryUpdateState(); | 93 void TryUpdateState(); |
| 93 void MakeProgressAndUpdateState(); | 94 void MakeProgressAndUpdateState(); |
| 94 | 95 |
| 95 gpu::CommandBufferSharedState* shared_state() const { return shared_state_; } | 96 gpu::CommandBufferSharedState* shared_state() const { return shared_state_; } |
| 96 | 97 |
| 97 CommandBufferDelegate* delegate_; | 98 CommandBufferDelegate* delegate_; |
| 98 std::vector<int32_t> attribs_; | 99 std::vector<int32_t> attribs_; |
| 99 mojo::Binding<mojo::CommandBufferLostContextObserver> observer_binding_; | 100 mojo::Binding<mus::mojom::CommandBufferLostContextObserver> observer_binding_; |
| 100 mojo::CommandBufferPtr command_buffer_; | 101 mus::mojom::CommandBufferPtr command_buffer_; |
| 101 scoped_ptr<SyncClientImpl> sync_client_impl_; | 102 scoped_ptr<SyncClientImpl> sync_client_impl_; |
| 102 scoped_ptr<SyncPointClientImpl> sync_point_client_impl_; | 103 scoped_ptr<SyncPointClientImpl> sync_point_client_impl_; |
| 103 | 104 |
| 104 gpu::Capabilities capabilities_; | 105 gpu::Capabilities capabilities_; |
| 105 State last_state_; | 106 State last_state_; |
| 106 mojo::ScopedSharedBufferHandle shared_state_handle_; | 107 mojo::ScopedSharedBufferHandle shared_state_handle_; |
| 107 gpu::CommandBufferSharedState* shared_state_; | 108 gpu::CommandBufferSharedState* shared_state_; |
| 108 int32_t last_put_offset_; | 109 int32_t last_put_offset_; |
| 109 int32_t next_transfer_buffer_id_; | 110 int32_t next_transfer_buffer_id_; |
| 110 | 111 |
| 111 // Image IDs are allocated in sequence. | 112 // Image IDs are allocated in sequence. |
| 112 int next_image_id_; | 113 int next_image_id_; |
| 113 | 114 |
| 114 uint64_t next_fence_sync_release_; | 115 uint64_t next_fence_sync_release_; |
| 115 uint64_t flushed_fence_sync_release_; | 116 uint64_t flushed_fence_sync_release_; |
| 116 | 117 |
| 117 const MojoAsyncWaiter* async_waiter_; | 118 const MojoAsyncWaiter* async_waiter_; |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 } // gles2 | 121 } // gles2 |
| 121 | 122 |
| 122 #endif // MOJO_GLES2_COMMAND_BUFFER_CLIENT_IMPL_H_ | 123 #endif // MOJO_GLES2_COMMAND_BUFFER_CLIENT_IMPL_H_ |
| OLD | NEW |