Index: webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc |
=================================================================== |
--- webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc (revision 261815) |
+++ webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc (working copy) |
@@ -73,20 +73,29 @@ |
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> |
WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( |
const blink::WebGraphicsContext3D::Attributes& attributes, |
+ bool lose_context_when_out_of_memory, |
gfx::AcceleratedWidget window) { |
DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone); |
+ bool is_offscreen = false; |
return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl( |
- scoped_ptr< ::gpu::GLInProcessContext>(), attributes, false, window)); |
+ scoped_ptr< ::gpu::GLInProcessContext>(), |
+ attributes, |
+ lose_context_when_out_of_memory, |
+ is_offscreen, |
+ window)); |
} |
// static |
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> |
WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( |
- const blink::WebGraphicsContext3D::Attributes& attributes) { |
+ const blink::WebGraphicsContext3D::Attributes& attributes, |
+ bool lose_context_when_out_of_memory) { |
+ bool is_offscreen = true; |
return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl( |
scoped_ptr< ::gpu::GLInProcessContext>(), |
attributes, |
- true, |
+ lose_context_when_out_of_memory, |
+ is_offscreen, |
gfx::kNullAcceleratedWidget)); |
} |
@@ -94,10 +103,13 @@ |
WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( |
scoped_ptr< ::gpu::GLInProcessContext> context, |
const blink::WebGraphicsContext3D::Attributes& attributes) { |
+ bool lose_context_when_out_of_memory = false; // Not used. |
+ bool is_offscreen = true; // Not used. |
return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl( |
context.Pass(), |
attributes, |
- true /* is_offscreen. Not used. */, |
+ lose_context_when_out_of_memory, |
+ is_offscreen, |
gfx::kNullAcceleratedWidget /* window. Not used. */)); |
} |
@@ -105,6 +117,7 @@ |
WebGraphicsContext3DInProcessCommandBufferImpl( |
scoped_ptr< ::gpu::GLInProcessContext> context, |
const blink::WebGraphicsContext3D::Attributes& attributes, |
+ bool lose_context_when_out_of_memory, |
bool is_offscreen, |
gfx::AcceleratedWidget window) |
: is_offscreen_(is_offscreen), |
@@ -116,8 +129,8 @@ |
context_lost_callback_(NULL), |
context_lost_reason_(GL_NO_ERROR), |
attributes_(attributes), |
- flush_id_(0) { |
-} |
+ lose_context_when_out_of_memory_(lose_context_when_out_of_memory), |
+ flush_id_(0) {} |
WebGraphicsContext3DInProcessCommandBufferImpl:: |
~WebGraphicsContext3DInProcessCommandBufferImpl() { |
@@ -155,7 +168,9 @@ |
gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; |
::gpu::GLInProcessContextAttribs attrib_struct; |
- ConvertAttributes(attributes_, &attrib_struct), |
+ ConvertAttributes(attributes_, &attrib_struct); |
+ attrib_struct.lose_context_when_out_of_memory = |
+ lose_context_when_out_of_memory_; |
context_.reset(GLInProcessContext::CreateContext( |
is_offscreen_, |