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

Side by Side Diff: gpu/ipc/client/command_buffer_proxy_impl.h

Issue 1962493002: Make Mac swap code like other platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 4 years, 7 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 | « gpu/ipc/client/BUILD.gn ('k') | gpu/ipc/client/command_buffer_proxy_impl.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 5 #ifndef GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
6 #define GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 6 #define GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 15 matching lines...) Expand all
26 #include "gpu/command_buffer/common/command_buffer.h" 26 #include "gpu/command_buffer/common/command_buffer.h"
27 #include "gpu/command_buffer/common/command_buffer_id.h" 27 #include "gpu/command_buffer/common/command_buffer_id.h"
28 #include "gpu/command_buffer/common/command_buffer_shared.h" 28 #include "gpu/command_buffer/common/command_buffer_shared.h"
29 #include "gpu/command_buffer/common/gpu_memory_allocation.h" 29 #include "gpu/command_buffer/common/gpu_memory_allocation.h"
30 #include "gpu/gpu_export.h" 30 #include "gpu/gpu_export.h"
31 #include "ipc/ipc_listener.h" 31 #include "ipc/ipc_listener.h"
32 #include "ui/events/latency_info.h" 32 #include "ui/events/latency_info.h"
33 #include "ui/gfx/swap_result.h" 33 #include "ui/gfx/swap_result.h"
34 34
35 struct GPUCommandBufferConsoleMessage; 35 struct GPUCommandBufferConsoleMessage;
36 struct GpuCommandBufferMsg_SwapBuffersCompleted_Params;
36 37
37 namespace base { 38 namespace base {
38 class SharedMemory; 39 class SharedMemory;
39 } 40 }
40 41
41 namespace gpu { 42 namespace gpu {
43 struct GpuProcessHostedCALayerTreeParamsMac;
42 struct Mailbox; 44 struct Mailbox;
43 struct SyncToken; 45 struct SyncToken;
44 } 46 }
45 47
46 namespace gpu { 48 namespace gpu {
47 class GpuChannelHost; 49 class GpuChannelHost;
48 50
49 // Client side proxy that forwards messages synchronously to a 51 // Client side proxy that forwards messages synchronously to a
50 // CommandBufferStub. 52 // CommandBufferStub.
51 class GPU_EXPORT CommandBufferProxyImpl 53 class GPU_EXPORT CommandBufferProxyImpl
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 bool is_lost); 122 bool is_lost);
121 123
122 void AddDeletionObserver(DeletionObserver* observer); 124 void AddDeletionObserver(DeletionObserver* observer);
123 void RemoveDeletionObserver(DeletionObserver* observer); 125 void RemoveDeletionObserver(DeletionObserver* observer);
124 126
125 bool EnsureBackbuffer(); 127 bool EnsureBackbuffer();
126 128
127 void SetOnConsoleMessageCallback(const GpuConsoleMessageCallback& callback); 129 void SetOnConsoleMessageCallback(const GpuConsoleMessageCallback& callback);
128 130
129 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); 131 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info);
130 using SwapBuffersCompletionCallback = 132 using SwapBuffersCompletionCallback = base::Callback<void(
131 base::Callback<void(const std::vector<ui::LatencyInfo>& latency_info, 133 const std::vector<ui::LatencyInfo>& latency_info,
132 gfx::SwapResult result)>; 134 gfx::SwapResult result,
135 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac)>;
133 void SetSwapBuffersCompletionCallback( 136 void SetSwapBuffersCompletionCallback(
134 const SwapBuffersCompletionCallback& callback); 137 const SwapBuffersCompletionCallback& callback);
135 138
136 using UpdateVSyncParametersCallback = 139 using UpdateVSyncParametersCallback =
137 base::Callback<void(base::TimeTicks timebase, base::TimeDelta interval)>; 140 base::Callback<void(base::TimeTicks timebase, base::TimeDelta interval)>;
138 void SetUpdateVSyncParametersCallback( 141 void SetUpdateVSyncParametersCallback(
139 const UpdateVSyncParametersCallback& callback); 142 const UpdateVSyncParametersCallback& callback);
140 143
141 // TODO(apatrick): this is a temporary optimization while skia is calling 144 // TODO(apatrick): this is a temporary optimization while skia is calling
142 // ContentGLContext::MakeCurrent prior to every GL call. It saves returning 6 145 // ContentGLContext::MakeCurrent prior to every GL call. It saves returning 6
(...skipping 27 matching lines...) Expand all
170 // Send an IPC message over the GPU channel. This is private to fully 173 // Send an IPC message over the GPU channel. This is private to fully
171 // encapsulate the channel; all callers of this function must explicitly 174 // encapsulate the channel; all callers of this function must explicitly
172 // verify that the context has not been lost. 175 // verify that the context has not been lost.
173 bool Send(IPC::Message* msg); 176 bool Send(IPC::Message* msg);
174 177
175 // Message handlers: 178 // Message handlers:
176 void OnDestroyed(gpu::error::ContextLostReason reason, 179 void OnDestroyed(gpu::error::ContextLostReason reason,
177 gpu::error::Error error); 180 gpu::error::Error error);
178 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message); 181 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message);
179 void OnSignalAck(uint32_t id); 182 void OnSignalAck(uint32_t id);
180 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info, 183 void OnSwapBuffersCompleted(
181 gfx::SwapResult result); 184 const GpuCommandBufferMsg_SwapBuffersCompleted_Params& params);
182 void OnUpdateVSyncParameters(base::TimeTicks timebase, 185 void OnUpdateVSyncParameters(base::TimeTicks timebase,
183 base::TimeDelta interval); 186 base::TimeDelta interval);
184 187
185 // Updates the highest verified release fence sync. 188 // Updates the highest verified release fence sync.
186 void UpdateVerifiedReleases(uint32_t verified_flush); 189 void UpdateVerifiedReleases(uint32_t verified_flush);
187 190
188 // Try to read an updated copy of the state from shared memory, and calls 191 // Try to read an updated copy of the state from shared memory, and calls
189 // OnGpuStateError() if the new state has an error. 192 // OnGpuStateError() if the new state has an error.
190 void TryUpdateState(); 193 void TryUpdateState();
191 // Like the above but does not call the error event handler if the new state 194 // Like the above but does not call the error event handler if the new state
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 273
271 base::WeakPtr<CommandBufferProxyImpl> weak_this_; 274 base::WeakPtr<CommandBufferProxyImpl> weak_this_;
272 scoped_refptr<base::SequencedTaskRunner> callback_thread_; 275 scoped_refptr<base::SequencedTaskRunner> callback_thread_;
273 276
274 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); 277 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl);
275 }; 278 };
276 279
277 } // namespace gpu 280 } // namespace gpu
278 281
279 #endif // GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 282 #endif // GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
OLDNEW
« no previous file with comments | « gpu/ipc/client/BUILD.gn ('k') | gpu/ipc/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698