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

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

Issue 1129943006: Implement StreamTexture::BindTexImage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/gpu_message_filter.cc
diff --git a/content/browser/renderer_host/gpu_message_filter.cc b/content/browser/renderer_host/gpu_message_filter.cc
index d16310679e789f167836a7b26c1833654829abf1..62cca981373f03b6ac5843afd5ee54c011b50796 100644
--- a/content/browser/renderer_host/gpu_message_filter.cc
+++ b/content/browser/renderer_host/gpu_message_filter.cc
@@ -74,6 +74,9 @@ bool GpuMessageFilter::OnMessageReceived(const IPC::Message& message) {
OnEstablishGpuChannel)
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_CreateViewCommandBuffer,
OnCreateViewCommandBuffer)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_CreateStreamTexture,
+ OnCreateStreamTexture)
+
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -189,6 +192,24 @@ void GpuMessageFilter::OnCreateViewCommandBuffer(
base::Passed(&reply)));
}
+void GpuMessageFilter::OnCreateStreamTexture(int32 image_id,
+ int32 route_id,
+ int32 stream_id,
+ IPC::Message* reply_ptr) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ scoped_ptr<IPC::Message> reply(reply_ptr);
+ GpuProcessHost* host = GpuProcessHost::FromID(gpu_process_id_);
+ if (!host) {
+ reply->set_reply_error();
+ Send(reply.release());
+ return;
+ }
+ host->CreateStreamTexture(
+ image_id, render_process_id_, route_id, stream_id,
+ base::Bind(&GpuMessageFilter::CreateStreamTextureCallback,
+ weak_ptr_factory_.GetWeakPtr(), base::Passed(&reply)));
+}
+
void GpuMessageFilter::EstablishChannelCallback(
scoped_ptr<IPC::Message> reply,
const IPC::ChannelHandle& channel,
@@ -207,6 +228,14 @@ void GpuMessageFilter::CreateCommandBufferCallback(
Send(reply.release());
}
+void GpuMessageFilter::CreateStreamTextureCallback(
+ scoped_ptr<IPC::Message> reply,
+ bool result) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ GpuHostMsg_CreateStreamTexture::WriteReplyParams(reply.get(), result);
+ Send(reply.release());
+}
+
void GpuMessageFilter::BeginAllFrameSubscriptions() {
FrameSubscriptionList frame_subscription_list;
frame_subscription_list.swap(frame_subscription_list_);

Powered by Google App Engine
This is Rietveld 408576698