OLD | NEW |
---|---|
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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1244 const blink::WebGraphicsContext3D::Attributes& attributes, | 1244 const blink::WebGraphicsContext3D::Attributes& attributes, |
1245 ::gpu::gles2::ContextCreationAttribHelper* output_attribs) { | 1245 ::gpu::gles2::ContextCreationAttribHelper* output_attribs) { |
1246 output_attribs->alpha_size = attributes.alpha ? 8 : 0; | 1246 output_attribs->alpha_size = attributes.alpha ? 8 : 0; |
1247 output_attribs->depth_size = attributes.depth ? 24 : 0; | 1247 output_attribs->depth_size = attributes.depth ? 24 : 0; |
1248 output_attribs->stencil_size = attributes.stencil ? 8 : 0; | 1248 output_attribs->stencil_size = attributes.stencil ? 8 : 0; |
1249 output_attribs->samples = attributes.antialias ? 4 : 0; | 1249 output_attribs->samples = attributes.antialias ? 4 : 0; |
1250 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; | 1250 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; |
1251 output_attribs->fail_if_major_perf_caveat = | 1251 output_attribs->fail_if_major_perf_caveat = |
1252 attributes.failIfMajorPerformanceCaveat; | 1252 attributes.failIfMajorPerformanceCaveat; |
1253 output_attribs->bind_generates_resource = false; | 1253 output_attribs->bind_generates_resource = false; |
1254 output_attribs->webgl_version = attributes.webGLVersion; | 1254 switch (attributes.webGLVersion) { |
1255 case 0: | |
Kimmo Kinnunen
2015/09/05 10:10:46
So this case for "webGLVersion" needed to be handl
| |
1256 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2; | |
1257 break; | |
1258 case 1: | |
1259 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL1; | |
1260 break; | |
1261 case 2: | |
1262 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL2; | |
1263 break; | |
1264 default: | |
1265 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2; | |
1266 break; | |
1267 } | |
1255 } | 1268 } |
1256 | 1269 |
1257 } // namespace gpu_blink | 1270 } // namespace gpu_blink |
OLD | NEW |