Chromium Code Reviews| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| 11 #include "mojo/public/cpp/bindings/strong_binding.h" | |
| 11 #include "mojo/public/cpp/system/core.h" | 12 #include "mojo/public/cpp/system/core.h" |
| 12 #include "mojo/services/public/interfaces/gpu/command_buffer.mojom.h" | 13 #include "mojo/services/public/interfaces/gpu/command_buffer.mojom.h" |
| 13 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 14 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
| 15 | 16 |
| 16 namespace gpu { | 17 namespace gpu { |
| 17 class CommandBufferService; | 18 class CommandBufferService; |
| 18 class GpuScheduler; | 19 class GpuScheduler; |
| 19 class GpuControlService; | 20 class GpuControlService; |
| 20 namespace gles2 { | 21 namespace gles2 { |
| 21 class GLES2Decoder; | 22 class GLES2Decoder; |
| 22 class MailboxManager; | 23 class MailboxManager; |
| 23 } | 24 } |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace gfx { | 27 namespace gfx { |
| 27 class GLContext; | 28 class GLContext; |
| 28 class GLShareGroup; | 29 class GLShareGroup; |
| 29 class GLSurface; | 30 class GLSurface; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace mojo { | 33 namespace mojo { |
| 33 | 34 |
| 34 class CommandBufferImpl : public InterfaceImpl<CommandBuffer> { | 35 class CommandBufferImpl : public CommandBuffer { |
| 35 public: | 36 public: |
| 36 // Offscreen. | 37 // Offscreen. |
| 37 CommandBufferImpl(gfx::GLShareGroup* share_group, | 38 CommandBufferImpl(ScopedMessagePipeHandle handle, |
|
jamesr
2014/11/18 05:24:20
can these take InterfaceRequest<>s? you can bind t
| |
| 39 gfx::GLShareGroup* share_group, | |
| 38 gpu::gles2::MailboxManager* mailbox_manager); | 40 gpu::gles2::MailboxManager* mailbox_manager); |
| 39 // Onscreen. | 41 // Onscreen. |
| 40 CommandBufferImpl(gfx::AcceleratedWidget widget, | 42 CommandBufferImpl(ScopedMessagePipeHandle handle, |
| 43 gfx::AcceleratedWidget widget, | |
| 41 const gfx::Size& size, | 44 const gfx::Size& size, |
| 42 gfx::GLShareGroup* share_group, | 45 gfx::GLShareGroup* share_group, |
| 43 gpu::gles2::MailboxManager* mailbox_manager); | 46 gpu::gles2::MailboxManager* mailbox_manager); |
| 44 ~CommandBufferImpl() override; | 47 ~CommandBufferImpl() override; |
| 45 | 48 |
| 46 void Initialize(CommandBufferSyncClientPtr sync_client, | 49 void Initialize(CommandBufferSyncClientPtr sync_client, |
| 47 mojo::ScopedSharedBufferHandle shared_state) override; | 50 mojo::ScopedSharedBufferHandle shared_state) override; |
| 48 void SetGetBuffer(int32_t buffer) override; | 51 void SetGetBuffer(int32_t buffer) override; |
| 49 void Flush(int32_t put_offset) override; | 52 void Flush(int32_t put_offset) override; |
| 50 void MakeProgress(int32_t last_get_offset) override; | 53 void MakeProgress(int32_t last_get_offset) override; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 66 gfx::AcceleratedWidget widget_; | 69 gfx::AcceleratedWidget widget_; |
| 67 gfx::Size size_; | 70 gfx::Size size_; |
| 68 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 71 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
| 69 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 72 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
| 70 scoped_ptr<gpu::GpuScheduler> scheduler_; | 73 scoped_ptr<gpu::GpuScheduler> scheduler_; |
| 71 scoped_refptr<gfx::GLContext> context_; | 74 scoped_refptr<gfx::GLContext> context_; |
| 72 scoped_refptr<gfx::GLSurface> surface_; | 75 scoped_refptr<gfx::GLSurface> surface_; |
| 73 scoped_refptr<gfx::GLShareGroup> share_group_; | 76 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 74 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 77 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 75 | 78 |
| 79 StrongBinding<CommandBuffer> binding_; | |
| 80 | |
| 76 DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl); | 81 DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl); |
| 77 }; | 82 }; |
| 78 | 83 |
| 79 } // namespace mojo | 84 } // namespace mojo |
| 80 | 85 |
| 81 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ | 86 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ |
| OLD | NEW |