| Index: content/common/gpu/gpu_channel_manager.cc
|
| diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
|
| index 899da86e45f047842ab902387c699c612cdb8844..d0e38c4cf104d6dd0c81230df5f3585b57b399aa 100644
|
| --- a/content/common/gpu/gpu_channel_manager.cc
|
| +++ b/content/common/gpu/gpu_channel_manager.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/bind.h"
|
| #include "base/command_line.h"
|
| #include "content/common/gpu/gpu_channel.h"
|
| +#include "content/common/gpu/gpu_memory_buffer_factory.h"
|
| #include "content/common/gpu/gpu_memory_manager.h"
|
| #include "content/common/gpu/gpu_messages.h"
|
| #include "content/common/gpu/sync_point_manager.h"
|
| @@ -46,6 +47,7 @@ GpuChannelManager::GpuChannelManager(MessageRouter* router,
|
| DCHECK(router_);
|
| DCHECK(io_message_loop);
|
| DCHECK(shutdown_event);
|
| + GpuMemoryBufferFactory::Initialize();
|
| }
|
|
|
| GpuChannelManager::~GpuChannelManager() {
|
| @@ -183,28 +185,43 @@ void GpuChannelManager::OnCreateViewCommandBuffer(
|
| }
|
|
|
| void GpuChannelManager::CreateImage(
|
| - gfx::PluginWindowHandle window, int32 client_id, int32 image_id) {
|
| - gfx::Size size;
|
| -
|
| - GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id);
|
| - if (iter != gpu_channels_.end()) {
|
| - iter->second->CreateImage(window, image_id, &size);
|
| + const gfx::GpuMemoryBufferHandle& handle,
|
| + const gfx::Size& size,
|
| + unsigned internalformat,
|
| + int32 client_id,
|
| + int32 image_id) {
|
| + if (!GpuMemoryBufferFactory::CreateGpuMemoryBuffer(handle,
|
| + size,
|
| + internalformat,
|
| + 0)) {
|
| + Send(new GpuHostMsg_ImageCreated(false));
|
| + return;
|
| }
|
|
|
| - Send(new GpuHostMsg_ImageCreated(size));
|
| + GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id);
|
| + Send(new GpuHostMsg_ImageCreated(
|
| + iter != gpu_channels_.end()
|
| + ? iter->second->CreateImage(handle, size, internalformat, image_id)
|
| + : false));
|
| }
|
|
|
| void GpuChannelManager::OnCreateImage(
|
| - gfx::PluginWindowHandle window, int32 client_id, int32 image_id) {
|
| + const gfx::GpuMemoryBufferHandle& handle,
|
| + const gfx::Size& size,
|
| + unsigned internalformat,
|
| + int32 client_id,
|
| + int32 image_id) {
|
| DCHECK(image_id);
|
|
|
| if (image_operations_.empty()) {
|
| - CreateImage(window, client_id, image_id);
|
| + CreateImage(handle, size, internalformat, client_id, image_id);
|
| } else {
|
| image_operations_.push_back(
|
| new ImageOperation(0, base::Bind(&GpuChannelManager::CreateImage,
|
| base::Unretained(this),
|
| - window,
|
| + handle,
|
| + size,
|
| + internalformat,
|
| client_id,
|
| image_id)));
|
| }
|
|
|