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

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

Issue 1460833002: gpu: Implement the new fence syncs in mojo command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 5 years 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 | « no previous file | components/mus/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 COMPONENTS_MUS_GLES2_COMMAND_BUFFER_DRIVER_H_ 5 #ifndef COMPONENTS_MUS_GLES2_COMMAND_BUFFER_DRIVER_H_
6 #define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_DRIVER_H_ 6 #define COMPONENTS_MUS_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/mus/public/interfaces/command_buffer.mojom.h" 14 #include "components/mus/public/interfaces/command_buffer.mojom.h"
15 #include "gpu/command_buffer/common/constants.h" 15 #include "gpu/command_buffer/common/constants.h"
16 #include "ui/gfx/geometry/size.h" 16 #include "ui/gfx/geometry/size.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 SyncPointClient;
23 class SyncPointOrderData;
22 namespace gles2 { 24 namespace gles2 {
23 class GLES2Decoder; 25 class GLES2Decoder;
24 } 26 }
25 } 27 }
26 28
27 namespace gfx { 29 namespace gfx {
28 class GLContext; 30 class GLContext;
29 class GLSurface; 31 class GLSurface;
30 } 32 }
31 33
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 void DestroyTransferBuffer(int32_t id); 65 void DestroyTransferBuffer(int32_t id);
64 void CreateImage(int32_t id, 66 void CreateImage(int32_t id,
65 mojo::ScopedHandle memory_handle, 67 mojo::ScopedHandle memory_handle,
66 int32_t type, 68 int32_t type,
67 mojo::SizePtr size, 69 mojo::SizePtr size,
68 int32_t format, 70 int32_t format,
69 int32_t internal_format); 71 int32_t internal_format);
70 void DestroyImage(int32_t id); 72 void DestroyImage(int32_t id);
71 bool IsScheduled() const; 73 bool IsScheduled() const;
72 bool HasUnprocessedCommands() const; 74 bool HasUnprocessedCommands() const;
75 gpu::SyncPointOrderData* sync_point_order_data() {
76 return sync_point_order_data_.get();
77 }
73 78
74 private: 79 private:
75 bool MakeCurrent(); 80 bool MakeCurrent();
76 bool DoInitialize(mojo::ScopedSharedBufferHandle shared_state, 81 bool DoInitialize(mojo::ScopedSharedBufferHandle shared_state,
77 mojo::Array<int32_t> attribs); 82 mojo::Array<int32_t> attribs);
78 bool OnWaitSyncPoint(uint32_t sync_point); 83 bool OnWaitSyncPoint(uint32_t sync_point);
79 void OnFenceSyncRelease(uint64_t release); 84 void OnFenceSyncRelease(uint64_t release);
80 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id, 85 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id,
81 uint64_t command_buffer_id, 86 uint64_t command_buffer_id,
82 uint64_t release); 87 uint64_t release);
83 void OnSyncPointRetired(); 88 void OnSyncPointRetired();
84 void OnParseError(); 89 void OnParseError();
85 void OnContextLost(uint32_t reason); 90 void OnContextLost(uint32_t reason);
86 void DestroyDecoder(); 91 void DestroyDecoder();
87 92
93 const uint64_t command_buffer_id_;
88 scoped_ptr<Client> client_; 94 scoped_ptr<Client> client_;
89 mojom::CommandBufferSyncClientPtr sync_client_; 95 mojom::CommandBufferSyncClientPtr sync_client_;
90 mojom::CommandBufferLostContextObserverPtr loss_observer_; 96 mojom::CommandBufferLostContextObserverPtr loss_observer_;
91 scoped_ptr<gpu::CommandBufferService> command_buffer_; 97 scoped_ptr<gpu::CommandBufferService> command_buffer_;
92 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; 98 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_;
93 scoped_ptr<gpu::GpuScheduler> scheduler_; 99 scoped_ptr<gpu::GpuScheduler> scheduler_;
100 scoped_refptr<gpu::SyncPointOrderData> sync_point_order_data_;
101 scoped_ptr<gpu::SyncPointClient> sync_point_client_;
94 scoped_refptr<gfx::GLContext> context_; 102 scoped_refptr<gfx::GLContext> context_;
95 scoped_refptr<gfx::GLSurface> surface_; 103 scoped_refptr<gfx::GLSurface> surface_;
96 scoped_refptr<GpuState> gpu_state_; 104 scoped_refptr<GpuState> gpu_state_;
97 105
98 scoped_refptr<base::SingleThreadTaskRunner> context_lost_task_runner_; 106 scoped_refptr<base::SingleThreadTaskRunner> context_lost_task_runner_;
99 base::Callback<void(int32_t)> context_lost_callback_; 107 base::Callback<void(int32_t)> context_lost_callback_;
100 108
101 base::WeakPtrFactory<CommandBufferDriver> weak_factory_; 109 base::WeakPtrFactory<CommandBufferDriver> weak_factory_;
102 110
103 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver); 111 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver);
104 }; 112 };
105 113
106 } // namespace mus 114 } // namespace mus
107 115
108 #endif // COMPONENTS_GLES2_COMMAND_BUFFER_DRIVER_H_ 116 #endif // COMPONENTS_GLES2_COMMAND_BUFFER_DRIVER_H_
OLDNEW
« no previous file with comments | « no previous file | components/mus/gles2/command_buffer_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698