| Index: gpu/command_buffer/tests/gl_manager.cc
|
| diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
|
| index c5f70877703c8fb7d519bcd6eb18cf97274e0132..88d901b92cd907ca6bc955d4f4bf3bb2c7f8e68c 100644
|
| --- a/gpu/command_buffer/tests/gl_manager.cc
|
| +++ b/gpu/command_buffer/tests/gl_manager.cc
|
| @@ -109,8 +109,7 @@ GLManager::Options::Options()
|
| bind_generates_resource(false),
|
| lose_context_when_out_of_memory(false),
|
| context_lost_allowed(false),
|
| - webgl_version(0) {
|
| -}
|
| + context_type(CONTEXT_TYPE_OPENGLES2) {}
|
|
|
| GLManager::GLManager() : context_lost_allowed_(false) {
|
| SetupBaseContext();
|
| @@ -197,7 +196,25 @@ void GLManager::InitializeWithCommandLine(const GLManager::Options& options,
|
| attrib_helper.alpha_size = 8;
|
| attrib_helper.depth_size = 16;
|
| attrib_helper.stencil_size = 8;
|
| - attrib_helper.webgl_version = options.webgl_version;
|
| + switch (options.context_type) {
|
| + case CONTEXT_TYPE_WEBGL1:
|
| + attrib_helper.context_type =
|
| + gles2::ContextCreationAttribHelper::CONTEXT_TYPE_WEBGL1;
|
| + break;
|
| + case CONTEXT_TYPE_WEBGL2:
|
| + attrib_helper.context_type =
|
| + gles2::ContextCreationAttribHelper::CONTEXT_TYPE_WEBGL2;
|
| + break;
|
| + case CONTEXT_TYPE_OPENGLES2:
|
| + attrib_helper.context_type =
|
| + gles2::ContextCreationAttribHelper::CONTEXT_TYPE_OPENGLES2;
|
| + break;
|
| + case CONTEXT_TYPE_OPENGLES3:
|
| + attrib_helper.context_type =
|
| + gles2::ContextCreationAttribHelper::CONTEXT_TYPE_OPENGLES3;
|
| + break;
|
| + }
|
| +
|
| attrib_helper.Serialize(&attribs);
|
|
|
| DCHECK(!command_line || !context_group);
|
| @@ -248,13 +265,10 @@ void GLManager::InitializeWithCommandLine(const GLManager::Options& options,
|
|
|
| ASSERT_TRUE(context_->MakeCurrent(surface_.get()));
|
|
|
| - ASSERT_TRUE(decoder_->Initialize(
|
| - surface_.get(),
|
| - context_.get(),
|
| - true,
|
| - options.size,
|
| - ::gpu::gles2::DisallowedFeatures(),
|
| - attribs)) << "could not initialize decoder";
|
| + if (!decoder_->Initialize(surface_.get(), context_.get(), true, options.size,
|
| + ::gpu::gles2::DisallowedFeatures(), attribs)) {
|
| + return;
|
| + }
|
|
|
| command_buffer_->SetPutOffsetChangeCallback(
|
| base::Bind(&GLManager::PumpCommands, base::Unretained(this)));
|
| @@ -326,7 +340,8 @@ void GLManager::Destroy() {
|
| gles2_helper_.reset();
|
| command_buffer_.reset();
|
| if (decoder_.get()) {
|
| - bool have_context = decoder_->GetGLContext()->MakeCurrent(surface_.get());
|
| + bool have_context = decoder_->GetGLContext() &&
|
| + decoder_->GetGLContext()->MakeCurrent(surface_.get());
|
| decoder_->Destroy(have_context);
|
| decoder_.reset();
|
| }
|
|
|