Chromium Code Reviews| 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 482efa619e29dd0e39436fe17f2f9ae7fbfd65de..a7647785e304c3878be15879c84772ce77a00b1b 100644 |
| --- a/gpu/command_buffer/tests/gl_manager.cc |
| +++ b/gpu/command_buffer/tests/gl_manager.cc |
| @@ -34,6 +34,7 @@ |
| #include "gpu/command_buffer/service/image_manager.h" |
| #include "gpu/command_buffer/service/mailbox_manager_impl.h" |
| #include "gpu/command_buffer/service/memory_tracking.h" |
| +#include "gpu/command_buffer/service/service_utils.h" |
| #include "gpu/command_buffer/service/sync_point_manager.h" |
| #include "gpu/command_buffer/service/transfer_buffer_manager.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -325,16 +326,20 @@ void GLManager::InitializeWithCommandLine( |
| if (base_context_) { |
| context_ = scoped_refptr<gl::GLContext>(new gpu::GLContextVirtual( |
| share_group_.get(), base_context_->get(), decoder_->AsWeakPtr())); |
| - ASSERT_TRUE(context_->Initialize(surface_.get(), attribs.gpu_preference)); |
| + ASSERT_TRUE(context_->Initialize( |
| + surface_.get(), |
| + GenerateGLContextAttribs(attribs, context_group->gpu_preferences()))); |
| } else { |
| if (real_gl_context) { |
| context_ = scoped_refptr<gl::GLContext>(new gpu::GLContextVirtual( |
| share_group_.get(), real_gl_context, decoder_->AsWeakPtr())); |
| - ASSERT_TRUE( |
| - context_->Initialize(surface_.get(), attribs.gpu_preference)); |
| + ASSERT_TRUE(context_->Initialize( |
| + surface_.get(), |
| + GenerateGLContextAttribs(attribs, context_group->gpu_preferences()))); |
| } else { |
| - context_ = gl::init::CreateGLContext(share_group_.get(), surface_.get(), |
| - attribs.gpu_preference); |
| + context_ = gl::init::CreateGLContext( |
| + share_group_.get(), surface_.get(), |
| + GenerateGLContextAttribs(attribs, context_group->gpu_preferences())); |
| } |
| } |
| ASSERT_TRUE(context_.get() != NULL) << "could not create GL context"; |
| @@ -398,9 +403,10 @@ void GLManager::SetupBaseContext() { |
| gfx::Size size(4, 4); |
| base_surface_ = new scoped_refptr<gl::GLSurface>( |
| gl::init::CreateOffscreenGLSurface(size)); |
| - gl::GpuPreference gpu_preference(gl::PreferDiscreteGpu); |
| + gl::GLContextAttribs context_attribs; |
| + context_attribs.gpu_preference = gl::PreferDiscreteGpu; |
|
piman
2016/11/07 21:01:01
nit: ditto, on Android, we can use the default.
Geoff Lang
2016/11/07 21:36:20
Done.
|
| base_context_ = new scoped_refptr<gl::GLContext>(gl::init::CreateGLContext( |
| - base_share_group_->get(), base_surface_->get(), gpu_preference)); |
| + base_share_group_->get(), base_surface_->get(), context_attribs)); |
| #endif |
| } |
| ++use_count_; |