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

Side by Side Diff: chrome/gpu/gpu_thread.cc

Issue 1328001: Added command buffer implementation of WebGL which runs in the sandbox.... (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/gpu/gpu_thread.h" 5 #include "chrome/gpu/gpu_thread.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/common/child_process.h" 8 #include "chrome/common/child_process.h"
9 #include "chrome/common/gpu_messages.h" 9 #include "chrome/common/gpu_messages.h"
10 #include "chrome/gpu/gpu_config.h" 10 #include "chrome/gpu/gpu_config.h"
(...skipping 22 matching lines...) Expand all
33 glx_context_.reset(new GpuBackingStoreGLXContext(this)); 33 glx_context_.reset(new GpuBackingStoreGLXContext(this));
34 return glx_context_.get(); 34 return glx_context_.get();
35 } 35 }
36 #endif 36 #endif
37 37
38 void GpuThread::OnControlMessageReceived(const IPC::Message& msg) { 38 void GpuThread::OnControlMessageReceived(const IPC::Message& msg) {
39 bool msg_is_ok = true; 39 bool msg_is_ok = true;
40 IPC_BEGIN_MESSAGE_MAP_EX(GpuThread, msg, msg_is_ok) 40 IPC_BEGIN_MESSAGE_MAP_EX(GpuThread, msg, msg_is_ok)
41 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, 41 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel,
42 OnEstablishChannel) 42 OnEstablishChannel)
43 IPC_MESSAGE_HANDLER(GpuMsg_Synchronize,
44 OnSynchronize)
43 IPC_MESSAGE_HANDLER(GpuMsg_NewRenderWidgetHostView, 45 IPC_MESSAGE_HANDLER(GpuMsg_NewRenderWidgetHostView,
44 OnNewRenderWidgetHostView) 46 OnNewRenderWidgetHostView)
45 IPC_END_MESSAGE_MAP_EX() 47 IPC_END_MESSAGE_MAP_EX()
46 } 48 }
47 49
48 void GpuThread::OnEstablishChannel(int renderer_id) { 50 void GpuThread::OnEstablishChannel(int renderer_id) {
49 scoped_refptr<GpuChannel> channel; 51 scoped_refptr<GpuChannel> channel;
50 52
51 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); 53 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
52 if (iter == gpu_channels_.end()) { 54 if (iter == gpu_channels_.end()) {
(...skipping 19 matching lines...) Expand all
72 // On POSIX, pass the renderer-side FD. Also mark it as auto-close so that 74 // On POSIX, pass the renderer-side FD. Also mark it as auto-close so that
73 // it gets closed after it has been sent. 75 // it gets closed after it has been sent.
74 int renderer_fd = channel->DisownRendererFd(); 76 int renderer_fd = channel->DisownRendererFd();
75 channel_handle.socket = base::FileDescriptor(renderer_fd, true); 77 channel_handle.socket = base::FileDescriptor(renderer_fd, true);
76 #endif 78 #endif
77 } 79 }
78 80
79 Send(new GpuHostMsg_ChannelEstablished(channel_handle)); 81 Send(new GpuHostMsg_ChannelEstablished(channel_handle));
80 } 82 }
81 83
84 void GpuThread::OnSynchronize(int renderer_id) {
85 Send(new GpuHostMsg_SynchronizeReply(renderer_id));
86 }
87
82 void GpuThread::OnNewRenderWidgetHostView(GpuNativeWindowHandle parent_window, 88 void GpuThread::OnNewRenderWidgetHostView(GpuNativeWindowHandle parent_window,
83 int32 routing_id) { 89 int32 routing_id) {
84 // The GPUView class' lifetime is controlled by the host, which will send a 90 // The GPUView class' lifetime is controlled by the host, which will send a
85 // message to destroy the GpuRWHView when necessary. So we don't manage the 91 // message to destroy the GpuRWHView when necessary. So we don't manage the
86 // lifetime of this object. 92 // lifetime of this object.
87 #if defined(OS_WIN) 93 #if defined(OS_WIN)
88 new GpuViewWin(this, parent_window, routing_id); 94 new GpuViewWin(this, parent_window, routing_id);
89 #elif defined(GPU_USE_GLX) 95 #elif defined(GPU_USE_GLX)
90 new GpuViewX(this, parent_window, routing_id); 96 new GpuViewX(this, parent_window, routing_id);
91 #else 97 #else
92 NOTIMPLEMENTED(); 98 NOTIMPLEMENTED();
93 #endif 99 #endif
94 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698