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

Side by Side Diff: gpu/command_buffer/service/feature_info.cc

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/command_buffer/service/feature_info.h" 5 #include "gpu/command_buffer/service/feature_info.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/string_split.h" 13 #include "base/strings/string_split.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "gpu/command_buffer/service/gl_utils.h" 15 #include "gpu/command_buffer/service/gl_utils.h"
16 #include "gpu/command_buffer/service/gpu_switches.h" 16 #include "gpu/command_buffer/service/gpu_switches.h"
17 #include "ui/gl/gl_fence.h" 17 #include "ui/gl/gl_fence.h"
18 #include "ui/gl/gl_implementation.h" 18 #include "ui/gl/gl_implementation.h"
19 19
20 #if !defined(OS_MACOSX)
21 #include "ui/gl/gl_fence_egl.h"
22 #endif
23
20 namespace gpu { 24 namespace gpu {
21 namespace gles2 { 25 namespace gles2 {
22 26
23 namespace { 27 namespace {
24 28
25 struct FormatInfo { 29 struct FormatInfo {
26 GLenum format; 30 GLenum format;
27 const GLenum* types; 31 const GLenum* types;
28 size_t count; 32 size_t count;
29 }; 33 };
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 1017
1014 if (enable_texture_float) { 1018 if (enable_texture_float) {
1015 texture_format_validators_[GL_RED_EXT].AddValue(GL_FLOAT); 1019 texture_format_validators_[GL_RED_EXT].AddValue(GL_FLOAT);
1016 texture_format_validators_[GL_RG_EXT].AddValue(GL_FLOAT); 1020 texture_format_validators_[GL_RG_EXT].AddValue(GL_FLOAT);
1017 } 1021 }
1018 if (enable_texture_half_float) { 1022 if (enable_texture_half_float) {
1019 texture_format_validators_[GL_RED_EXT].AddValue(GL_HALF_FLOAT_OES); 1023 texture_format_validators_[GL_RED_EXT].AddValue(GL_HALF_FLOAT_OES);
1020 texture_format_validators_[GL_RG_EXT].AddValue(GL_HALF_FLOAT_OES); 1024 texture_format_validators_[GL_RG_EXT].AddValue(GL_HALF_FLOAT_OES);
1021 } 1025 }
1022 } 1026 }
1027
1028 #if !defined(OS_MACOSX)
1029 if (workarounds_.ignore_egl_sync_failures) {
1030 gfx::GLFenceEGL::SetIgnoreFailures();
1031 }
1032 #endif
1023 } 1033 }
1024 1034
1025 void FeatureInfo::AddExtensionString(const char* s) { 1035 void FeatureInfo::AddExtensionString(const char* s) {
1026 std::string str(s); 1036 std::string str(s);
1027 size_t pos = extensions_.find(str); 1037 size_t pos = extensions_.find(str);
1028 while (pos != std::string::npos && 1038 while (pos != std::string::npos &&
1029 pos + str.length() < extensions_.length() && 1039 pos + str.length() < extensions_.length() &&
1030 extensions_.substr(pos + str.length(), 1) != " ") { 1040 extensions_.substr(pos + str.length(), 1) != " ") {
1031 // This extension name is a substring of another. 1041 // This extension name is a substring of another.
1032 pos = extensions_.find(str, pos + str.length()); 1042 pos = extensions_.find(str, pos + str.length());
1033 } 1043 }
1034 if (pos == std::string::npos) { 1044 if (pos == std::string::npos) {
1035 extensions_ += (extensions_.empty() ? "" : " ") + str; 1045 extensions_ += (extensions_.empty() ? "" : " ") + str;
1036 } 1046 }
1037 } 1047 }
1038 1048
1039 FeatureInfo::~FeatureInfo() { 1049 FeatureInfo::~FeatureInfo() {
1040 } 1050 }
1041 1051
1042 } // namespace gles2 1052 } // namespace gles2
1043 } // namespace gpu 1053 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/command_buffer_service.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698