| 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 SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ | 5 #ifndef SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ |
| 6 #define SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ | 6 #define SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 virtual void UpdateVSyncParameters(base::TimeTicks timebase, | 41 virtual void UpdateVSyncParameters(base::TimeTicks timebase, |
| 42 base::TimeDelta interval) = 0; | 42 base::TimeDelta interval) = 0; |
| 43 virtual void DidLoseContext() = 0; | 43 virtual void DidLoseContext() = 0; |
| 44 }; | 44 }; |
| 45 // Offscreen. | 45 // Offscreen. |
| 46 CommandBufferDriver(gfx::GLShareGroup* share_group, | 46 CommandBufferDriver(gfx::GLShareGroup* share_group, |
| 47 gpu::gles2::MailboxManager* mailbox_manager, | 47 gpu::gles2::MailboxManager* mailbox_manager, |
| 48 gpu::SyncPointManager* sync_point_manager); | 48 gpu::SyncPointManager* sync_point_manager); |
| 49 // Onscreen. | 49 // Onscreen. |
| 50 CommandBufferDriver(gfx::AcceleratedWidget widget, | 50 CommandBufferDriver(gfx::AcceleratedWidget widget, |
| 51 const gfx::Size& size, | |
| 52 gfx::GLShareGroup* share_group, | 51 gfx::GLShareGroup* share_group, |
| 53 gpu::gles2::MailboxManager* mailbox_manager, | 52 gpu::gles2::MailboxManager* mailbox_manager, |
| 54 gpu::SyncPointManager* sync_point_manager); | 53 gpu::SyncPointManager* sync_point_manager); |
| 55 ~CommandBufferDriver(); | 54 ~CommandBufferDriver(); |
| 56 | 55 |
| 57 void set_client(scoped_ptr<Client> client) { client_ = client.Pass(); } | 56 void set_client(scoped_ptr<Client> client) { client_ = client.Pass(); } |
| 58 | 57 |
| 59 void Initialize(mojo::CommandBufferSyncClientPtr sync_client, | 58 void Initialize(mojo::CommandBufferSyncClientPtr sync_client, |
| 60 mojo::CommandBufferLostContextObserverPtr loss_observer, | 59 mojo::CommandBufferLostContextObserverPtr loss_observer, |
| 61 mojo::ScopedSharedBufferHandle shared_state); | 60 mojo::ScopedSharedBufferHandle shared_state); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 75 void OnSyncPointRetired(); | 74 void OnSyncPointRetired(); |
| 76 void OnParseError(); | 75 void OnParseError(); |
| 77 void OnContextLost(uint32_t reason); | 76 void OnContextLost(uint32_t reason); |
| 78 void OnUpdateVSyncParameters(const base::TimeTicks timebase, | 77 void OnUpdateVSyncParameters(const base::TimeTicks timebase, |
| 79 const base::TimeDelta interval); | 78 const base::TimeDelta interval); |
| 80 | 79 |
| 81 scoped_ptr<Client> client_; | 80 scoped_ptr<Client> client_; |
| 82 mojo::CommandBufferSyncClientPtr sync_client_; | 81 mojo::CommandBufferSyncClientPtr sync_client_; |
| 83 mojo::CommandBufferLostContextObserverPtr loss_observer_; | 82 mojo::CommandBufferLostContextObserverPtr loss_observer_; |
| 84 gfx::AcceleratedWidget widget_; | 83 gfx::AcceleratedWidget widget_; |
| 85 gfx::Size size_; | |
| 86 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 84 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
| 87 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 85 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
| 88 scoped_ptr<gpu::GpuScheduler> scheduler_; | 86 scoped_ptr<gpu::GpuScheduler> scheduler_; |
| 89 scoped_refptr<gfx::GLContext> context_; | 87 scoped_refptr<gfx::GLContext> context_; |
| 90 scoped_refptr<gfx::GLSurface> surface_; | 88 scoped_refptr<gfx::GLSurface> surface_; |
| 91 scoped_refptr<gfx::GLShareGroup> share_group_; | 89 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 92 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 90 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 93 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; | 91 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; |
| 94 | 92 |
| 95 scoped_refptr<base::SingleThreadTaskRunner> context_lost_task_runner_; | 93 scoped_refptr<base::SingleThreadTaskRunner> context_lost_task_runner_; |
| 96 base::Callback<void(int32_t)> context_lost_callback_; | 94 base::Callback<void(int32_t)> context_lost_callback_; |
| 97 | 95 |
| 98 base::WeakPtrFactory<CommandBufferDriver> weak_factory_; | 96 base::WeakPtrFactory<CommandBufferDriver> weak_factory_; |
| 99 | 97 |
| 100 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver); | 98 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver); |
| 101 }; | 99 }; |
| 102 | 100 |
| 103 } // namespace gles2 | 101 } // namespace gles2 |
| 104 | 102 |
| 105 #endif // SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ | 103 #endif // SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ |
| OLD | NEW |