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

Side by Side Diff: gpu/blink/webgraphicscontext3d_impl.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: gn 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/blink/webgraphicscontext3d_impl.h" 5 #include "gpu/blink/webgraphicscontext3d_impl.h"
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "gpu/GLES2/gl2extchromium.h" 10 #include "gpu/GLES2/gl2extchromium.h"
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 const blink::WebGraphicsContext3D::Attributes& attributes, 1237 const blink::WebGraphicsContext3D::Attributes& attributes,
1238 ::gpu::gles2::ContextCreationAttribHelper* output_attribs) { 1238 ::gpu::gles2::ContextCreationAttribHelper* output_attribs) {
1239 output_attribs->alpha_size = attributes.alpha ? 8 : 0; 1239 output_attribs->alpha_size = attributes.alpha ? 8 : 0;
1240 output_attribs->depth_size = attributes.depth ? 24 : 0; 1240 output_attribs->depth_size = attributes.depth ? 24 : 0;
1241 output_attribs->stencil_size = attributes.stencil ? 8 : 0; 1241 output_attribs->stencil_size = attributes.stencil ? 8 : 0;
1242 output_attribs->samples = attributes.antialias ? 4 : 0; 1242 output_attribs->samples = attributes.antialias ? 4 : 0;
1243 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; 1243 output_attribs->sample_buffers = attributes.antialias ? 1 : 0;
1244 output_attribs->fail_if_major_perf_caveat = 1244 output_attribs->fail_if_major_perf_caveat =
1245 attributes.failIfMajorPerformanceCaveat; 1245 attributes.failIfMajorPerformanceCaveat;
1246 output_attribs->bind_generates_resource = false; 1246 output_attribs->bind_generates_resource = false;
1247 output_attribs->webgl_version = attributes.webGLVersion; 1247 switch (attributes.webGLVersion) {
1248 default:
Zhenyao Mo 2015/08/28 17:16:24 nit: move default to the last.
Kimmo Kinnunen 2015/08/31 12:23:12 Done...
1249 NOTREACHED();
1250 case 1:
1251 output_attribs->context_type =
1252 ::gpu::gles2::ContextCreationAttribHelper::CONTEXT_TYPE_WEBGL1;
1253 break;
1254 case 2:
1255 output_attribs->context_type =
1256 ::gpu::gles2::ContextCreationAttribHelper::CONTEXT_TYPE_WEBGL2;
1257 break;
1258 }
1248 } 1259 }
1249 1260
1250 } // namespace gpu_blink 1261 } // namespace gpu_blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698