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

Unified Diff: gpu/command_buffer/client/gl_in_process_context.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
« no previous file with comments | « gpu/command_buffer/client/gl_in_process_context.h ('k') | gpu/command_buffer/common/gles2_cmd_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gl_in_process_context.cc
diff --git a/gpu/command_buffer/client/gl_in_process_context.cc b/gpu/command_buffer/client/gl_in_process_context.cc
index a1ca1a2727e60745f7d504c4711b5ccdf89a094a..ab5cedebddff17c2697e5f7989761c3e35003d42 100644
--- a/gpu/command_buffer/client/gl_in_process_context.cc
+++ b/gpu/command_buffer/client/gl_in_process_context.cc
@@ -128,6 +128,9 @@ bool GLInProcessContextImpl::Initialize(
gfx::GpuPreference gpu_preference) {
DCHECK(size.width() >= 0 && size.height() >= 0);
+ // Changes to these values should also be copied to
+ // gpu/command_buffer/client/gl_in_process_context.cc and to
+ // content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
const int32 ALPHA_SIZE = 0x3021;
const int32 BLUE_SIZE = 0x3022;
const int32 GREEN_SIZE = 0x3023;
@@ -138,6 +141,9 @@ bool GLInProcessContextImpl::Initialize(
const int32 SAMPLE_BUFFERS = 0x3032;
const int32 NONE = 0x3038;
+ // Chromium-specific attributes
+ const int32 FAIL_IF_MAJOR_PERF_CAVEAT = 0x10002;
+
std::vector<int32> attrib_vector;
if (attribs.alpha_size >= 0) {
attrib_vector.push_back(ALPHA_SIZE);
@@ -171,6 +177,10 @@ bool GLInProcessContextImpl::Initialize(
attrib_vector.push_back(SAMPLE_BUFFERS);
attrib_vector.push_back(attribs.sample_buffers);
}
+ if (attribs.fail_if_major_perf_caveat > 0) {
+ attrib_vector.push_back(FAIL_IF_MAJOR_PERF_CAVEAT);
+ attrib_vector.push_back(attribs.fail_if_major_perf_caveat);
+ }
attrib_vector.push_back(NONE);
base::Closure wrapped_callback =
@@ -207,14 +217,14 @@ bool GLInProcessContextImpl::Initialize(
gpu_preference,
wrapped_callback,
share_group_id_)) {
- LOG(INFO) << "Failed to initialize InProcessCommmandBuffer";
+ LOG(ERROR) << "Failed to initialize InProcessCommmandBuffer";
return false;
}
// Create the GLES2 helper, which writes the command buffer protocol.
gles2_helper_.reset(new gles2::GLES2CmdHelper(command_buffer_.get()));
if (!gles2_helper_->Initialize(kCommandBufferSize)) {
- LOG(INFO) << "Failed to initialize GLES2CmdHelper";
+ LOG(ERROR) << "Failed to initialize GLES2CmdHelper";
Destroy();
return false;
}
« no previous file with comments | « gpu/command_buffer/client/gl_in_process_context.h ('k') | gpu/command_buffer/common/gles2_cmd_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698