const GURL& active_url,
GpuChannelHost* host,
const Attributes& attributes,
+#if !defined(OS_CHROMEOS)
bool bind_generates_resources,
+#endif
+ bool lose_context_when_out_of_memory,
const SharedMemoryLimits& limits,
WebGraphicsContext3DCommandBufferImpl* share_context)
: initialize_failed_(false),
weak_ptr_factory_(this),
initialized_(false),
gl_(NULL),
+#if !defined(OS_CHROMEOS)
bind_generates_resources_(bind_generates_resources),
+#endif
+ lose_context_when_out_of_memory_(lose_context_when_out_of_memory),
mem_limits_(limits),
flush_id_(0) {
if (share_context) {
attribs.push_back(attributes_.antialias ? 1 : 0);
attribs.push_back(FAIL_IF_MAJOR_PERF_CAVEAT);
attribs.push_back(attributes_.failIfMajorPerformanceCaveat ? 1 : 0);
+ attribs.push_back(LOSE_CONTEXT_WHEN_OUT_OF_MEMORY);
+ attribs.push_back(lose_context_when_out_of_memory_ ? 1 : 0);
+#if defined(OS_CHROMEOS)
+ attribs.push_back(BIND_GENERATES_RESOURCES);
+ attribs.push_back(0);
+#endif
attribs.push_back(NONE);
// Create a proxy to a command buffer in the GPU process.
DCHECK(host_.get());
// Create the object exposing the OpenGL API.
- real_gl_.reset(new gpu::gles2::GLES2Implementation(
- gles2_helper_.get(),
- gles2_share_group,
- transfer_buffer_.get(),
- bind_generates_resources_,
- command_buffer_.get()));
+#if defined(OS_CHROMEOS)
+ bool bind_generates_resources = false;
+#endif
+
+ real_gl_.reset(
+ new gpu::gles2::GLES2Implementation(gles2_helper_.get(),
+ gles2_share_group,
+ transfer_buffer_.get(),
+#if defined(OS_CHROMEOS)
+ bind_generates_resources,
+#else
+ bind_generates_resources_,
+#endif
+ lose_context_when_out_of_memory_,
+ command_buffer_.get()));
gl_ = real_gl_.get();
if (!real_gl_->Initialize(
WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
GpuChannelHost* host,
const WebGraphicsContext3D::Attributes& attributes,
+ bool lose_context_when_out_of_memory,
const GURL& active_url,
const SharedMemoryLimits& limits,
WebGraphicsContext3DCommandBufferImpl* share_context) {
if (share_context && share_context->IsCommandBufferContextLost())
return NULL;
-
- return new WebGraphicsContext3DCommandBufferImpl(0,
- active_url,
- host,
- attributes,
- false,
- limits,
- share_context);
+#if !defined(OS_CHROMEOS)
+ bool bind_generates_resources = false;
+#endif
+ return new WebGraphicsContext3DCommandBufferImpl(
+ 0,
+ active_url,
+ host,
+ attributes,
+#if !defined(OS_CHROMEOS)
+ bind_generates_resources,
+#endif
+ lose_context_when_out_of_memory,
+ limits,
+ share_context);
}
DELEGATE_TO_GL_5(texImageIOSurface2DCHROMIUM, TexImageIOSurface2DCHROMIUM,