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

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

Issue 10543125: gpu: Add support for GLX_EXT_texture_from_pixmap extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add kGLImplementationMockGL case to gl_image_android.cc. 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 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 11d7287aa4604c817a9b8ac0ac56d26d1d5c9611..49717b4980dd9e8863db48455ab179fd584231f3 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -134,6 +134,72 @@ int32 BrowserGpuChannelHostFactory::CreateViewCommandBuffer(
return request.route_id;
}
+void BrowserGpuChannelHostFactory::CreateImageOnIO(
+ gfx::PluginWindowHandle window,
+ int32 image_id,
+ const CreateImageCallback& callback) {
+ GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
+ if (!host) {
+ ImageCreatedOnIO(callback, gfx::Size());
+ return;
+ }
+
+ host->CreateImage(
+ window,
+ gpu_client_id_,
+ image_id,
+ base::Bind(&BrowserGpuChannelHostFactory::ImageCreatedOnIO, callback));
+}
+
+// static
+void BrowserGpuChannelHostFactory::ImageCreatedOnIO(
+ const CreateImageCallback& callback, const gfx::Size size) {
+ BrowserThread::PostTask(
+ BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&BrowserGpuChannelHostFactory::OnImageCreated,
+ callback, size));
+}
+
+// static
+void BrowserGpuChannelHostFactory::OnImageCreated(
+ const CreateImageCallback& callback, const gfx::Size size) {
+ callback.Run(size);
+}
+
+void BrowserGpuChannelHostFactory::CreateImage(
+ gfx::PluginWindowHandle window,
+ int32 image_id,
+ const CreateImageCallback& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ GetIOLoopProxy()->PostTask(FROM_HERE, base::Bind(
+ &BrowserGpuChannelHostFactory::CreateImageOnIO,
+ base::Unretained(this),
+ window,
+ image_id,
+ callback));
+}
+
+void BrowserGpuChannelHostFactory::DeleteImageOnIO(
+ int32 image_id, int32 sync_point) {
+ GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
+ if (!host) {
+ return;
+ }
+
+ host->DeleteImage(gpu_client_id_, image_id, sync_point);
+}
+
+void BrowserGpuChannelHostFactory::DeleteImage(
+ int32 image_id, int32 sync_point) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ GetIOLoopProxy()->PostTask(FROM_HERE, base::Bind(
+ &BrowserGpuChannelHostFactory::DeleteImageOnIO,
+ base::Unretained(this),
+ image_id,
+ sync_point));
+}
+
void BrowserGpuChannelHostFactory::EstablishGpuChannelOnIO(
EstablishRequest* request) {
GpuProcessHost* host = GpuProcessHost::FromID(gpu_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