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

Side by Side Diff: blimp/client/feature/compositor/blimp_context_provider.cc

Issue 1864373002: Remove unused features for in-process GL contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: inproclost: callback 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "blimp/client/feature/compositor/blimp_context_provider.h" 5 #include "blimp/client/feature/compositor/blimp_context_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "gpu/command_buffer/client/gl_in_process_context.h" 10 #include "gpu/command_buffer/client/gl_in_process_context.h"
(...skipping 24 matching lines...) Expand all
35 attribs_for_gles2.stencil_size = 0; 35 attribs_for_gles2.stencil_size = 0;
36 attribs_for_gles2.samples = 0; 36 attribs_for_gles2.samples = 0;
37 attribs_for_gles2.sample_buffers = 0; 37 attribs_for_gles2.sample_buffers = 0;
38 attribs_for_gles2.fail_if_major_perf_caveat = false; 38 attribs_for_gles2.fail_if_major_perf_caveat = false;
39 attribs_for_gles2.bind_generates_resource = false; 39 attribs_for_gles2.bind_generates_resource = false;
40 attribs_for_gles2.context_type = gpu::gles2::CONTEXT_TYPE_OPENGLES2; 40 attribs_for_gles2.context_type = gpu::gles2::CONTEXT_TYPE_OPENGLES2;
41 attribs_for_gles2.lose_context_when_out_of_memory = true; 41 attribs_for_gles2.lose_context_when_out_of_memory = true;
42 42
43 context_.reset(gpu::GLInProcessContext::Create( 43 context_.reset(gpu::GLInProcessContext::Create(
44 nullptr /* service */, nullptr /* surface */, false /* is_offscreen */, 44 nullptr /* service */, nullptr /* surface */, false /* is_offscreen */,
45 widget, gfx::Size(1, 1), nullptr /* share_context */, 45 widget, gfx::Size(1, 1), nullptr /* share_context */, attribs_for_gles2,
46 false /* share_resources */, attribs_for_gles2, gfx::PreferDiscreteGpu, 46 gfx::PreferDiscreteGpu, gpu::GLInProcessContextSharedMemoryLimits(),
47 gpu::GLInProcessContextSharedMemoryLimits(),
48 gpu_memory_buffer_manager, nullptr /* memory_limits */)); 47 gpu_memory_buffer_manager, nullptr /* memory_limits */));
49 context_->SetContextLostCallback( 48 context_->SetContextLostCallback(
50 base::Bind(&BlimpContextProvider::OnLostContext, base::Unretained(this))); 49 base::Bind(&BlimpContextProvider::OnLostContext, base::Unretained(this)));
51 } 50 }
52 51
53 BlimpContextProvider::~BlimpContextProvider() { 52 BlimpContextProvider::~BlimpContextProvider() {
54 DCHECK(main_thread_checker_.CalledOnValidThread() || 53 DCHECK(main_thread_checker_.CalledOnValidThread() ||
55 context_thread_checker_.CalledOnValidThread()); 54 context_thread_checker_.CalledOnValidThread());
56 if (gr_context_) 55 if (gr_context_)
57 gr_context_->releaseResourcesAndAbandonContext(); 56 gr_context_->releaseResourcesAndAbandonContext();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void BlimpContextProvider::OnLostContext() { 128 void BlimpContextProvider::OnLostContext() {
130 DCHECK(context_thread_checker_.CalledOnValidThread()); 129 DCHECK(context_thread_checker_.CalledOnValidThread());
131 if (!lost_context_callback_.is_null()) 130 if (!lost_context_callback_.is_null())
132 base::ResetAndReturn(&lost_context_callback_).Run(); 131 base::ResetAndReturn(&lost_context_callback_).Run();
133 if (gr_context_) 132 if (gr_context_)
134 gr_context_->abandonContext(); 133 gr_context_->abandonContext();
135 } 134 }
136 135
137 } // namespace client 136 } // namespace client
138 } // namespace blimp 137 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698