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

Side by Side Diff: mojo/services/gles2/command_buffer_driver.h

Issue 739493002: Introduce command buffer control thread (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Route echo better Created 6 years, 1 month 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
« no previous file with comments | « mojo/public/cpp/bindings/strong_binding.h ('k') | mojo/services/gles2/command_buffer_driver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 MOJO_SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ 5 #ifndef MOJO_SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_
6 #define MOJO_SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ 6 #define MOJO_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/timer/timer.h" 12 #include "base/timer/timer.h"
12 #include "mojo/services/public/interfaces/gpu/command_buffer.mojom.h" 13 #include "mojo/services/public/interfaces/gpu/command_buffer.mojom.h"
13 #include "ui/gfx/native_widget_types.h" 14 #include "ui/gfx/native_widget_types.h"
14 #include "ui/gfx/size.h" 15 #include "ui/gfx/size.h"
15 16
16 namespace gpu { 17 namespace gpu {
17 class CommandBufferService; 18 class CommandBufferService;
18 class GpuScheduler; 19 class GpuScheduler;
19 class GpuControlService; 20 class GpuControlService;
20 namespace gles2 { 21 namespace gles2 {
(...skipping 24 matching lines...) Expand all
45 46
46 void Initialize(CommandBufferSyncClientPtr sync_client, 47 void Initialize(CommandBufferSyncClientPtr sync_client,
47 ScopedSharedBufferHandle shared_state); 48 ScopedSharedBufferHandle shared_state);
48 void SetGetBuffer(int32_t buffer); 49 void SetGetBuffer(int32_t buffer);
49 void Flush(int32_t put_offset); 50 void Flush(int32_t put_offset);
50 void MakeProgress(int32_t last_get_offset); 51 void MakeProgress(int32_t last_get_offset);
51 void RegisterTransferBuffer(int32_t id, 52 void RegisterTransferBuffer(int32_t id,
52 ScopedSharedBufferHandle transfer_buffer, 53 ScopedSharedBufferHandle transfer_buffer,
53 uint32_t size); 54 uint32_t size);
54 void DestroyTransferBuffer(int32_t id); 55 void DestroyTransferBuffer(int32_t id);
56 void Echo(const Callback<void()>& callback);
55 57
56 void SetContextLostCallback(const base::Callback<void(int32_t)>& callback); 58 void SetContextLostCallback(
59 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
60 const base::Callback<void(int32_t)>& callback);
57 61
58 private: 62 private:
59 bool DoInitialize(ScopedSharedBufferHandle shared_state); 63 bool DoInitialize(ScopedSharedBufferHandle shared_state);
60 void OnResize(gfx::Size size, float scale_factor); 64 void OnResize(gfx::Size size, float scale_factor);
61 void OnParseError(); 65 void OnParseError();
62 void OnContextLost(uint32_t reason); 66 void OnContextLost(uint32_t reason);
63 67
64 CommandBufferSyncClientPtr sync_client_; 68 CommandBufferSyncClientPtr sync_client_;
65 69
66 gfx::AcceleratedWidget widget_; 70 gfx::AcceleratedWidget widget_;
67 gfx::Size size_; 71 gfx::Size size_;
68 scoped_ptr<gpu::CommandBufferService> command_buffer_; 72 scoped_ptr<gpu::CommandBufferService> command_buffer_;
69 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; 73 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_;
70 scoped_ptr<gpu::GpuScheduler> scheduler_; 74 scoped_ptr<gpu::GpuScheduler> scheduler_;
71 scoped_refptr<gfx::GLContext> context_; 75 scoped_refptr<gfx::GLContext> context_;
72 scoped_refptr<gfx::GLSurface> surface_; 76 scoped_refptr<gfx::GLSurface> surface_;
73 scoped_refptr<gfx::GLShareGroup> share_group_; 77 scoped_refptr<gfx::GLShareGroup> share_group_;
74 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; 78 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_;
79
80 scoped_refptr<base::SingleThreadTaskRunner> context_lost_task_runner_;
75 base::Callback<void(int32_t)> context_lost_callback_; 81 base::Callback<void(int32_t)> context_lost_callback_;
76 82
77 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver); 83 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver);
78 }; 84 };
79 85
80 } // namespace mojo 86 } // namespace mojo
81 87
82 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_ 88 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_DRIVER_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/strong_binding.h ('k') | mojo/services/gles2/command_buffer_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698