| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "mojo/public/cpp/system/core.h" | 10 #include "mojo/public/cpp/system/core.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 namespace mojo { | 24 namespace mojo { |
| 25 namespace services { | 25 namespace services { |
| 26 | 26 |
| 27 class CommandBufferImpl : public InterfaceImpl<CommandBuffer> { | 27 class CommandBufferImpl : public InterfaceImpl<CommandBuffer> { |
| 28 public: | 28 public: |
| 29 CommandBufferImpl(gfx::AcceleratedWidget widget, | 29 CommandBufferImpl(gfx::AcceleratedWidget widget, |
| 30 const gfx::Size& size); | 30 const gfx::Size& size); |
| 31 virtual ~CommandBufferImpl(); | 31 virtual ~CommandBufferImpl(); |
| 32 | 32 |
| 33 virtual void OnConnectionError() OVERRIDE; | 33 virtual void OnConnectionError() OVERRIDE; |
| 34 virtual void SetClient(CommandBufferClient* client) OVERRIDE; | |
| 35 virtual void Initialize(CommandBufferSyncClientPtr sync_client, | 34 virtual void Initialize(CommandBufferSyncClientPtr sync_client, |
| 36 mojo::ScopedSharedBufferHandle shared_state) OVERRIDE; | 35 mojo::ScopedSharedBufferHandle shared_state) OVERRIDE; |
| 37 virtual void SetGetBuffer(int32_t buffer) OVERRIDE; | 36 virtual void SetGetBuffer(int32_t buffer) OVERRIDE; |
| 38 virtual void Flush(int32_t put_offset) OVERRIDE; | 37 virtual void Flush(int32_t put_offset) OVERRIDE; |
| 39 virtual void MakeProgress(int32_t last_get_offset) OVERRIDE; | 38 virtual void MakeProgress(int32_t last_get_offset) OVERRIDE; |
| 40 virtual void RegisterTransferBuffer( | 39 virtual void RegisterTransferBuffer( |
| 41 int32_t id, | 40 int32_t id, |
| 42 mojo::ScopedSharedBufferHandle transfer_buffer, | 41 mojo::ScopedSharedBufferHandle transfer_buffer, |
| 43 uint32_t size) OVERRIDE; | 42 uint32_t size) OVERRIDE; |
| 44 virtual void DestroyTransferBuffer(int32_t id) OVERRIDE; | 43 virtual void DestroyTransferBuffer(int32_t id) OVERRIDE; |
| 45 virtual void Echo(const Callback<void()>& callback) OVERRIDE; | 44 virtual void Echo(const Callback<void()>& callback) OVERRIDE; |
| 46 | 45 |
| 47 virtual void RequestAnimationFrames() OVERRIDE; | 46 virtual void RequestAnimationFrames() OVERRIDE; |
| 48 virtual void CancelAnimationFrames() OVERRIDE; | 47 virtual void CancelAnimationFrames() OVERRIDE; |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 bool DoInitialize(mojo::ScopedSharedBufferHandle shared_state); | 50 bool DoInitialize(mojo::ScopedSharedBufferHandle shared_state); |
| 52 | 51 |
| 53 void OnParseError(); | 52 void OnParseError(); |
| 54 | 53 |
| 55 void DrawAnimationFrame(); | 54 void DrawAnimationFrame(); |
| 56 | 55 |
| 57 CommandBufferClient* client_; | |
| 58 CommandBufferSyncClientPtr sync_client_; | 56 CommandBufferSyncClientPtr sync_client_; |
| 59 | 57 |
| 60 gfx::AcceleratedWidget widget_; | 58 gfx::AcceleratedWidget widget_; |
| 61 gfx::Size size_; | 59 gfx::Size size_; |
| 62 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 60 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
| 63 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 61 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
| 64 scoped_ptr<gpu::GpuScheduler> scheduler_; | 62 scoped_ptr<gpu::GpuScheduler> scheduler_; |
| 65 scoped_ptr<gpu::GpuControlService> gpu_control_; | 63 scoped_ptr<gpu::GpuControlService> gpu_control_; |
| 66 base::RepeatingTimer<CommandBufferImpl> timer_; | 64 base::RepeatingTimer<CommandBufferImpl> timer_; |
| 67 | 65 |
| 68 DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl); | 66 DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl); |
| 69 }; | 67 }; |
| 70 | 68 |
| 71 } // namespace services | 69 } // namespace services |
| 72 } // namespace mojo | 70 } // namespace mojo |
| 73 | 71 |
| 74 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ | 72 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ |
| OLD | NEW |