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" |
(...skipping 23 matching lines...) Expand all Loading... |
34 class CommandBufferImpl : public InterfaceImpl<CommandBuffer> { | 34 class CommandBufferImpl : public InterfaceImpl<CommandBuffer> { |
35 public: | 35 public: |
36 // Offscreen. | 36 // Offscreen. |
37 CommandBufferImpl(gfx::GLShareGroup* share_group, | 37 CommandBufferImpl(gfx::GLShareGroup* share_group, |
38 gpu::gles2::MailboxManager* mailbox_manager); | 38 gpu::gles2::MailboxManager* mailbox_manager); |
39 // Onscreen. | 39 // Onscreen. |
40 CommandBufferImpl(gfx::AcceleratedWidget widget, | 40 CommandBufferImpl(gfx::AcceleratedWidget widget, |
41 const gfx::Size& size, | 41 const gfx::Size& size, |
42 gfx::GLShareGroup* share_group, | 42 gfx::GLShareGroup* share_group, |
43 gpu::gles2::MailboxManager* mailbox_manager); | 43 gpu::gles2::MailboxManager* mailbox_manager); |
44 virtual ~CommandBufferImpl(); | 44 ~CommandBufferImpl() override; |
45 | 45 |
46 virtual void Initialize(CommandBufferSyncClientPtr sync_client, | 46 void Initialize(CommandBufferSyncClientPtr sync_client, |
47 mojo::ScopedSharedBufferHandle shared_state) override; | 47 mojo::ScopedSharedBufferHandle shared_state) override; |
48 virtual void SetGetBuffer(int32_t buffer) override; | 48 void SetGetBuffer(int32_t buffer) override; |
49 virtual void Flush(int32_t put_offset) override; | 49 void Flush(int32_t put_offset) override; |
50 virtual void MakeProgress(int32_t last_get_offset) override; | 50 void MakeProgress(int32_t last_get_offset) override; |
51 virtual void RegisterTransferBuffer( | 51 void RegisterTransferBuffer(int32_t id, |
52 int32_t id, | 52 mojo::ScopedSharedBufferHandle transfer_buffer, |
53 mojo::ScopedSharedBufferHandle transfer_buffer, | 53 uint32_t size) override; |
54 uint32_t size) override; | 54 void DestroyTransferBuffer(int32_t id) override; |
55 virtual void DestroyTransferBuffer(int32_t id) override; | 55 void Echo(const Callback<void()>& callback) override; |
56 virtual void Echo(const Callback<void()>& callback) override; | |
57 | 56 |
58 private: | 57 private: |
59 bool DoInitialize(mojo::ScopedSharedBufferHandle shared_state); | 58 bool DoInitialize(mojo::ScopedSharedBufferHandle shared_state); |
60 | 59 |
61 void OnResize(gfx::Size size, float scale_factor); | 60 void OnResize(gfx::Size size, float scale_factor); |
62 | 61 |
63 void OnParseError(); | 62 void OnParseError(); |
64 | 63 |
65 CommandBufferSyncClientPtr sync_client_; | 64 CommandBufferSyncClientPtr sync_client_; |
66 | 65 |
67 gfx::AcceleratedWidget widget_; | 66 gfx::AcceleratedWidget widget_; |
68 gfx::Size size_; | 67 gfx::Size size_; |
69 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 68 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
70 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 69 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
71 scoped_ptr<gpu::GpuScheduler> scheduler_; | 70 scoped_ptr<gpu::GpuScheduler> scheduler_; |
72 scoped_refptr<gfx::GLContext> context_; | 71 scoped_refptr<gfx::GLContext> context_; |
73 scoped_refptr<gfx::GLSurface> surface_; | 72 scoped_refptr<gfx::GLSurface> surface_; |
74 scoped_refptr<gfx::GLShareGroup> share_group_; | 73 scoped_refptr<gfx::GLShareGroup> share_group_; |
75 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 74 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
76 | 75 |
77 DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl); | 76 DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl); |
78 }; | 77 }; |
79 | 78 |
80 } // namespace mojo | 79 } // namespace mojo |
81 | 80 |
82 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ | 81 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_ |
OLD | NEW |