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

Unified Diff: content/common/gpu/gpu_channel_manager.cc

Issue 331723003: gpu: Remove Create/DeleteImage IPC by adding an X11_PIXMAP_BUFFER GpuMemoryBuffer type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add GpuMemoryBufferFactory interface Created 6 years, 6 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/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)));
}

Powered by Google App Engine
This is Rietveld 408576698