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

Unified Diff: content/browser/gpu/gpu_process_host.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: Move CreateGLImage below virtual methods. 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
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 b16811843a47ab2c56d60022cc6fb3eb29ae8811..a1f7e3b4fe83a2878757632c080e3e43beffe3f5 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -478,6 +478,7 @@ bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, OnChannelEstablished)
IPC_MESSAGE_HANDLER(GpuHostMsg_CommandBufferCreated, OnCommandBufferCreated)
IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyCommandBuffer, OnDestroyCommandBuffer)
+ IPC_MESSAGE_HANDLER(GpuHostMsg_ImageCreated, OnImageCreated)
#if defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
OnAcceleratedSurfaceBuffersSwapped)
@@ -566,6 +567,32 @@ void GpuProcessHost::CreateViewCommandBuffer(
}
}
+void GpuProcessHost::CreateImage(
+ gfx::PluginWindowHandle window,
+ int client_id,
+ int image_id,
+ const CreateImageCallback& callback) {
+ TRACE_EVENT0("gpu", "GpuProcessHostUIShim::CreateImage");
+
+ DCHECK(CalledOnValidThread());
+
+ if (Send(new GpuMsg_CreateImage(window, client_id, image_id))) {
+ create_image_requests_.push(callback);
+ } else {
+ CreateImageError(callback, gfx::Size());
+ }
+}
+
+void GpuProcessHost::DeleteImage(
+ int client_id,
+ int image_id) {
+ TRACE_EVENT0("gpu", "GpuProcessHostUIShim::DeleteImage");
+
+ DCHECK(CalledOnValidThread());
+
+ Send(new GpuMsg_DeleteImage(client_id, image_id));
+}
+
void GpuProcessHost::OnInitialized(bool result) {
UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result);
}
@@ -621,6 +648,16 @@ void GpuProcessHost::OnDestroyCommandBuffer(int32 surface_id) {
#endif // defined(TOOLKIT_GTK)
}
+void GpuProcessHost::OnImageCreated(const gfx::Size size) {
+ TRACE_EVENT0("gpu", "GpuProcessHost::OnImageCreated");
+
+ if (!create_image_requests_.empty()) {
+ CreateImageCallback callback = create_image_requests_.front();
+ create_image_requests_.pop();
+ callback.Run(size);
+ }
+}
+
#if defined(OS_MACOSX)
void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(
const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) {
@@ -914,3 +951,8 @@ void GpuProcessHost::CreateCommandBufferError(
const CreateCommandBufferCallback& callback, int32 route_id) {
callback.Run(route_id);
}
+
+void GpuProcessHost::CreateImageError(
+ const CreateImageCallback& callback, const gfx::Size size) {
+ callback.Run(size);
+}

Powered by Google App Engine
This is Rietveld 408576698