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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 79123004: Implemented failIfMajorPerformanceCaveat WebGL context creation attribute. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
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) {
« gpu/command_buffer/common/gles2_cmd_utils.cc ('K') | « gpu/command_buffer/common/gles2_cmd_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698