Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: components/view_manager/gles2/command_buffer_driver.h

Issue 1231263003: Share SyncPointManager between ipc and in-process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mandoline Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 COMPONENTS_VIEW_MANAGER_GLES2_COMMAND_BUFFER_DRIVER_H_ 5 #ifndef COMPONENTS_VIEW_MANAGER_GLES2_COMMAND_BUFFER_DRIVER_H_
6 #define COMPONENTS_VIEW_MANAGER_GLES2_COMMAND_BUFFER_DRIVER_H_ 6 #define COMPONENTS_VIEW_MANAGER_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/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "base/timer/timer.h" 13 #include "base/timer/timer.h"
14 #include "components/view_manager/public/interfaces/command_buffer.mojom.h" 14 #include "components/view_manager/public/interfaces/command_buffer.mojom.h"
15 #include "ui/gfx/geometry/size.h" 15 #include "ui/gfx/geometry/size.h"
16 #include "ui/gfx/native_widget_types.h" 16 #include "ui/gfx/native_widget_types.h"
17 17
18 namespace gpu { 18 namespace gpu {
19 class CommandBufferService; 19 class CommandBufferService;
20 class GpuScheduler; 20 class GpuScheduler;
21 class GpuControlService; 21 class GpuControlService;
22 class SyncPointManager; 22 class SyncPointManager;
msw 2015/07/21 17:53:01 nit: remove this.
23 namespace gles2 { 23 namespace gles2 {
24 class GLES2Decoder; 24 class GLES2Decoder;
25 class MailboxManager; 25 class MailboxManager;
msw 2015/07/21 17:53:01 nit: remove this.
26 } 26 }
27 } 27 }
28 28
29 namespace gfx { 29 namespace gfx {
30 class GLContext; 30 class GLContext;
31 class GLShareGroup; 31 class GLShareGroup;
msw 2015/07/21 17:53:01 nit: remove this.
32 class GLSurface; 32 class GLSurface;
33 } 33 }
34 34
35 namespace gles2 { 35 namespace gles2 {
36 class GpuState;
msw 2015/07/21 17:53:01 nit: blank line above?
36 37
37 // This class receives CommandBuffer messages on the same thread as the native 38 // This class receives CommandBuffer messages on the same thread as the native
38 // viewport. 39 // viewport.
39 class CommandBufferDriver { 40 class CommandBufferDriver {
40 public: 41 public:
41 class Client { 42 class Client {
42 public: 43 public:
43 virtual ~Client(); 44 virtual ~Client();
44 virtual void UpdateVSyncParameters(base::TimeTicks timebase, 45 virtual void UpdateVSyncParameters(base::TimeTicks timebase,
45 base::TimeDelta interval) = 0; 46 base::TimeDelta interval) = 0;
46 virtual void DidLoseContext() = 0; 47 virtual void DidLoseContext() = 0;
47 }; 48 };
48 // Offscreen. 49 // Offscreen.
49 CommandBufferDriver(gfx::GLShareGroup* share_group, 50 explicit CommandBufferDriver(scoped_refptr<GpuState> gpu_state);
50 gpu::gles2::MailboxManager* mailbox_manager, 51
51 gpu::SyncPointManager* sync_point_manager);
52 // Onscreen. 52 // Onscreen.
53 CommandBufferDriver( 53 CommandBufferDriver(
54 gfx::AcceleratedWidget widget, 54 gfx::AcceleratedWidget widget,
55 gfx::GLShareGroup* share_group, 55 scoped_refptr<GpuState> gpu_state,
56 gpu::gles2::MailboxManager* mailbox_manager,
57 gpu::SyncPointManager* sync_point_manager,
58 const base::Callback<void(CommandBufferDriver*)>& destruct_callback); 56 const base::Callback<void(CommandBufferDriver*)>& destruct_callback);
59 ~CommandBufferDriver(); 57 ~CommandBufferDriver();
60 58
61 void set_client(scoped_ptr<Client> client) { client_ = client.Pass(); } 59 void set_client(scoped_ptr<Client> client) { client_ = client.Pass(); }
62 60
63 void Initialize(mojo::CommandBufferSyncClientPtr sync_client, 61 void Initialize(mojo::CommandBufferSyncClientPtr sync_client,
64 mojo::CommandBufferLostContextObserverPtr loss_observer, 62 mojo::CommandBufferLostContextObserverPtr loss_observer,
65 mojo::ScopedSharedBufferHandle shared_state); 63 mojo::ScopedSharedBufferHandle shared_state);
66 void SetGetBuffer(int32_t buffer); 64 void SetGetBuffer(int32_t buffer);
67 void Flush(int32_t put_offset); 65 void Flush(int32_t put_offset);
(...skipping 29 matching lines...) Expand all
97 95
98 scoped_ptr<Client> client_; 96 scoped_ptr<Client> client_;
99 mojo::CommandBufferSyncClientPtr sync_client_; 97 mojo::CommandBufferSyncClientPtr sync_client_;
100 mojo::CommandBufferLostContextObserverPtr loss_observer_; 98 mojo::CommandBufferLostContextObserverPtr loss_observer_;
101 gfx::AcceleratedWidget widget_; 99 gfx::AcceleratedWidget widget_;
102 scoped_ptr<gpu::CommandBufferService> command_buffer_; 100 scoped_ptr<gpu::CommandBufferService> command_buffer_;
103 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; 101 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_;
104 scoped_ptr<gpu::GpuScheduler> scheduler_; 102 scoped_ptr<gpu::GpuScheduler> scheduler_;
105 scoped_refptr<gfx::GLContext> context_; 103 scoped_refptr<gfx::GLContext> context_;
106 scoped_refptr<gfx::GLSurface> surface_; 104 scoped_refptr<gfx::GLSurface> surface_;
107 scoped_refptr<gfx::GLShareGroup> share_group_; 105 scoped_refptr<GpuState> gpu_state_;
108 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_;
109 scoped_refptr<gpu::SyncPointManager> sync_point_manager_;
110 106
111 scoped_refptr<base::SingleThreadTaskRunner> context_lost_task_runner_; 107 scoped_refptr<base::SingleThreadTaskRunner> context_lost_task_runner_;
112 base::Callback<void(int32_t)> context_lost_callback_; 108 base::Callback<void(int32_t)> context_lost_callback_;
113 109
114 base::Callback<void(CommandBufferDriver*)> destruct_callback_; 110 base::Callback<void(CommandBufferDriver*)> destruct_callback_;
115 111
116 base::WeakPtrFactory<CommandBufferDriver> weak_factory_; 112 base::WeakPtrFactory<CommandBufferDriver> weak_factory_;
117 113
118 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver); 114 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver);
119 }; 115 };
120 116
121 } // namespace gles2 117 } // namespace gles2
122 118
123 #endif // COMPONENTS_GLES2_COMMAND_BUFFER_DRIVER_H_ 119 #endif // COMPONENTS_GLES2_COMMAND_BUFFER_DRIVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698