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

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

Issue 6992010: Added proxy / stub pair for GPU surfaces. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel.cc
===================================================================
--- content/common/gpu/gpu_channel.cc (revision 86313)
+++ content/common/gpu/gpu_channel.cc (working copy)
@@ -18,6 +18,7 @@
#include "content/common/gpu/gpu_messages.h"
#include "content/common/gpu/gpu_video_service.h"
#include "content/common/gpu/transport_texture.h"
+#include "ui/gfx/gl/gl_surface.h"
#if defined(OS_POSIX)
#include "ipc/ipc_channel_posix.h"
@@ -184,6 +185,9 @@
OnCreateOffscreenCommandBuffer)
IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer,
OnDestroyCommandBuffer)
+ IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateOffscreenSurface,
+ OnCreateOffscreenSurface)
+ IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroySurface, OnDestroySurface)
IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateVideoDecoder,
OnCreateVideoDecoder)
IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyVideoDecoder,
@@ -250,6 +254,36 @@
#endif
}
+void GpuChannel::OnCreateOffscreenSurface(const gfx::Size& size,
+ int* route_id) {
+ *route_id = MSG_ROUTING_NONE;
+
+#if defined(ENABLE_GPU)
+ scoped_ptr<gfx::GLSurface> surface(
+ gfx::GLSurface::CreateOffscreenGLSurface(size));
+ if (!surface.get())
+ return;
+
+ *route_id = GenerateRouteID();
+
+ scoped_ptr<GpuSurfaceStub> stub (new GpuSurfaceStub(this,
+ *route_id,
+ surface.release()));
+
+ router_.AddRoute(*route_id, stub.get());
+ surfaces_.AddWithID(stub.release(), *route_id);
+#endif
+}
+
+void GpuChannel::OnDestroySurface(int route_id) {
+#if defined(ENABLE_GPU)
+ if (router_.ResolveRoute(route_id)) {
+ router_.RemoveRoute(route_id);
+ surfaces_.Remove(route_id);
+ }
+#endif
+}
+
void GpuChannel::OnCreateVideoDecoder(
int32 decoder_host_id, const std::vector<uint32>& configs) {
// TODO(cevans): do NOT re-enable this until GpuVideoService has been checked
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698