OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 renderer_process_(base::kNullProcessHandle), | 34 renderer_process_(base::kNullProcessHandle), |
35 renderer_pid_(base::kNullProcessId), | 35 renderer_pid_(base::kNullProcessId), |
36 share_group_(new gfx::GLShareGroup), | 36 share_group_(new gfx::GLShareGroup), |
37 watchdog_(watchdog), | 37 watchdog_(watchdog), |
38 software_(software), | 38 software_(software), |
39 task_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 39 task_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
40 DCHECK(gpu_channel_manager); | 40 DCHECK(gpu_channel_manager); |
41 DCHECK(renderer_id); | 41 DCHECK(renderer_id); |
42 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 42 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
43 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); | 43 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); |
44 disallowed_extensions_.multisampling = | 44 disallowed_features_.multisampling = |
45 command_line->HasSwitch(switches::kDisableGLMultisampling); | 45 command_line->HasSwitch(switches::kDisableGLMultisampling); |
46 disallowed_extensions_.driver_bug_workarounds = | 46 disallowed_features_.driver_bug_workarounds = |
47 command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds); | 47 command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds); |
48 } | 48 } |
49 | 49 |
50 GpuChannel::~GpuChannel() { | 50 GpuChannel::~GpuChannel() { |
51 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
52 if (renderer_process_) | 52 if (renderer_process_) |
53 CloseHandle(renderer_process_); | 53 CloseHandle(renderer_process_); |
54 #endif | 54 #endif |
55 } | 55 } |
56 | 56 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 #if defined(ENABLE_GPU) | 185 #if defined(ENABLE_GPU) |
186 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); | 186 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); |
187 | 187 |
188 *route_id = GenerateRouteID(); | 188 *route_id = GenerateRouteID(); |
189 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( | 189 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( |
190 this, | 190 this, |
191 share_group, | 191 share_group, |
192 window, | 192 window, |
193 gfx::Size(), | 193 gfx::Size(), |
194 disallowed_extensions_, | 194 disallowed_features_, |
195 init_params.allowed_extensions, | 195 init_params.allowed_extensions, |
196 init_params.attribs, | 196 init_params.attribs, |
197 *route_id, | 197 *route_id, |
198 renderer_id_, | 198 renderer_id_, |
199 render_view_id, | 199 render_view_id, |
200 watchdog_, | 200 watchdog_, |
201 software_)); | 201 software_)); |
202 router_.AddRoute(*route_id, stub.get()); | 202 router_.AddRoute(*route_id, stub.get()); |
203 stubs_.AddWithID(stub.release(), *route_id); | 203 stubs_.AddWithID(stub.release(), *route_id); |
204 #endif // ENABLE_GPU | 204 #endif // ENABLE_GPU |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 #if defined(ENABLE_GPU) | 305 #if defined(ENABLE_GPU) |
306 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); | 306 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); |
307 | 307 |
308 route_id = GenerateRouteID(); | 308 route_id = GenerateRouteID(); |
309 | 309 |
310 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( | 310 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( |
311 this, | 311 this, |
312 share_group, | 312 share_group, |
313 gfx::kNullPluginWindow, | 313 gfx::kNullPluginWindow, |
314 size, | 314 size, |
315 disallowed_extensions_, | 315 disallowed_features_, |
316 init_params.allowed_extensions, | 316 init_params.allowed_extensions, |
317 init_params.attribs, | 317 init_params.attribs, |
318 route_id, | 318 route_id, |
319 0, 0, watchdog_, | 319 0, 0, watchdog_, |
320 software_)); | 320 software_)); |
321 router_.AddRoute(route_id, stub.get()); | 321 router_.AddRoute(route_id, stub.get()); |
322 stubs_.AddWithID(stub.release(), route_id); | 322 stubs_.AddWithID(stub.release(), route_id); |
323 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer", | 323 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer", |
324 "route_id", route_id); | 324 "route_id", route_id); |
325 #endif | 325 #endif |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 399 |
400 #if defined(OS_POSIX) | 400 #if defined(OS_POSIX) |
401 int GpuChannel::TakeRendererFileDescriptor() { | 401 int GpuChannel::TakeRendererFileDescriptor() { |
402 if (!channel_.get()) { | 402 if (!channel_.get()) { |
403 NOTREACHED(); | 403 NOTREACHED(); |
404 return -1; | 404 return -1; |
405 } | 405 } |
406 return channel_->TakeClientFileDescriptor(); | 406 return channel_->TakeClientFileDescriptor(); |
407 } | 407 } |
408 #endif // defined(OS_POSIX) | 408 #endif // defined(OS_POSIX) |
OLD | NEW |