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

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

Issue 1231263003: Share SyncPointManager between ipc and in-process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove forward decl/includes 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_IMPL_H_ 5 #ifndef COMPONENTS_VIEW_MANAGER_GLES2_COMMAND_BUFFER_IMPL_H_
6 #define COMPONENTS_VIEW_MANAGER_GLES2_COMMAND_BUFFER_IMPL_H_ 6 #define COMPONENTS_VIEW_MANAGER_GLES2_COMMAND_BUFFER_IMPL_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "components/view_manager/public/interfaces/command_buffer.mojom.h" 10 #include "components/view_manager/public/interfaces/command_buffer.mojom.h"
11 #include "components/view_manager/public/interfaces/viewport_parameter_listener. mojom.h" 11 #include "components/view_manager/public/interfaces/viewport_parameter_listener. mojom.h"
12 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" 12 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
13 13
14 namespace gpu {
15 class SyncPointManager;
16 }
17
18 namespace gles2 { 14 namespace gles2 {
19 class CommandBufferDriver; 15 class CommandBufferDriver;
20 class CommandBufferImplObserver; 16 class CommandBufferImplObserver;
17 class GpuState;
21 18
22 // This class listens to the CommandBuffer message pipe on a low-latency thread 19 // This class listens to the CommandBuffer message pipe on a low-latency thread
23 // so that we can insert sync points without blocking on the GL driver. It 20 // so that we can insert sync points without blocking on the GL driver. It
24 // forwards most method calls to the CommandBufferDriver, which runs on the 21 // forwards most method calls to the CommandBufferDriver, which runs on the
25 // same thread as the native viewport. 22 // same thread as the native viewport.
26 class CommandBufferImpl : public mojo::CommandBuffer { 23 class CommandBufferImpl : public mojo::CommandBuffer {
27 public: 24 public:
28 CommandBufferImpl( 25 CommandBufferImpl(mojo::InterfaceRequest<CommandBuffer> request,
29 mojo::InterfaceRequest<CommandBuffer> request, 26 mojo::ViewportParameterListenerPtr listener,
30 mojo::ViewportParameterListenerPtr listener, 27 scoped_refptr<GpuState> gpu_state,
31 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner, 28 scoped_ptr<CommandBufferDriver> driver);
32 gpu::SyncPointManager* sync_point_manager,
33 scoped_ptr<CommandBufferDriver> driver);
34 29
35 // mojo::CommandBuffer: 30 // mojo::CommandBuffer:
36 void Initialize(mojo::CommandBufferSyncClientPtr sync_client, 31 void Initialize(mojo::CommandBufferSyncClientPtr sync_client,
37 mojo::CommandBufferSyncPointClientPtr sync_point_client, 32 mojo::CommandBufferSyncPointClientPtr sync_point_client,
38 mojo::CommandBufferLostContextObserverPtr loss_observer, 33 mojo::CommandBufferLostContextObserverPtr loss_observer,
39 mojo::ScopedSharedBufferHandle shared_state) override; 34 mojo::ScopedSharedBufferHandle shared_state) override;
40 void SetGetBuffer(int32_t buffer) override; 35 void SetGetBuffer(int32_t buffer) override;
41 void Flush(int32_t put_offset) override; 36 void Flush(int32_t put_offset) override;
42 void MakeProgress(int32_t last_get_offset) override; 37 void MakeProgress(int32_t last_get_offset) override;
43 void RegisterTransferBuffer(int32_t id, 38 void RegisterTransferBuffer(int32_t id,
(...skipping 24 matching lines...) Expand all
68 63
69 ~CommandBufferImpl() override; 64 ~CommandBufferImpl() override;
70 65
71 void BindToRequest(mojo::InterfaceRequest<CommandBuffer> request); 66 void BindToRequest(mojo::InterfaceRequest<CommandBuffer> request);
72 67
73 void UpdateVSyncParameters(base::TimeTicks timebase, 68 void UpdateVSyncParameters(base::TimeTicks timebase,
74 base::TimeDelta interval); 69 base::TimeDelta interval);
75 70
76 void OnConnectionError(); 71 void OnConnectionError();
77 72
78 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; 73 scoped_refptr<GpuState> gpu_state_;
79 scoped_refptr<base::SingleThreadTaskRunner> driver_task_runner_; 74 scoped_refptr<base::SingleThreadTaskRunner> driver_task_runner_;
80 scoped_ptr<CommandBufferDriver> driver_; 75 scoped_ptr<CommandBufferDriver> driver_;
81 mojo::CommandBufferSyncPointClientPtr sync_point_client_; 76 mojo::CommandBufferSyncPointClientPtr sync_point_client_;
82 mojo::ViewportParameterListenerPtr viewport_parameter_listener_; 77 mojo::ViewportParameterListenerPtr viewport_parameter_listener_;
83 mojo::Binding<CommandBuffer> binding_; 78 mojo::Binding<CommandBuffer> binding_;
84 CommandBufferImplObserver* observer_; 79 CommandBufferImplObserver* observer_;
85 80
86 DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl); 81 DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl);
87 }; 82 };
88 83
89 } // namespace gles2 84 } // namespace gles2
90 85
91 #endif // COMPONENTS_VIEW_MANAGER_GLES2_COMMAND_BUFFER_IMPL_H_ 86 #endif // COMPONENTS_VIEW_MANAGER_GLES2_COMMAND_BUFFER_IMPL_H_
OLDNEW
« no previous file with comments | « components/view_manager/gles2/command_buffer_driver.cc ('k') | components/view_manager/gles2/command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698