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

Unified Diff: gpu/ipc/service/gpu_command_buffer_stub.cc

Issue 2480373002: Refactor context creation parameters into a struct. (Closed)
Patch Set: 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/ipc/service/gpu_command_buffer_stub.cc
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc
index 74b419744071f3172560048b503086c3ec6600b4..964cc2f49154cc17edd9113ca499aede0e708af7 100644
--- a/gpu/ipc/service/gpu_command_buffer_stub.cc
+++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -27,6 +27,7 @@
#include "gpu/command_buffer/service/mailbox_manager.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 "gpu/ipc/common/gpu_messages.h"
@@ -537,8 +538,10 @@ bool GpuCommandBufferStub::Initialize(
if (use_virtualized_gl_context_ && gl_share_group) {
context = gl_share_group->GetSharedContext(surface_.get());
if (!context.get()) {
- context = gl::init::CreateGLContext(gl_share_group, surface_.get(),
- init_params.attribs.gpu_preference);
+ context = gl::init::CreateGLContext(
+ gl_share_group, surface_.get(),
+ GenerateGLContextAttribs(init_params.attribs,
+ context_group_->gpu_preferences()));
if (!context.get()) {
DLOG(ERROR) << "Failed to create shared context for virtualization.";
return false;
@@ -555,8 +558,10 @@ bool GpuCommandBufferStub::Initialize(
gl::GetGLImplementation() == gl::kGLImplementationMockGL);
context = new GLContextVirtual(
gl_share_group, context.get(), decoder_->AsWeakPtr());
- if (!context->Initialize(surface_.get(),
- init_params.attribs.gpu_preference)) {
+ if (!context->Initialize(
+ surface_.get(),
+ GenerateGLContextAttribs(init_params.attribs,
+ context_group_->gpu_preferences()))) {
// The real context created above for the default offscreen surface
// might not be compatible with this surface.
context = NULL;
@@ -565,8 +570,10 @@ bool GpuCommandBufferStub::Initialize(
}
}
if (!context.get()) {
- context = gl::init::CreateGLContext(gl_share_group, surface_.get(),
- init_params.attribs.gpu_preference);
+ context = gl::init::CreateGLContext(
+ gl_share_group, surface_.get(),
+ GenerateGLContextAttribs(init_params.attribs,
+ context_group_->gpu_preferences()));
}
if (!context.get()) {
DLOG(ERROR) << "Failed to create context.";

Powered by Google App Engine
This is Rietveld 408576698