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

Unified Diff: content/common/gpu/gpu_channel.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: 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.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 6262ed5e071c478ebf16be0d95bac09b16e175de..7a90379476c9716e7e38e65b1f1ba9e5177b9879 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -578,28 +578,29 @@ GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) {
return stubs_.Lookup(route_id);
}
-void GpuChannel::CreateImage(
- gfx::PluginWindowHandle window,
- int32 image_id,
- gfx::Size* size) {
+bool GpuChannel::CreateImage(
+ const gfx::GpuMemoryBufferHandle& handle,
+ const gfx::Size& size,
+ unsigned internalformat,
+ int32 image_id) {
TRACE_EVENT1("gpu",
"GpuChannel::CreateImage",
"image_id",
image_id);
- *size = gfx::Size();
-
if (image_manager_->LookupImage(image_id)) {
LOG(ERROR) << "CreateImage failed, image_id already in use.";
- return;
+ return false;
}
- scoped_refptr<gfx::GLImage> image = gfx::GLImage::CreateGLImage(window);
+ scoped_refptr<gfx::GLImage> image =
+ gfx::GLImage::CreateGLImageForGpuMemoryBuffer(
+ handle, size, internalformat);
if (!image.get())
- return;
+ return false;
image_manager_->AddImage(image.get(), image_id);
- *size = image->GetSize();
+ return true;
}
void GpuChannel::DeleteImage(int32 image_id) {

Powered by Google App Engine
This is Rietveld 408576698