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

Unified Diff: content/common/gpu/gpu_channel.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/common/gpu/gpu_channel.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 43335d56174574930b7c0d99525ad0733a9b6723..75c0827e74f19ef5142f6b765300ae485f916995 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -19,11 +19,13 @@
#include "content/common/gpu/gpu_messages.h"
#include "content/common/gpu/sync_point_manager.h"
#include "content/public/common/content_switches.h"
+#include "gpu/command_buffer/service/image_manager.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/gpu_scheduler.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_proxy.h"
#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_image.h"
#include "ui/gl/gl_surface.h"
#if defined(OS_POSIX)
@@ -153,6 +155,7 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
client_id_(client_id),
share_group_(share_group ? share_group : new gfx::GLShareGroup),
mailbox_manager_(mailbox ? mailbox : new gpu::gles2::MailboxManager),
+ image_manager_(new gpu::gles2::ImageManager),
watchdog_(watchdog),
software_(software),
handle_messages_scheduled_(false),
@@ -323,6 +326,7 @@ void GpuChannel::CreateViewCommandBuffer(
share_group,
window,
mailbox_manager_,
+ image_manager_,
gfx::Size(),
disallowed_features_,
init_params.allowed_extensions,
@@ -344,6 +348,34 @@ GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) {
return stubs_.Lookup(route_id);
}
+void GpuChannel::CreateImage(
+ gfx::PluginWindowHandle window,
+ int32 image_id,
+ gfx::Size* size) {
+ TRACE_EVENT1("gpu",
+ "GpuChannel::CreateImage",
+ "image_id",
+ image_id);
+
+ *size = gfx::Size();
+
+ scoped_refptr<gfx::GLImage> image = gfx::GLImage::CreateGLImage(window);
+ if (!image)
+ return;
+
+ image_manager_->AddImage(image, image_id);
piman 2012/10/12 22:05:11 Should we consider the case where image_id already
reveman 2012/10/13 05:25:53 I made it fail if an image_id already exists.
+ *size = image->GetSize();
+}
+
+void GpuChannel::DeleteImage(int32 image_id) {
+ TRACE_EVENT1("gpu",
+ "GpuChannel::DeleteImage",
+ "image_id",
+ image_id);
+
+ image_manager_->RemoveImage(image_id);
+}
+
void GpuChannel::LoseAllContexts() {
gpu_channel_manager_->LoseAllContexts();
}
@@ -478,6 +510,7 @@ void GpuChannel::OnCreateOffscreenCommandBuffer(
share_group,
gfx::GLSurfaceHandle(),
mailbox_manager_.get(),
+ image_manager_.get(),
size,
disallowed_features_,
init_params.allowed_extensions,

Powered by Google App Engine
This is Rietveld 408576698