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

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

Issue 2107783003: Pass initial size and GPU preference via context attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp fix Created 4 years, 6 months 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
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.cc ('k') | gpu/gles2_conform_support/egl/context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8472a9b53e04b4660b244be8aadfde97c3373b28..b489bb4fd7bb7636baf50c473b93ff7811d51fc8 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -279,7 +279,6 @@ void GLManager::InitializeWithCommandLine(
mailbox_manager ? mailbox_manager : new gles2::MailboxManagerImpl;
share_group_ = share_group ? share_group : new gl::GLShareGroup;
- gl::GpuPreference gpu_preference(gl::PreferDiscreteGpu);
gles2::ContextCreationAttribHelper attribs;
attribs.red_size = 8;
attribs.green_size = 8;
@@ -293,6 +292,7 @@ void GLManager::InitializeWithCommandLine(
attribs.alpha_size = options.backbuffer_alpha ? 8 : 0;
attribs.should_use_native_gmb_for_backbuffer =
options.image_factory != nullptr;
+ attribs.offscreen_framebuffer_size = options.size;
if (!context_group) {
GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line);
@@ -329,23 +329,23 @@ 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(), gl::PreferIntegratedGpu));
+ ASSERT_TRUE(context_->Initialize(surface_.get(), attribs.gpu_preference));
} 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(), gl::PreferIntegratedGpu));
+ context_->Initialize(surface_.get(), attribs.gpu_preference));
} else {
context_ = gl::init::CreateGLContext(share_group_.get(), surface_.get(),
- gpu_preference);
+ attribs.gpu_preference);
}
}
ASSERT_TRUE(context_.get() != NULL) << "could not create GL context";
ASSERT_TRUE(context_->MakeCurrent(surface_.get()));
- if (!decoder_->Initialize(surface_.get(), context_.get(), true, options.size,
+ if (!decoder_->Initialize(surface_.get(), context_.get(), true,
::gpu::gles2::DisallowedFeatures(), attribs)) {
return;
}
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.cc ('k') | gpu/gles2_conform_support/egl/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698