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

Unified Diff: chrome/gpu/gpu_thread.cc

Issue 1136006: Calling OpenGL from the renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 | « chrome/gpu/gpu_thread.h ('k') | chrome/plugin/command_buffer_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/gpu/gpu_thread.cc
===================================================================
--- chrome/gpu/gpu_thread.cc (revision 42644)
+++ chrome/gpu/gpu_thread.cc (working copy)
@@ -7,7 +7,6 @@
#include "build/build_config.h"
#include "chrome/common/child_process.h"
#include "chrome/common/gpu_messages.h"
-#include "chrome/gpu/gpu_channel.h"
#include "chrome/gpu/gpu_config.h"
#if defined(OS_WIN)
@@ -47,11 +46,28 @@
}
void GpuThread::OnEstablishChannel(int renderer_id) {
- scoped_refptr<GpuChannel> channel =
- GpuChannel::EstablishGpuChannel(renderer_id);
+ scoped_refptr<GpuChannel> channel;
+
+ GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
+ if (iter == gpu_channels_.end()) {
+ channel = new GpuChannel(renderer_id);
+ } else {
+ channel = iter->second;
+ }
+
+ DCHECK(channel != NULL);
+
+ if (channel->Init()) {
+ // TODO(apatrick): figure out when to remove channels from the map. They
+ // will never be destroyed otherwise.
+ gpu_channels_[renderer_id] = channel;
+ } else {
+ channel = NULL;
+ }
+
IPC::ChannelHandle channel_handle;
if (channel.get()) {
- channel_handle.name = channel->channel_name();
+ channel_handle.name = channel->GetChannelName();
#if defined(OS_POSIX)
// On POSIX, pass the renderer-side FD. Also mark it as auto-close so that
// it gets closed after it has been sent.
« no previous file with comments | « chrome/gpu/gpu_thread.h ('k') | chrome/plugin/command_buffer_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698