Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 2480373002: Refactor context creation parameters into a struct. (Closed)
Patch Set: address piman's comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..b12fcadcf90b6145f03e5d76ff1af2289125cd72 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,9 @@ 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);
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(),
+ gl::GLContextAttribs()));
#endif
}
++use_count_;

Powered by Google App Engine
This is Rietveld 408576698