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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 2383753002: gpu: Add GpuFence framework.
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index 78db5e2017cdbf8747b73a848798e8fdcbcf9c7c..f7809743bf08fb7f8f2be158ff772fcbbb2e6b48 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -193,6 +193,8 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER_DELAY_REPLY(
ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer,
OnAllocateGpuMemoryBuffer)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(ChildProcessHostMsg_SyncCreateGpuFence,
+ OnCreateGpuFence)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ChildProcessHostMsg_EstablishGpuChannel,
OnEstablishGpuChannel)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ChildProcessHostMsg_HasGpuProcess,
@@ -691,4 +693,19 @@ void RenderMessageFilter::OnDeletedGpuMemoryBuffer(
id, PeerHandle(), render_process_id_, sync_token);
}
+void RenderMessageFilter::OnCreateGpuFence(IPC::Message* reply) {
+ DCHECK(BrowserGpuMemoryBufferManager::current());
+
+ BrowserGpuMemoryBufferManager::current()->CreateGpuFenceForChildProcess(
+ PeerHandle(),
+ base::Bind(&RenderMessageFilter::GpuFenceCreated, this, reply));
+}
+
+void RenderMessageFilter::GpuFenceCreated(IPC::Message* reply,
+ const gfx::GpuFenceHandle& handle) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ ChildProcessHostMsg_SyncCreateGpuFence::WriteReplyParams(reply, handle);
+ Send(reply);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698