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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 213493002: content: Add multi-proc surface texture support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 075c8f993f5da2332a185895ee210b8e68d8155c..c2cb27881888df33fb959f652e9642995eca7494 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -393,6 +393,52 @@ scoped_ptr<gfx::GpuMemoryBuffer>
return buffer.PassAs<gfx::GpuMemoryBuffer>();
}
+void BrowserGpuChannelHostFactory::CreateSurfaceTextureOnIO(
+ int32 surface_texture_id,
+ base::ProcessHandle process_handle,
+ const CreateSurfaceTextureCallback& callback) {
+ GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
+ if (!host) {
+ SurfaceTextureCreatedOnIO(callback);
+ return;
+ }
+
+ host->CreateSurfaceTexture(
+ surface_texture_id,
+ process_handle,
+ base::Bind(&BrowserGpuChannelHostFactory::SurfaceTextureCreatedOnIO,
+ callback));
+}
+
+// static
+void BrowserGpuChannelHostFactory::SurfaceTextureCreatedOnIO(
+ const CreateSurfaceTextureCallback& callback) {
+ BrowserThread::PostTask(
+ BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&BrowserGpuChannelHostFactory::OnSurfaceTextureCreated,
+ callback));
+}
+
+// static
+void BrowserGpuChannelHostFactory::OnSurfaceTextureCreated(
+ const CreateSurfaceTextureCallback& callback) {
+ callback.Run();
+}
+
+void BrowserGpuChannelHostFactory::CreateSurfaceTexture(
+ int32 surface_texture_id,
+ base::ProcessHandle process_handle,
+ const CreateSurfaceTextureCallback& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ GetIOLoopProxy()->PostTask(FROM_HERE, base::Bind(
+ &BrowserGpuChannelHostFactory::CreateSurfaceTextureOnIO,
+ base::Unretained(this),
+ surface_texture_id,
+ process_handle,
+ callback));
+}
+
// static
void BrowserGpuChannelHostFactory::AddFilterOnIO(
int host_id,
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698