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

Unified Diff: gpu/command_buffer/service/in_process_command_buffer.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/service/in_process_command_buffer.cc
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index ab7da8285657df8baf1a008f373ca5d494d66cde..839a766988f4145ab3063e65aceffbb2ea4a3b01 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -37,6 +37,7 @@
#include "gpu/command_buffer/service/memory_program_cache.h"
#include "gpu/command_buffer/service/memory_tracking.h"
#include "gpu/command_buffer/service/query_manager.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 "ui/gfx/geometry/size.h"
@@ -363,20 +364,28 @@ bool InProcessCommandBuffer::InitializeOnGpuThread(
context_ = gl_share_group_->GetSharedContext(surface_.get());
if (!context_.get()) {
context_ = gl::init::CreateGLContext(
- gl_share_group_.get(), surface_.get(), params.attribs.gpu_preference);
+ gl_share_group_.get(), surface_.get(),
+ GenerateGLContextAttribs(
+ params.attribs, decoder_->GetContextGroup()->gpu_preferences()));
gl_share_group_->SetSharedContext(surface_.get(), context_.get());
}
context_ = new GLContextVirtual(
gl_share_group_.get(), context_.get(), decoder_->AsWeakPtr());
- if (context_->Initialize(surface_.get(), params.attribs.gpu_preference)) {
+ if (context_->Initialize(
+ surface_.get(),
+ GenerateGLContextAttribs(
+ params.attribs,
+ decoder_->GetContextGroup()->gpu_preferences()))) {
VLOG(1) << "Created virtual GL context.";
} else {
context_ = NULL;
}
} else {
- context_ = gl::init::CreateGLContext(gl_share_group_.get(), surface_.get(),
- params.attribs.gpu_preference);
+ context_ = gl::init::CreateGLContext(
+ gl_share_group_.get(), surface_.get(),
+ GenerateGLContextAttribs(
+ params.attribs, decoder_->GetContextGroup()->gpu_preferences()));
}
if (!context_.get()) {

Powered by Google App Engine
This is Rietveld 408576698