| 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 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 public gpu::CommandBuffer, | 34 public gpu::CommandBuffer, |
| 35 public gpu::GpuControl { | 35 public gpu::GpuControl { |
| 36 public: | 36 public: |
| 37 explicit CommandBufferClientImpl( | 37 explicit CommandBufferClientImpl( |
| 38 CommandBufferDelegate* delegate, | 38 CommandBufferDelegate* delegate, |
| 39 const MojoAsyncWaiter* async_waiter, | 39 const MojoAsyncWaiter* async_waiter, |
| 40 ScopedMessagePipeHandle command_buffer_handle); | 40 ScopedMessagePipeHandle command_buffer_handle); |
| 41 virtual ~CommandBufferClientImpl(); | 41 virtual ~CommandBufferClientImpl(); |
| 42 | 42 |
| 43 // CommandBuffer implementation: | 43 // CommandBuffer implementation: |
| 44 virtual bool Initialize() OVERRIDE; | 44 virtual bool Initialize() override; |
| 45 virtual State GetLastState() OVERRIDE; | 45 virtual State GetLastState() override; |
| 46 virtual int32 GetLastToken() OVERRIDE; | 46 virtual int32 GetLastToken() override; |
| 47 virtual void Flush(int32 put_offset) OVERRIDE; | 47 virtual void Flush(int32 put_offset) override; |
| 48 virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE; | 48 virtual void WaitForTokenInRange(int32 start, int32 end) override; |
| 49 virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE; | 49 virtual void WaitForGetOffsetInRange(int32 start, int32 end) override; |
| 50 virtual void SetGetBuffer(int32 shm_id) OVERRIDE; | 50 virtual void SetGetBuffer(int32 shm_id) override; |
| 51 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, | 51 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, |
| 52 int32* id) OVERRIDE; | 52 int32* id) override; |
| 53 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; | 53 virtual void DestroyTransferBuffer(int32 id) override; |
| 54 | 54 |
| 55 // gpu::GpuControl implementation: | 55 // gpu::GpuControl implementation: |
| 56 virtual gpu::Capabilities GetCapabilities() OVERRIDE; | 56 virtual gpu::Capabilities GetCapabilities() override; |
| 57 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width, | 57 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width, |
| 58 size_t height, | 58 size_t height, |
| 59 unsigned internalformat, | 59 unsigned internalformat, |
| 60 unsigned usage, | 60 unsigned usage, |
| 61 int32* id) OVERRIDE; | 61 int32* id) override; |
| 62 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; | 62 virtual void DestroyGpuMemoryBuffer(int32 id) override; |
| 63 virtual uint32 InsertSyncPoint() OVERRIDE; | 63 virtual uint32 InsertSyncPoint() override; |
| 64 virtual uint32 InsertFutureSyncPoint() OVERRIDE; | 64 virtual uint32 InsertFutureSyncPoint() override; |
| 65 virtual void RetireSyncPoint(uint32 sync_point) OVERRIDE; | 65 virtual void RetireSyncPoint(uint32 sync_point) override; |
| 66 virtual void SignalSyncPoint(uint32 sync_point, | 66 virtual void SignalSyncPoint(uint32 sync_point, |
| 67 const base::Closure& callback) OVERRIDE; | 67 const base::Closure& callback) override; |
| 68 virtual void SignalQuery(uint32 query, | 68 virtual void SignalQuery(uint32 query, |
| 69 const base::Closure& callback) OVERRIDE; | 69 const base::Closure& callback) override; |
| 70 virtual void SetSurfaceVisible(bool visible) OVERRIDE; | 70 virtual void SetSurfaceVisible(bool visible) override; |
| 71 virtual void Echo(const base::Closure& callback) OVERRIDE; | 71 virtual void Echo(const base::Closure& callback) override; |
| 72 virtual uint32 CreateStreamTexture(uint32 texture_id) OVERRIDE; | 72 virtual uint32 CreateStreamTexture(uint32 texture_id) override; |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 class SyncClientImpl; | 75 class SyncClientImpl; |
| 76 | 76 |
| 77 // CommandBufferClient implementation: | 77 // CommandBufferClient implementation: |
| 78 virtual void DidDestroy() OVERRIDE; | 78 virtual void DidDestroy() override; |
| 79 virtual void LostContext(int32_t lost_reason) OVERRIDE; | 79 virtual void LostContext(int32_t lost_reason) override; |
| 80 | 80 |
| 81 // ErrorHandler implementation: | 81 // ErrorHandler implementation: |
| 82 virtual void OnConnectionError() OVERRIDE; | 82 virtual void OnConnectionError() override; |
| 83 | 83 |
| 84 void TryUpdateState(); | 84 void TryUpdateState(); |
| 85 void MakeProgressAndUpdateState(); | 85 void MakeProgressAndUpdateState(); |
| 86 | 86 |
| 87 gpu::CommandBufferSharedState* shared_state() const { return shared_state_; } | 87 gpu::CommandBufferSharedState* shared_state() const { return shared_state_; } |
| 88 | 88 |
| 89 CommandBufferDelegate* delegate_; | 89 CommandBufferDelegate* delegate_; |
| 90 CommandBufferPtr command_buffer_; | 90 CommandBufferPtr command_buffer_; |
| 91 scoped_ptr<SyncClientImpl> sync_client_impl_; | 91 scoped_ptr<SyncClientImpl> sync_client_impl_; |
| 92 | 92 |
| 93 State last_state_; | 93 State last_state_; |
| 94 mojo::ScopedSharedBufferHandle shared_state_handle_; | 94 mojo::ScopedSharedBufferHandle shared_state_handle_; |
| 95 gpu::CommandBufferSharedState* shared_state_; | 95 gpu::CommandBufferSharedState* shared_state_; |
| 96 int32 last_put_offset_; | 96 int32 last_put_offset_; |
| 97 int32 next_transfer_buffer_id_; | 97 int32 next_transfer_buffer_id_; |
| 98 | 98 |
| 99 const MojoAsyncWaiter* async_waiter_; | 99 const MojoAsyncWaiter* async_waiter_; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // gles2 | 102 } // gles2 |
| 103 } // mojo | 103 } // mojo |
| 104 | 104 |
| 105 #endif // MOJO_GLES2_COMMAND_BUFFER_CLIENT_IMPL_H_ | 105 #endif // MOJO_GLES2_COMMAND_BUFFER_CLIENT_IMPL_H_ |
| OLD | NEW |