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

Unified Diff: content/browser/gpu/gpu_process_host.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/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 6fff587506cfcfb94c44e2700ab0eab7c99b0ef0..c0980d16c48dda569546c3e6505c0be7a2945550 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -615,6 +615,7 @@ bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
OnDestroyChannel)
IPC_MESSAGE_HANDLER(GpuHostMsg_CacheShader,
OnCacheShader)
+ IPC_MESSAGE_HANDLER(GpuHostMsg_StreamTextureCreated, OnStreamTextureCreated)
IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message))
IPC_END_MESSAGE_MAP()
@@ -684,6 +685,19 @@ void GpuProcessHost::CreateViewCommandBuffer(
}
}
+void GpuProcessHost::CreateStreamTexture(
+ int32 image_id,
+ int client_id,
+ int32 route_id,
+ int32 stream_id,
+ const CreateStreamTextureCallback& callback) {
+ TRACE_EVENT0("gpu", "GpuProcessHost::CreateStreamTexture");
+ DCHECK(CalledOnValidThread());
+ Send(
+ new GpuMsg_CreateStreamTexture(image_id, client_id, route_id, stream_id));
+ create_stream_texture_requests_.push(callback);
+}
+
void GpuProcessHost::CreateGpuMemoryBuffer(
gfx::GpuMemoryBufferId id,
const gfx::Size& size,
@@ -781,6 +795,15 @@ void GpuProcessHost::OnCommandBufferCreated(CreateCommandBufferResult result) {
callback.Run(result);
}
+void GpuProcessHost::OnStreamTextureCreated(bool result) {
+ if (create_stream_texture_requests_.empty())
+ return;
+ CreateStreamTextureCallback callback =
+ create_stream_texture_requests_.front();
+ create_stream_texture_requests_.pop();
+ callback.Run(result);
+}
+
void GpuProcessHost::OnDestroyCommandBuffer(int32 surface_id) {
TRACE_EVENT0("gpu", "GpuProcessHost::OnDestroyCommandBuffer");
SurfaceRefMap::iterator it = surface_refs_.find(surface_id);

Powered by Google App Engine
This is Rietveld 408576698