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

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

Issue 1325433003: command_buffer: Add support for creating non-WebGL ES 3 contexts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing hunk Created 5 years, 3 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
« no previous file with comments | « no previous file | components/html_viewer/web_graphics_context_3d_command_buffer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/compositor/blimp_context_provider.h" 5 #include "blimp/client/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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 context_thread_checker_.DetachFromThread(); 51 context_thread_checker_.DetachFromThread();
52 52
53 gpu::gles2::ContextCreationAttribHelper attribs_for_gles2; 53 gpu::gles2::ContextCreationAttribHelper attribs_for_gles2;
54 attribs_for_gles2.alpha_size = 8; 54 attribs_for_gles2.alpha_size = 8;
55 attribs_for_gles2.depth_size = 0; 55 attribs_for_gles2.depth_size = 0;
56 attribs_for_gles2.stencil_size = 0; 56 attribs_for_gles2.stencil_size = 0;
57 attribs_for_gles2.samples = 0; 57 attribs_for_gles2.samples = 0;
58 attribs_for_gles2.sample_buffers = 0; 58 attribs_for_gles2.sample_buffers = 0;
59 attribs_for_gles2.fail_if_major_perf_caveat = false; 59 attribs_for_gles2.fail_if_major_perf_caveat = false;
60 attribs_for_gles2.bind_generates_resource = false; 60 attribs_for_gles2.bind_generates_resource = false;
61 attribs_for_gles2.webgl_version = 0; 61 attribs_for_gles2.context_type = gpu::gles2::CONTEXT_TYPE_OPENGLES2;
62 attribs_for_gles2.lose_context_when_out_of_memory = true; 62 attribs_for_gles2.lose_context_when_out_of_memory = true;
63 63
64 context_.reset(gpu::GLInProcessContext::Create( 64 context_.reset(gpu::GLInProcessContext::Create(
65 nullptr /* service */, nullptr /* surface */, false /* is_offscreen */, 65 nullptr /* service */, nullptr /* surface */, false /* is_offscreen */,
66 widget, gfx::Size(1, 1), nullptr /* share_context */, 66 widget, gfx::Size(1, 1), nullptr /* share_context */,
67 false /* share_resources */, attribs_for_gles2, gfx::PreferDiscreteGpu, 67 false /* share_resources */, attribs_for_gles2, gfx::PreferDiscreteGpu,
68 gpu::GLInProcessContextSharedMemoryLimits(), 68 gpu::GLInProcessContextSharedMemoryLimits(),
69 nullptr /* gpu_memory_buffer_manager */, nullptr /* memory_limits */)); 69 nullptr /* gpu_memory_buffer_manager */, nullptr /* memory_limits */));
70 context_->SetContextLostCallback( 70 context_->SetContextLostCallback(
71 base::Bind(&BlimpContextProvider::OnLostContext, base::Unretained(this))); 71 base::Bind(&BlimpContextProvider::OnLostContext, base::Unretained(this)));
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 destroyed_ = true; 179 destroyed_ = true;
180 } 180 }
181 181
182 if (!lost_context_callback_.is_null()) 182 if (!lost_context_callback_.is_null())
183 base::ResetAndReturn(&lost_context_callback_).Run(); 183 base::ResetAndReturn(&lost_context_callback_).Run();
184 if (gr_context_) 184 if (gr_context_)
185 gr_context_->abandonContext(); 185 gr_context_->abandonContext();
186 } 186 }
187 187
188 } // namespace blimp 188 } // namespace blimp
OLDNEW
« no previous file with comments | « no previous file | components/html_viewer/web_graphics_context_3d_command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698