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

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

Issue 2629633003: Refactor GL bindings so there is no global GLApi or DriverGL. (Closed)
Patch Set: rebase Created 3 years, 11 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/ipc/service/gpu_channel_unittest.cc ('k') | gpu/ipc/service/image_transport_surface_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 3f41a30555095398eacb3ddab053551bfa5bfb3d..b05dfd5aec2268ac013687a2d673606fb05f0945 100644
--- a/gpu/ipc/service/gpu_command_buffer_stub.cc
+++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -530,15 +530,17 @@ void GpuCommandBufferStub::Destroy() {
for (auto& observer : destruction_observers_)
observer.OnWillDestroyStub();
+ // Remove this after crbug.com/248395 is sorted out.
+ // Destroy the surface before the context, some surface destructors make GL
+ // calls.
+ surface_ = nullptr;
+
if (decoder_) {
decoder_->Destroy(have_context);
decoder_.reset();
}
command_buffer_.reset();
-
- // Remove this after crbug.com/248395 is sorted out.
- surface_ = NULL;
}
bool GpuCommandBufferStub::Initialize(
@@ -654,9 +656,10 @@ bool GpuCommandBufferStub::Initialize(
}
// This should be either:
// (1) a non-virtual GL context, or
- // (2) a mock context.
+ // (2) a mock/stub context.
DCHECK(context->GetHandle() ||
- gl::GetGLImplementation() == gl::kGLImplementationMockGL);
+ gl::GetGLImplementation() == gl::kGLImplementationMockGL ||
+ gl::GetGLImplementation() == gl::kGLImplementationStubGL);
context = new GLContextVirtual(
gl_share_group, context.get(), decoder_->AsWeakPtr());
if (!context->Initialize(
« no previous file with comments | « gpu/ipc/service/gpu_channel_unittest.cc ('k') | gpu/ipc/service/image_transport_surface_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698