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

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: More comments, logging updates 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 4633580ed724699cb4f31e39b9f486911b15e395..3364f0caf44471d39cb4d2bcc483135ba81e00fe 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -909,9 +909,9 @@ class GLES2DecoderImpl : public GLES2Decoder,
void LogClientServiceMapping(
const char* function_name, GLuint client_id, GLuint service_id) {
if (service_logging_) {
- DLOG(INFO) << "[" << logger_.GetLogPrefix() << "] " << function_name
- << ": client_id = " << client_id
- << ", service_id = " << service_id;
+ VLOG(1) << "[" << logger_.GetLogPrefix() << "] " << function_name
+ << ": client_id = " << client_id
+ << ", service_id = " << service_id;
}
}
template<typename T>
@@ -2215,6 +2215,19 @@ bool GLES2DecoderImpl::Initialize(
context_ = context;
surface_ = surface;
+ ContextCreationAttribHelper attrib_parser;
+ 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_ &&
+ feature_info_->feature_flags().is_swiftshader) {
+ group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
+ Destroy(true);
+ return false;
+ }
+
if (!group_->Initialize(this, disallowed_features)) {
LOG(ERROR) << "GpuScheduler::InitializeCommon failed because group "
<< "failed to initialize.";
@@ -2277,10 +2290,6 @@ bool GLES2DecoderImpl::Initialize(
glActiveTexture(GL_TEXTURE0);
CHECK_GL_ERROR();
- ContextCreationAttribHelper attrib_parser;
- if (!attrib_parser.Parse(attribs))
- return false;
-
if (offscreen) {
if (attrib_parser.samples_ > 0 && attrib_parser.sample_buffers_ > 0 &&
features().chromium_framebuffer_multisample) {
@@ -3481,7 +3490,7 @@ error::Error GLES2DecoderImpl::DoCommand(
error::Error result = error::kNoError;
if (log_commands()) {
// TODO(notme): Change this to a LOG/VLOG that works in release. Tried
- // LOG(INFO), tried VLOG(1), no luck.
+ // VLOG(1), no luck.
LOG(ERROR) << "[" << logger_.GetLogPrefix() << "]" << "cmd: "
<< GetCommandName(command);
}
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698