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); |
+} |