 Chromium Code Reviews
 Chromium Code Reviews Issue 79123004:
  Implemented failIfMajorPerformanceCaveat WebGL context creation attribute.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 79123004:
  Implemented failIfMajorPerformanceCaveat WebGL context creation attribute.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| index 2b792130c00fe8cfa55c2bff58e1790879ceacc6..ecb1b9f233b26d9608196b2dedaa2c6b0c14bc99 100644 | 
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| @@ -2281,6 +2281,20 @@ bool GLES2DecoderImpl::Initialize( | 
| if (!attrib_parser.Parse(attribs)) | 
| return false; | 
| + // If the failIfMajorPerformanceCaveat context creation attribute was true | 
| + // and we are using a software renderer, fail. | 
| + if (attrib_parser.fail_if_major_perf_caveat_) { | 
| + CommandLine* command_line = CommandLine::ForCurrentProcess(); | 
| + if (command_line->HasSwitch(switches::kUseGL)) { | 
| 
Zhenyao Mo
2013/11/20 22:44:57
You don't have to check here.  If kUseGL is not th
 | 
| + std::string requested_implementation_name = | 
| + command_line->GetSwitchValueASCII(switches::kUseGL); | 
| + if (requested_implementation_name == "swiftshader") { | 
| 
piman
2013/11/20 22:44:55
Can we move the logic about "is this swiftshader"
 | 
| + Destroy(true); | 
| + return false; | 
| 
Ken Russell (switch to Gerrit)
2013/11/20 22:39:02
How has this been tested?
 | 
| + } | 
| + } | 
| + } | 
| + | 
| if (offscreen) { | 
| if (attrib_parser.samples_ > 0 && attrib_parser.sample_buffers_ > 0 && | 
| features().chromium_framebuffer_multisample) { |