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

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.h

Issue 11195011: Send vsync timebase updates to the browser compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Send vsync timebase updates to the browser compositor Created 8 years, 2 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 | Annotate | Revision Log
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 CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 5 #ifndef CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
7 7
8 #if defined(ENABLE_GPU) 8 #if defined(ENABLE_GPU)
9 9
10 #include <map> 10 #include <map>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 virtual bool SetSurfaceVisible(bool visible) OVERRIDE; 64 virtual bool SetSurfaceVisible(bool visible) OVERRIDE;
65 virtual bool DiscardBackbuffer() OVERRIDE; 65 virtual bool DiscardBackbuffer() OVERRIDE;
66 virtual bool EnsureBackbuffer() OVERRIDE; 66 virtual bool EnsureBackbuffer() OVERRIDE;
67 virtual uint32 InsertSyncPoint() OVERRIDE; 67 virtual uint32 InsertSyncPoint() OVERRIDE;
68 virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE; 68 virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE;
69 virtual bool SignalSyncPoint(uint32 sync_point, 69 virtual bool SignalSyncPoint(uint32 sync_point,
70 const base::Closure& callback) OVERRIDE; 70 const base::Closure& callback) OVERRIDE;
71 virtual void SetMemoryAllocationChangedCallback( 71 virtual void SetMemoryAllocationChangedCallback(
72 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>& 72 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>&
73 callback) OVERRIDE; 73 callback) OVERRIDE;
74 virtual void SetUpdateVSyncTimeCallback(
75 const base::Callback<void(int64)>& callback) OVERRIDE;
74 virtual bool SetParent(CommandBufferProxy* parent_command_buffer, 76 virtual bool SetParent(CommandBufferProxy* parent_command_buffer,
75 uint32 parent_texture_id) OVERRIDE; 77 uint32 parent_texture_id) OVERRIDE;
76 virtual void SetChannelErrorCallback(const base::Closure& callback) OVERRIDE; 78 virtual void SetChannelErrorCallback(const base::Closure& callback) OVERRIDE;
77 virtual void SetNotifyRepaintTask(const base::Closure& callback) OVERRIDE; 79 virtual void SetNotifyRepaintTask(const base::Closure& callback) OVERRIDE;
78 virtual void SetOnConsoleMessageCallback( 80 virtual void SetOnConsoleMessageCallback(
79 const GpuConsoleMessageCallback& callback) OVERRIDE; 81 const GpuConsoleMessageCallback& callback) OVERRIDE;
80 82
81 // CommandBuffer implementation: 83 // CommandBuffer implementation:
82 virtual bool Initialize() OVERRIDE; 84 virtual bool Initialize() OVERRIDE;
83 virtual State GetState() OVERRIDE; 85 virtual State GetState() OVERRIDE;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 bool Send(IPC::Message* msg); 118 bool Send(IPC::Message* msg);
117 119
118 // Message handlers: 120 // Message handlers:
119 void OnUpdateState(const gpu::CommandBuffer::State& state); 121 void OnUpdateState(const gpu::CommandBuffer::State& state);
120 void OnNotifyRepaint(); 122 void OnNotifyRepaint();
121 void OnDestroyed(gpu::error::ContextLostReason reason); 123 void OnDestroyed(gpu::error::ContextLostReason reason);
122 void OnEchoAck(); 124 void OnEchoAck();
123 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message); 125 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message);
124 void OnSetMemoryAllocation(const GpuMemoryAllocationForRenderer& allocation); 126 void OnSetMemoryAllocation(const GpuMemoryAllocationForRenderer& allocation);
125 void OnSignalSyncPointAck(uint32 id); 127 void OnSignalSyncPointAck(uint32 id);
128 void OnUpdateVSyncTime(int64 time);
126 129
127 // Try to read an updated copy of the state from shared memory. 130 // Try to read an updated copy of the state from shared memory.
128 void TryUpdateState(); 131 void TryUpdateState();
129 132
130 // Local cache of id to transfer buffer mapping. 133 // Local cache of id to transfer buffer mapping.
131 TransferBufferMap transfer_buffers_; 134 TransferBufferMap transfer_buffers_;
132 135
133 // Zero or more (unowned!) video decoder hosts using this proxy, keyed by 136 // Zero or more (unowned!) video decoder hosts using this proxy, keyed by
134 // their decoder_route_id. 137 // their decoder_route_id.
135 Decoders video_decoder_hosts_; 138 Decoders video_decoder_hosts_;
(...skipping 14 matching lines...) Expand all
150 // Tasks to be invoked in echo responses. 153 // Tasks to be invoked in echo responses.
151 std::queue<base::Closure> echo_tasks_; 154 std::queue<base::Closure> echo_tasks_;
152 155
153 base::Closure notify_repaint_task_; 156 base::Closure notify_repaint_task_;
154 157
155 base::Closure channel_error_callback_; 158 base::Closure channel_error_callback_;
156 159
157 base::Callback<void(const GpuMemoryAllocationForRenderer&)> 160 base::Callback<void(const GpuMemoryAllocationForRenderer&)>
158 memory_allocation_changed_callback_; 161 memory_allocation_changed_callback_;
159 162
163 base::Callback<void(int64)> update_vsync_time_callback_;
164
160 GpuConsoleMessageCallback console_message_callback_; 165 GpuConsoleMessageCallback console_message_callback_;
161 166
162 // Tasks to be invoked in SignalSyncPoint responses. 167 // Tasks to be invoked in SignalSyncPoint responses.
163 uint32 next_signal_id_; 168 uint32 next_signal_id_;
164 SignalTaskMap signal_tasks_; 169 SignalTaskMap signal_tasks_;
165 170
166 // ID of transfer buffer containing shared state. 171 // ID of transfer buffer containing shared state.
167 int32 state_buffer_; 172 int32 state_buffer_;
168 173
169 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); 174 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl);
170 }; 175 };
171 176
172 #endif // ENABLE_GPU 177 #endif // ENABLE_GPU
173 178
174 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 179 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698