| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "components/mus/public/interfaces/command_buffer.mojom.h" | 16 #include "components/mus/public/interfaces/command_buffer.mojom.h" |
| 17 #include "gpu/command_buffer/client/gpu_control.h" | 17 #include "gpu/command_buffer/client/gpu_control.h" |
| 18 #include "gpu/command_buffer/common/command_buffer.h" | 18 #include "gpu/command_buffer/common/command_buffer.h" |
| 19 #include "gpu/command_buffer/common/command_buffer_id.h" |
| 19 #include "gpu/command_buffer/common/command_buffer_shared.h" | 20 #include "gpu/command_buffer/common/command_buffer_shared.h" |
| 20 #include "mojo/public/cpp/bindings/binding.h" | 21 #include "mojo/public/cpp/bindings/binding.h" |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class RunLoop; | 24 class RunLoop; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace gles2 { | 27 namespace gles2 { |
| 27 class CommandBufferClientImpl; | 28 class CommandBufferClientImpl; |
| 28 | 29 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 void DestroyImage(int32_t id) override; | 67 void DestroyImage(int32_t id) override; |
| 67 int32_t CreateGpuMemoryBufferImage(size_t width, | 68 int32_t CreateGpuMemoryBufferImage(size_t width, |
| 68 size_t height, | 69 size_t height, |
| 69 unsigned internalformat, | 70 unsigned internalformat, |
| 70 unsigned usage) override; | 71 unsigned usage) override; |
| 71 void SignalQuery(uint32_t query, const base::Closure& callback) override; | 72 void SignalQuery(uint32_t query, const base::Closure& callback) override; |
| 72 void SetLock(base::Lock*) override; | 73 void SetLock(base::Lock*) override; |
| 73 bool IsGpuChannelLost() override; | 74 bool IsGpuChannelLost() override; |
| 74 void EnsureWorkVisible() override; | 75 void EnsureWorkVisible() override; |
| 75 gpu::CommandBufferNamespace GetNamespaceID() const override; | 76 gpu::CommandBufferNamespace GetNamespaceID() const override; |
| 76 uint64_t GetCommandBufferID() const override; | 77 gpu::CommandBufferId GetCommandBufferID() const override; |
| 77 int32_t GetExtraCommandBufferData() const override; | 78 int32_t GetExtraCommandBufferData() const override; |
| 78 uint64_t GenerateFenceSyncRelease() override; | 79 uint64_t GenerateFenceSyncRelease() override; |
| 79 bool IsFenceSyncRelease(uint64_t release) override; | 80 bool IsFenceSyncRelease(uint64_t release) override; |
| 80 bool IsFenceSyncFlushed(uint64_t release) override; | 81 bool IsFenceSyncFlushed(uint64_t release) override; |
| 81 bool IsFenceSyncFlushReceived(uint64_t release) override; | 82 bool IsFenceSyncFlushReceived(uint64_t release) override; |
| 82 void SignalSyncToken(const gpu::SyncToken& sync_token, | 83 void SignalSyncToken(const gpu::SyncToken& sync_token, |
| 83 const base::Closure& callback) override; | 84 const base::Closure& callback) override; |
| 84 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; | 85 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; |
| 85 | 86 |
| 86 private: | 87 private: |
| 87 // mus::mojom::CommandBufferClient implementation: | 88 // mus::mojom::CommandBufferClient implementation: |
| 88 void Destroyed(int32_t lost_reason, int32_t error) override; | 89 void Destroyed(int32_t lost_reason, int32_t error) override; |
| 89 void SignalAck(uint32_t id) override; | 90 void SignalAck(uint32_t id) override; |
| 90 void SwapBuffersCompleted(int32_t result) override; | 91 void SwapBuffersCompleted(int32_t result) override; |
| 91 void UpdateState(const gpu::CommandBuffer::State& state) override; | 92 void UpdateState(const gpu::CommandBuffer::State& state) override; |
| 92 void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; | 93 void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; |
| 93 | 94 |
| 94 void TryUpdateState(); | 95 void TryUpdateState(); |
| 95 void MakeProgressAndUpdateState(); | 96 void MakeProgressAndUpdateState(); |
| 96 | 97 |
| 97 gpu::CommandBufferSharedState* shared_state() const { return shared_state_; } | 98 gpu::CommandBufferSharedState* shared_state() const { return shared_state_; } |
| 98 | 99 |
| 99 CommandBufferDelegate* delegate_; | 100 CommandBufferDelegate* delegate_; |
| 100 std::vector<int32_t> attribs_; | 101 std::vector<int32_t> attribs_; |
| 101 mojo::Binding<mus::mojom::CommandBufferClient> client_binding_; | 102 mojo::Binding<mus::mojom::CommandBufferClient> client_binding_; |
| 102 mus::mojom::CommandBufferPtr command_buffer_; | 103 mus::mojom::CommandBufferPtr command_buffer_; |
| 103 | 104 |
| 104 uint64_t command_buffer_id_; | 105 gpu::CommandBufferId command_buffer_id_; |
| 105 gpu::Capabilities capabilities_; | 106 gpu::Capabilities capabilities_; |
| 106 State last_state_; | 107 State last_state_; |
| 107 mojo::ScopedSharedBufferHandle shared_state_handle_; | 108 mojo::ScopedSharedBufferHandle shared_state_handle_; |
| 108 gpu::CommandBufferSharedState* shared_state_; | 109 gpu::CommandBufferSharedState* shared_state_; |
| 109 int32_t last_put_offset_; | 110 int32_t last_put_offset_; |
| 110 int32_t next_transfer_buffer_id_; | 111 int32_t next_transfer_buffer_id_; |
| 111 | 112 |
| 112 // Image IDs are allocated in sequence. | 113 // Image IDs are allocated in sequence. |
| 113 int next_image_id_; | 114 int next_image_id_; |
| 114 | 115 |
| 115 uint64_t next_fence_sync_release_; | 116 uint64_t next_fence_sync_release_; |
| 116 uint64_t flushed_fence_sync_release_; | 117 uint64_t flushed_fence_sync_release_; |
| 117 | 118 |
| 118 const MojoAsyncWaiter* async_waiter_; | 119 const MojoAsyncWaiter* async_waiter_; |
| 119 }; | 120 }; |
| 120 | 121 |
| 121 } // gles2 | 122 } // gles2 |
| 122 | 123 |
| 123 #endif // MOJO_GLES2_COMMAND_BUFFER_CLIENT_IMPL_H_ | 124 #endif // MOJO_GLES2_COMMAND_BUFFER_CLIENT_IMPL_H_ |
| OLD | NEW |