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

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

Issue 1885903002: Revert of Make lost context and error message callbacks on GpuControl go to client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « cc/test/test_context_provider.cc ('k') | components/mus/gles2/command_buffer_local.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_LOCAL_H_ 5 #ifndef COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_
6 #define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ 6 #define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 17 matching lines...) Expand all
28 namespace { 28 namespace {
29 class WaitableEvent; 29 class WaitableEvent;
30 } 30 }
31 31
32 namespace gfx { 32 namespace gfx {
33 class GLContext; 33 class GLContext;
34 class GLSurface; 34 class GLSurface;
35 } 35 }
36 36
37 namespace gpu { 37 namespace gpu {
38 class GpuControlClient;
39 class SyncPointClient; 38 class SyncPointClient;
40 } 39 }
41 40
42 namespace mus { 41 namespace mus {
43 42
44 class CommandBufferDriver; 43 class CommandBufferDriver;
45 class CommandBufferLocalClient; 44 class CommandBufferLocalClient;
46 class GpuState; 45 class GpuState;
47 46
48 // This class provides a wrapper around a CommandBufferDriver and a GpuControl 47 // This class provides a wrapper around a CommandBufferDriver and a GpuControl
(...skipping 19 matching lines...) Expand all
68 void Flush(int32_t put_offset) override; 67 void Flush(int32_t put_offset) override;
69 void OrderingBarrier(int32_t put_offset) override; 68 void OrderingBarrier(int32_t put_offset) override;
70 void WaitForTokenInRange(int32_t start, int32_t end) override; 69 void WaitForTokenInRange(int32_t start, int32_t end) override;
71 void WaitForGetOffsetInRange(int32_t start, int32_t end) override; 70 void WaitForGetOffsetInRange(int32_t start, int32_t end) override;
72 void SetGetBuffer(int32_t buffer) override; 71 void SetGetBuffer(int32_t buffer) override;
73 scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, 72 scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size,
74 int32_t* id) override; 73 int32_t* id) override;
75 void DestroyTransferBuffer(int32_t id) override; 74 void DestroyTransferBuffer(int32_t id) override;
76 75
77 // gpu::GpuControl implementation: 76 // gpu::GpuControl implementation:
78 void SetGpuControlClient(gpu::GpuControlClient*) override;
79 gpu::Capabilities GetCapabilities() override; 77 gpu::Capabilities GetCapabilities() override;
80 int32_t CreateImage(ClientBuffer buffer, 78 int32_t CreateImage(ClientBuffer buffer,
81 size_t width, 79 size_t width,
82 size_t height, 80 size_t height,
83 unsigned internalformat) override; 81 unsigned internalformat) override;
84 void DestroyImage(int32_t id) override; 82 void DestroyImage(int32_t id) override;
85 int32_t CreateGpuMemoryBufferImage(size_t width, 83 int32_t CreateGpuMemoryBufferImage(size_t width,
86 size_t height, 84 size_t height,
87 unsigned internal_format, 85 unsigned internal_format,
88 unsigned usage) override; 86 unsigned usage) override;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void UpdateVSyncParametersOnClientThread(int64_t timebase, int64_t interval); 137 void UpdateVSyncParametersOnClientThread(int64_t timebase, int64_t interval);
140 void OnGpuCompletedSwapBuffersOnClientThread(gfx::SwapResult result); 138 void OnGpuCompletedSwapBuffersOnClientThread(gfx::SwapResult result);
141 139
142 gfx::AcceleratedWidget widget_; 140 gfx::AcceleratedWidget widget_;
143 scoped_refptr<GpuState> gpu_state_; 141 scoped_refptr<GpuState> gpu_state_;
144 scoped_ptr<CommandBufferDriver> driver_; 142 scoped_ptr<CommandBufferDriver> driver_;
145 CommandBufferLocalClient* client_; 143 CommandBufferLocalClient* client_;
146 scoped_refptr<base::SingleThreadTaskRunner> client_thread_task_runner_; 144 scoped_refptr<base::SingleThreadTaskRunner> client_thread_task_runner_;
147 145
148 // Members accessed on the client thread: 146 // Members accessed on the client thread:
149 gpu::GpuControlClient* gpu_control_client_;
150 gpu::CommandBuffer::State last_state_; 147 gpu::CommandBuffer::State last_state_;
151 mojo::ScopedSharedBufferHandle shared_state_handle_; 148 mojo::ScopedSharedBufferHandle shared_state_handle_;
152 gpu::CommandBufferSharedState* shared_state_; 149 gpu::CommandBufferSharedState* shared_state_;
153 int32_t last_put_offset_; 150 int32_t last_put_offset_;
154 gpu::Capabilities capabilities_; 151 gpu::Capabilities capabilities_;
155 int32_t next_transfer_buffer_id_; 152 int32_t next_transfer_buffer_id_;
156 int32_t next_image_id_; 153 int32_t next_image_id_;
157 uint64_t next_fence_sync_release_; 154 uint64_t next_fence_sync_release_;
158 uint64_t flushed_fence_sync_release_; 155 uint64_t flushed_fence_sync_release_;
159 bool lost_context_;
160 156
161 // This sync point client is only for out of order Wait on client thread. 157 // This sync point client is only for out of order Wait on client thread.
162 scoped_ptr<gpu::SyncPointClient> sync_point_client_waiter_; 158 scoped_ptr<gpu::SyncPointClient> sync_point_client_waiter_;
163 159
164 base::WeakPtr<CommandBufferLocal> weak_ptr_; 160 base::WeakPtr<CommandBufferLocal> weak_ptr_;
165 161
166 // This weak factory will be invalidated in the client thread, so all weak 162 // This weak factory will be invalidated in the client thread, so all weak
167 // pointers have to be dereferenced in the client thread too. 163 // pointers have to be dereferenced in the client thread too.
168 base::WeakPtrFactory<CommandBufferLocal> weak_factory_; 164 base::WeakPtrFactory<CommandBufferLocal> weak_factory_;
169 165
170 DISALLOW_COPY_AND_ASSIGN(CommandBufferLocal); 166 DISALLOW_COPY_AND_ASSIGN(CommandBufferLocal);
171 }; 167 };
172 168
173 } // namespace mus 169 } // namespace mus
174 170
175 #endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ 171 #endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_
OLDNEW
« no previous file with comments | « cc/test/test_context_provider.cc ('k') | components/mus/gles2/command_buffer_local.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698