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 #include "content/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 switches::kDisableGpuWatchdog, | 550 switches::kDisableGpuWatchdog, |
551 switches::kDisableLogging, | 551 switches::kDisableLogging, |
552 switches::kEnableGPUServiceLogging, | 552 switches::kEnableGPUServiceLogging, |
553 switches::kEnableLogging, | 553 switches::kEnableLogging, |
554 #if defined(OS_MACOSX) | 554 #if defined(OS_MACOSX) |
555 switches::kEnableSandboxLogging, | 555 switches::kEnableSandboxLogging, |
556 #endif | 556 #endif |
557 switches::kGpuNoContextLost, | 557 switches::kGpuNoContextLost, |
558 switches::kGpuStartupDialog, | 558 switches::kGpuStartupDialog, |
559 switches::kLoggingLevel, | 559 switches::kLoggingLevel, |
560 switches::kNoSandbox, | 560 switches::kNoSandbox |
561 switches::kUseGL, | |
562 }; | 561 }; |
563 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 562 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
564 arraysize(kSwitchNames)); | 563 arraysize(kSwitchNames)); |
565 | 564 |
566 // If --ignore-gpu-blacklist is passed in, don't send in crash reports | 565 // If --ignore-gpu-blacklist is passed in, don't send in crash reports |
567 // because GPU is expected to be unreliable. | 566 // because GPU is expected to be unreliable. |
568 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) && | 567 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) && |
569 !cmd_line->HasSwitch(switches::kDisableBreakpad)) | 568 !cmd_line->HasSwitch(switches::kDisableBreakpad)) |
570 cmd_line->AppendSwitch(switches::kDisableBreakpad); | 569 cmd_line->AppendSwitch(switches::kDisableBreakpad); |
571 | 570 |
572 GpuFeatureFlags flags = GpuDataManager::GetInstance()->GetGpuFeatureFlags(); | 571 GpuDataManager::GetInstance()->AppendGpuCommandLine(cmd_line); |
573 if (flags.flags() & GpuFeatureFlags::kGpuFeatureMultisampling) | |
574 cmd_line->AppendSwitch(switches::kDisableGLMultisampling); | |
575 | 572 |
576 // If specified, prepend a launcher program to the command line. | 573 // If specified, prepend a launcher program to the command line. |
577 if (!gpu_launcher.empty()) | 574 if (!gpu_launcher.empty()) |
578 cmd_line->PrependWrapper(gpu_launcher); | 575 cmd_line->PrependWrapper(gpu_launcher); |
579 | 576 |
580 Launch( | 577 Launch( |
581 #if defined(OS_WIN) | 578 #if defined(OS_WIN) |
582 FilePath(), | 579 FilePath(), |
583 #elif defined(OS_POSIX) | 580 #elif defined(OS_POSIX) |
584 false, // Never use the zygote (GPU plugin can't be sandboxed). | 581 false, // Never use the zygote (GPU plugin can't be sandboxed). |
(...skipping 26 matching lines...) Expand all Loading... |
611 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); | 608 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); |
612 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); | 609 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); |
613 } | 610 } |
614 | 611 |
615 void GpuProcessHost::CreateCommandBufferError( | 612 void GpuProcessHost::CreateCommandBufferError( |
616 CreateCommandBufferCallback* callback, int32 route_id) { | 613 CreateCommandBufferCallback* callback, int32 route_id) { |
617 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> | 614 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> |
618 wrapped_callback(callback); | 615 wrapped_callback(callback); |
619 callback->Run(route_id); | 616 callback->Run(route_id); |
620 } | 617 } |
OLD | NEW |