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 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" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
| 13 #include "mojo/services/gpu/public/interfaces/command_buffer.mojom.h" | 13 #include "mojo/services/gpu/public/interfaces/command_buffer.mojom.h" |
| 14 #include "mojo/services/native_viewport/public/interfaces/native_viewport.mojom. h" | |
| 14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 15 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
| 17 #include "ui/gl/gl_surface.h" | |
| 16 | 18 |
| 17 namespace gpu { | 19 namespace gpu { |
| 18 class CommandBufferService; | 20 class CommandBufferService; |
| 19 class GpuScheduler; | 21 class GpuScheduler; |
| 20 class GpuControlService; | 22 class GpuControlService; |
| 21 class SyncPointManager; | 23 class SyncPointManager; |
| 22 namespace gles2 { | 24 namespace gles2 { |
| 23 class GLES2Decoder; | 25 class GLES2Decoder; |
| 24 class MailboxManager; | 26 class MailboxManager; |
| 25 } | 27 } |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 38 class Client { | 40 class Client { |
| 39 public: | 41 public: |
| 40 virtual ~Client(); | 42 virtual ~Client(); |
| 41 virtual void UpdateVSyncParameters(base::TimeTicks timebase, | 43 virtual void UpdateVSyncParameters(base::TimeTicks timebase, |
| 42 base::TimeDelta interval) = 0; | 44 base::TimeDelta interval) = 0; |
| 43 virtual void DidLoseContext() = 0; | 45 virtual void DidLoseContext() = 0; |
| 44 }; | 46 }; |
| 45 // Offscreen. | 47 // Offscreen. |
| 46 CommandBufferDriver(gfx::GLShareGroup* share_group, | 48 CommandBufferDriver(gfx::GLShareGroup* share_group, |
| 47 gpu::gles2::MailboxManager* mailbox_manager, | 49 gpu::gles2::MailboxManager* mailbox_manager, |
| 48 gpu::SyncPointManager* sync_point_manager); | 50 gpu::SyncPointManager* sync_point_manager, |
| 51 gfx::SurfaceConfiguration requested_configuration); | |
|
abarth-chromium
2015/06/09 00:30:21
gfx::SurfaceConfiguration -> const gfx::SurfaceCon
iansf
2015/06/09 01:52:04
Done.
| |
| 49 // Onscreen. | 52 // Onscreen. |
| 50 CommandBufferDriver(gfx::AcceleratedWidget widget, | 53 CommandBufferDriver(gfx::AcceleratedWidget widget, |
| 51 gfx::GLShareGroup* share_group, | 54 gfx::GLShareGroup* share_group, |
| 52 gpu::gles2::MailboxManager* mailbox_manager, | 55 gpu::gles2::MailboxManager* mailbox_manager, |
| 53 gpu::SyncPointManager* sync_point_manager); | 56 gpu::SyncPointManager* sync_point_manager, |
| 57 gfx::SurfaceConfiguration requested_configuration); | |
|
abarth-chromium
2015/06/09 00:30:21
gfx::SurfaceConfiguration -> const gfx::SurfaceCon
iansf
2015/06/09 01:52:04
Done.
| |
| 54 ~CommandBufferDriver(); | 58 ~CommandBufferDriver(); |
| 55 | 59 |
| 56 void set_client(scoped_ptr<Client> client) { client_ = client.Pass(); } | 60 void set_client(scoped_ptr<Client> client) { client_ = client.Pass(); } |
| 57 | 61 |
| 58 void Initialize(mojo::CommandBufferSyncClientPtr sync_client, | 62 void Initialize(mojo::CommandBufferSyncClientPtr sync_client, |
| 59 mojo::CommandBufferLostContextObserverPtr loss_observer, | 63 mojo::CommandBufferLostContextObserverPtr loss_observer, |
| 60 mojo::ScopedSharedBufferHandle shared_state); | 64 mojo::ScopedSharedBufferHandle shared_state); |
| 61 void SetGetBuffer(int32_t buffer); | 65 void SetGetBuffer(int32_t buffer); |
| 62 void Flush(int32_t put_offset); | 66 void Flush(int32_t put_offset); |
| 63 void MakeProgress(int32_t last_get_offset); | 67 void MakeProgress(int32_t last_get_offset); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 82 mojo::CommandBufferLostContextObserverPtr loss_observer_; | 86 mojo::CommandBufferLostContextObserverPtr loss_observer_; |
| 83 gfx::AcceleratedWidget widget_; | 87 gfx::AcceleratedWidget widget_; |
| 84 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 88 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
| 85 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 89 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
| 86 scoped_ptr<gpu::GpuScheduler> scheduler_; | 90 scoped_ptr<gpu::GpuScheduler> scheduler_; |
| 87 scoped_refptr<gfx::GLContext> context_; | 91 scoped_refptr<gfx::GLContext> context_; |
| 88 scoped_refptr<gfx::GLSurface> surface_; | 92 scoped_refptr<gfx::GLSurface> surface_; |
| 89 scoped_refptr<gfx::GLShareGroup> share_group_; | 93 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 90 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 94 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 91 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; | 95 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; |
| 96 gfx::SurfaceConfiguration requested_configuration_; | |
| 92 | 97 |
| 93 scoped_refptr<base::SingleThreadTaskRunner> context_lost_task_runner_; | 98 scoped_refptr<base::SingleThreadTaskRunner> context_lost_task_runner_; |
| 94 base::Callback<void(int32_t)> context_lost_callback_; | 99 base::Callback<void(int32_t)> context_lost_callback_; |
| 95 | 100 |
| 96 base::WeakPtrFactory<CommandBufferDriver> weak_factory_; | 101 base::WeakPtrFactory<CommandBufferDriver> weak_factory_; |
| 97 | 102 |
| 98 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver); | 103 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver); |
| 99 }; | 104 }; |
| 100 | 105 |
| 101 } // namespace gles2 | 106 } // namespace gles2 |
| 102 | 107 |
| 103 #endif // SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ | 108 #endif // SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ |
| OLD | NEW |