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

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

Issue 1930633002: Fix gpu_ipc_service_unittests on mac_chromium_rel_ng by managing GL shared groups the same way in s… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | ui/gl/gl_context_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c533a6f460f1bb370d39b1f44d3c701ddc09b9d1..b90275aae15abbc1372ac069b8c65cde9758b463 100644
--- a/gpu/ipc/service/gpu_command_buffer_stub.cc
+++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -39,6 +39,7 @@
#include "gpu/ipc/service/image_transport_surface.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_image.h"
+#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_switches.h"
#if defined(OS_WIN)
@@ -563,7 +564,7 @@ void GpuCommandBufferStub::OnInitialize(
context = share_group->GetSharedContext();
if (!context.get()) {
context = gfx::GLContext::CreateGLContext(
- channel_->share_group(),
+ share_group,
channel_->gpu_channel_manager()->GetDefaultOffscreenSurface(),
gpu_preference_);
if (!context.get()) {
@@ -571,10 +572,16 @@ void GpuCommandBufferStub::OnInitialize(
OnInitializeFailed(reply_message);
return;
}
- channel_->share_group()->SetSharedContext(context.get());
+ // Ensure that context creation did not lose track of the intended
+ // share_group.
+ DCHECK(context->share_group() == share_group);
+ share_group->SetSharedContext(context.get());
}
- // This should be a non-virtual GL context.
- DCHECK(context->GetHandle());
+ // This should be either:
+ // (1) a non-virtual GL context, or
+ // (2) a mock context.
+ DCHECK(context->GetHandle() ||
+ gfx::GetGLImplementation() == gfx::kGLImplementationMockGL);
context = new GLContextVirtual(
share_group, context.get(), decoder_->AsWeakPtr());
if (!context->Initialize(surface_.get(), gpu_preference_)) {
« no previous file with comments | « no previous file | ui/gl/gl_context_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698