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 1db894ffdd853d6a4a2172bfccad7c5836241de6..2b5e559ba64fd5c1386c15c183131f03ef7df3ed 100644 |
--- a/gpu/command_buffer/client/gl_in_process_context.cc |
+++ b/gpu/command_buffer/client/gl_in_process_context.cc |
@@ -147,6 +147,7 @@ bool GLInProcessContextImpl::Initialize( |
// Chromium-specific attributes |
const int32 FAIL_IF_MAJOR_PERF_CAVEAT = 0x10002; |
+ const int32 LOSE_CONTEXT_WHEN_OUT_OF_MEMORY = 0x10003; |
std::vector<int32> attrib_vector; |
if (attribs.alpha_size >= 0) { |
@@ -185,6 +186,10 @@ bool GLInProcessContextImpl::Initialize( |
attrib_vector.push_back(FAIL_IF_MAJOR_PERF_CAVEAT); |
attrib_vector.push_back(attribs.fail_if_major_perf_caveat); |
} |
+ if (attribs.lose_context_when_out_of_memory > 0) { |
+ attrib_vector.push_back(LOSE_CONTEXT_WHEN_OUT_OF_MEMORY); |
+ attrib_vector.push_back(attribs.lose_context_when_out_of_memory); |
+ } |
attrib_vector.push_back(NONE); |
base::Closure wrapped_callback = |
@@ -250,6 +255,7 @@ bool GLInProcessContextImpl::Initialize( |
share_group, |
transfer_buffer_.get(), |
bind_generates_resources, |
+ attribs.lose_context_when_out_of_memory > 0, |
command_buffer_.get())); |
if (use_global_share_group) { |
@@ -302,7 +308,9 @@ GLInProcessContextAttribs::GLInProcessContextAttribs() |
depth_size(-1), |
stencil_size(-1), |
samples(-1), |
- sample_buffers(-1) {} |
+ sample_buffers(-1), |
+ fail_if_major_perf_caveat(-1), |
+ lose_context_when_out_of_memory(-1) {} |
// static |
GLInProcessContext* GLInProcessContext::CreateContext( |