Chromium Code Reviews| 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 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1484 kTotalDrawBufferEnums - max_draw_buffers); | 1484 kTotalDrawBufferEnums - max_draw_buffers); |
| 1485 } | 1485 } |
| 1486 | 1486 |
| 1487 if (feature_flags_.ext_texture_format_bgra8888) { | 1487 if (feature_flags_.ext_texture_format_bgra8888) { |
| 1488 validators_.texture_internal_format.AddValue(GL_BGRA8_EXT); | 1488 validators_.texture_internal_format.AddValue(GL_BGRA8_EXT); |
| 1489 validators_.texture_sized_color_renderable_internal_format.AddValue( | 1489 validators_.texture_sized_color_renderable_internal_format.AddValue( |
| 1490 GL_BGRA8_EXT); | 1490 GL_BGRA8_EXT); |
| 1491 validators_.texture_sized_texture_filterable_internal_format.AddValue( | 1491 validators_.texture_sized_texture_filterable_internal_format.AddValue( |
| 1492 GL_BGRA8_EXT); | 1492 GL_BGRA8_EXT); |
| 1493 } | 1493 } |
| 1494 | |
| 1495 if (!IsWebGLContext()) { | |
| 1496 validators_.texture_parameter.AddValue(GL_TEXTURE_SWIZZLE_R); | |
| 1497 validators_.texture_parameter.AddValue(GL_TEXTURE_SWIZZLE_G); | |
| 1498 validators_.texture_parameter.AddValue(GL_TEXTURE_SWIZZLE_B); | |
| 1499 validators_.texture_parameter.AddValue(GL_TEXTURE_SWIZZLE_A); | |
|
Ken Russell (switch to Gerrit)
2016/12/01 22:46:27
What about an understanding of the valid values fo
Zhenyao Mo
2016/12/01 22:47:51
It's already in place. I'll add a test for that.
| |
| 1500 } | |
| 1494 } | 1501 } |
| 1495 | 1502 |
| 1496 bool FeatureInfo::IsWebGLContext() const { | 1503 bool FeatureInfo::IsWebGLContext() const { |
| 1497 return IsWebGLContextType(context_type_); | 1504 return IsWebGLContextType(context_type_); |
| 1498 } | 1505 } |
| 1499 | 1506 |
| 1500 bool FeatureInfo::IsWebGL1OrES2Context() const { | 1507 bool FeatureInfo::IsWebGL1OrES2Context() const { |
| 1501 // Switch statement to cause a compile-time error if we miss a case. | 1508 // Switch statement to cause a compile-time error if we miss a case. |
| 1502 switch (context_type_) { | 1509 switch (context_type_) { |
| 1503 case CONTEXT_TYPE_WEBGL1: | 1510 case CONTEXT_TYPE_WEBGL1: |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1539 if (pos == std::string::npos) { | 1546 if (pos == std::string::npos) { |
| 1540 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1547 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1541 } | 1548 } |
| 1542 } | 1549 } |
| 1543 | 1550 |
| 1544 FeatureInfo::~FeatureInfo() { | 1551 FeatureInfo::~FeatureInfo() { |
| 1545 } | 1552 } |
| 1546 | 1553 |
| 1547 } // namespace gles2 | 1554 } // namespace gles2 |
| 1548 } // namespace gpu | 1555 } // namespace gpu |
| OLD | NEW |