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/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 // but we emulate ES 3.0 on top of Desktop GL 4.2+. | 1398 // but we emulate ES 3.0 on top of Desktop GL 4.2+. |
1399 feature_flags_.emulate_primitive_restart_fixed_index = true; | 1399 feature_flags_.emulate_primitive_restart_fixed_index = true; |
1400 } | 1400 } |
1401 | 1401 |
1402 feature_flags_.angle_robust_client_memory = | 1402 feature_flags_.angle_robust_client_memory = |
1403 extensions.Contains("GL_ANGLE_robust_client_memory"); | 1403 extensions.Contains("GL_ANGLE_robust_client_memory"); |
1404 | 1404 |
1405 feature_flags_.khr_debug = gl_version_info_->IsAtLeastGL(4, 3) || | 1405 feature_flags_.khr_debug = gl_version_info_->IsAtLeastGL(4, 3) || |
1406 gl_version_info_->IsAtLeastGLES(3, 2) || | 1406 gl_version_info_->IsAtLeastGLES(3, 2) || |
1407 extensions.Contains("GL_KHR_debug"); | 1407 extensions.Contains("GL_KHR_debug"); |
1408 | |
1409 feature_flags_.chromium_bind_generates_resource = | |
1410 extensions.Contains("GL_CHROMIUM_bind_generates_resource"); | |
1411 feature_flags_.angle_webgl_compatibility = | |
1412 extensions.Contains("GL_ANGLE_webgl_compatibility"); | |
1413 } | 1408 } |
1414 | 1409 |
1415 bool FeatureInfo::IsES3Capable() const { | 1410 bool FeatureInfo::IsES3Capable() const { |
1416 if (workarounds_.disable_texture_storage) | 1411 if (workarounds_.disable_texture_storage) |
1417 return false; | 1412 return false; |
1418 if (gl_version_info_) | 1413 if (gl_version_info_) |
1419 return gl_version_info_->is_es3_capable; | 1414 return gl_version_info_->is_es3_capable; |
1420 return false; | 1415 return false; |
1421 } | 1416 } |
1422 | 1417 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 if (feature_flags_.ext_texture_format_bgra8888) { | 1482 if (feature_flags_.ext_texture_format_bgra8888) { |
1488 validators_.texture_internal_format.AddValue(GL_BGRA8_EXT); | 1483 validators_.texture_internal_format.AddValue(GL_BGRA8_EXT); |
1489 validators_.texture_sized_color_renderable_internal_format.AddValue( | 1484 validators_.texture_sized_color_renderable_internal_format.AddValue( |
1490 GL_BGRA8_EXT); | 1485 GL_BGRA8_EXT); |
1491 validators_.texture_sized_texture_filterable_internal_format.AddValue( | 1486 validators_.texture_sized_texture_filterable_internal_format.AddValue( |
1492 GL_BGRA8_EXT); | 1487 GL_BGRA8_EXT); |
1493 } | 1488 } |
1494 } | 1489 } |
1495 | 1490 |
1496 bool FeatureInfo::IsWebGLContext() const { | 1491 bool FeatureInfo::IsWebGLContext() const { |
1497 return IsWebGLContextType(context_type_); | 1492 // Switch statement to cause a compile-time error if we miss a case. |
| 1493 switch (context_type_) { |
| 1494 case CONTEXT_TYPE_WEBGL1: |
| 1495 case CONTEXT_TYPE_WEBGL2: |
| 1496 return true; |
| 1497 case CONTEXT_TYPE_OPENGLES2: |
| 1498 case CONTEXT_TYPE_OPENGLES3: |
| 1499 return false; |
| 1500 } |
| 1501 |
| 1502 NOTREACHED(); |
| 1503 return false; |
1498 } | 1504 } |
1499 | 1505 |
1500 bool FeatureInfo::IsWebGL1OrES2Context() const { | 1506 bool FeatureInfo::IsWebGL1OrES2Context() const { |
1501 // Switch statement to cause a compile-time error if we miss a case. | 1507 // Switch statement to cause a compile-time error if we miss a case. |
1502 switch (context_type_) { | 1508 switch (context_type_) { |
1503 case CONTEXT_TYPE_WEBGL1: | 1509 case CONTEXT_TYPE_WEBGL1: |
1504 case CONTEXT_TYPE_OPENGLES2: | 1510 case CONTEXT_TYPE_OPENGLES2: |
1505 return true; | 1511 return true; |
1506 case CONTEXT_TYPE_WEBGL2: | 1512 case CONTEXT_TYPE_WEBGL2: |
1507 case CONTEXT_TYPE_OPENGLES3: | 1513 case CONTEXT_TYPE_OPENGLES3: |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1539 if (pos == std::string::npos) { | 1545 if (pos == std::string::npos) { |
1540 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1546 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1541 } | 1547 } |
1542 } | 1548 } |
1543 | 1549 |
1544 FeatureInfo::~FeatureInfo() { | 1550 FeatureInfo::~FeatureInfo() { |
1545 } | 1551 } |
1546 | 1552 |
1547 } // namespace gles2 | 1553 } // namespace gles2 |
1548 } // namespace gpu | 1554 } // namespace gpu |
OLD | NEW |