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 <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "base/strings/string_split.h" | |
12 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
13 #include "gpu/command_buffer/service/gl_utils.h" | 12 #include "gpu/command_buffer/service/gl_utils.h" |
14 #include "gpu/command_buffer/service/gpu_switches.h" | 13 #include "gpu/command_buffer/service/gpu_switches.h" |
| 14 #include "gpu/config/gpu_util.h" |
15 #include "ui/gl/gl_implementation.h" | 15 #include "ui/gl/gl_implementation.h" |
16 | 16 |
17 #if defined(OS_MACOSX) | 17 #if defined(OS_MACOSX) |
18 #include "ui/gl/io_surface_support_mac.h" | 18 #include "ui/gl/io_surface_support_mac.h" |
19 #endif | 19 #endif |
20 | 20 |
21 namespace gpu { | 21 namespace gpu { |
22 namespace gles2 { | 22 namespace gles2 { |
23 | 23 |
24 namespace { | 24 namespace { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 private: | 63 private: |
64 std::set<std::string> string_set_; | 64 std::set<std::string> string_set_; |
65 }; | 65 }; |
66 | 66 |
67 // Process a string of wordaround type IDs (seperated by ',') and set up | 67 // Process a string of wordaround type IDs (seperated by ',') and set up |
68 // the corresponding Workaround flags. | 68 // the corresponding Workaround flags. |
69 void StringToWorkarounds( | 69 void StringToWorkarounds( |
70 const std::string& types, FeatureInfo::Workarounds* workarounds) { | 70 const std::string& types, FeatureInfo::Workarounds* workarounds) { |
71 DCHECK(workarounds); | 71 DCHECK(workarounds); |
72 std::vector<std::string> pieces; | 72 std::set<int> int_set; |
73 base::SplitString(types, ',', &pieces); | 73 gpu::StringToFeatureSet(types, &int_set); |
74 for (size_t i = 0; i < pieces.size(); ++i) { | 74 for (std::set<int>::const_iterator it = int_set.begin(); |
75 int number = 0; | 75 it != int_set.end(); ++it) { |
76 bool succeed = base::StringToInt(pieces[i], &number); | 76 switch (*it) { |
77 DCHECK(succeed); | |
78 switch (number) { | |
79 #define GPU_OP(type, name) \ | 77 #define GPU_OP(type, name) \ |
80 case gpu::type: \ | 78 case gpu::type: \ |
81 workarounds->name = true; \ | 79 workarounds->name = true; \ |
82 break; | 80 break; |
83 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 81 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
84 #undef GPU_OP | 82 #undef GPU_OP |
85 default: | 83 default: |
86 NOTIMPLEMENTED(); | 84 NOTIMPLEMENTED(); |
87 } | 85 } |
88 } | 86 } |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 if (extensions_.find(str) == std::string::npos) { | 704 if (extensions_.find(str) == std::string::npos) { |
707 extensions_ += (extensions_.empty() ? "" : " ") + str; | 705 extensions_ += (extensions_.empty() ? "" : " ") + str; |
708 } | 706 } |
709 } | 707 } |
710 | 708 |
711 FeatureInfo::~FeatureInfo() { | 709 FeatureInfo::~FeatureInfo() { |
712 } | 710 } |
713 | 711 |
714 } // namespace gles2 | 712 } // namespace gles2 |
715 } // namespace gpu | 713 } // namespace gpu |
OLD | NEW |