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 #ifndef GPU_CONFIG_GPU_TEST_CONFIG_H_ | 5 #ifndef GPU_CONFIG_GPU_TEST_CONFIG_H_ |
| 6 #define GPU_CONFIG_GPU_TEST_CONFIG_H_ | 6 #define GPU_CONFIG_GPU_TEST_CONFIG_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 GPUTestConfig(); | 60 GPUTestConfig(); |
| 61 GPUTestConfig(const GPUTestConfig& other); | 61 GPUTestConfig(const GPUTestConfig& other); |
| 62 virtual ~GPUTestConfig(); | 62 virtual ~GPUTestConfig(); |
| 63 | 63 |
| 64 void set_os(int32_t os); | 64 void set_os(int32_t os); |
| 65 void set_gpu_device_id(uint32_t id); | 65 void set_gpu_device_id(uint32_t id); |
| 66 void set_build_type(int32_t build_type); | 66 void set_build_type(int32_t build_type); |
| 67 void set_api(int32_t api); | 67 void set_api(int32_t api); |
| 68 void set_machine_model_name(const std::string& machine_model_name); | |
| 68 | 69 |
| 69 virtual void AddGPUVendor(uint32_t gpu_vendor); | 70 virtual void AddGPUVendor(uint32_t gpu_vendor); |
| 70 | 71 |
| 71 int32_t os() const { return os_; } | 72 int32_t os() const { return os_; } |
| 72 const std::vector<uint32_t>& gpu_vendor() const { return gpu_vendor_; } | 73 const std::vector<uint32_t>& gpu_vendor() const { return gpu_vendor_; } |
| 73 uint32_t gpu_device_id() const { return gpu_device_id_; } | 74 uint32_t gpu_device_id() const { return gpu_device_id_; } |
| 74 int32_t build_type() const { return build_type_; } | 75 int32_t build_type() const { return build_type_; } |
| 75 int32_t api() const { return api_; } | 76 int32_t api() const { return api_; } |
| 77 std::string machine_model_name() const { return machine_model_name_; } | |
|
Zhenyao Mo
2017/03/11 18:29:16
nit: return const std::string&
| |
| 76 | 78 |
| 77 // Check if the config is valid. For example, if gpu_device_id_ is set, but | 79 // Check if the config is valid. For example, if gpu_device_id_ is set, but |
| 78 // gpu_vendor_ is unknown, then it's invalid. | 80 // gpu_vendor_ is unknown, then it's invalid. |
| 79 virtual bool IsValid() const; | 81 virtual bool IsValid() const; |
| 80 | 82 |
| 81 // Check if two configs overlap, i.e., if there exists a config that matches | 83 // Check if two configs overlap, i.e., if there exists a config that matches |
| 82 // both configs. | 84 // both configs. |
| 83 bool OverlapsWith(const GPUTestConfig& config) const; | 85 bool OverlapsWith(const GPUTestConfig& config) const; |
| 84 | 86 |
| 85 // Disable validation of GPU vendor and device ids. | 87 // Disable validation of GPU vendor and device ids. |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 100 std::vector<uint32_t> gpu_vendor_; | 102 std::vector<uint32_t> gpu_vendor_; |
| 101 | 103 |
| 102 // GPU device id (unique to each vendor). | 104 // GPU device id (unique to each vendor). |
| 103 uint32_t gpu_device_id_; | 105 uint32_t gpu_device_id_; |
| 104 | 106 |
| 105 // Release or Debug. | 107 // Release or Debug. |
| 106 int32_t build_type_; | 108 int32_t build_type_; |
| 107 | 109 |
| 108 // Back-end rendering APIs. | 110 // Back-end rendering APIs. |
| 109 int32_t api_; | 111 int32_t api_; |
| 112 | |
| 113 // The machine model identifier. See GPUInfo for details. | |
| 114 std::string machine_model_name_; | |
| 110 }; | 115 }; |
| 111 | 116 |
| 112 class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig { | 117 class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig { |
| 113 public: | 118 public: |
| 114 GPUTestBotConfig() { } | 119 GPUTestBotConfig() { } |
| 115 ~GPUTestBotConfig() override; | 120 ~GPUTestBotConfig() override; |
| 116 | 121 |
| 117 // This should only be called when no gpu_vendor is added. | 122 // This should only be called when no gpu_vendor is added. |
| 118 void AddGPUVendor(uint32_t gpu_vendor) override; | 123 void AddGPUVendor(uint32_t gpu_vendor) override; |
| 119 | 124 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 139 static bool CurrentConfigMatches(const std::vector<std::string>& configs); | 144 static bool CurrentConfigMatches(const std::vector<std::string>& configs); |
| 140 | 145 |
| 141 // Check if the bot has blacklisted all GPU features. | 146 // Check if the bot has blacklisted all GPU features. |
| 142 static bool GpuBlacklistedOnBot(); | 147 static bool GpuBlacklistedOnBot(); |
| 143 }; | 148 }; |
| 144 | 149 |
| 145 } // namespace gpu | 150 } // namespace gpu |
| 146 | 151 |
| 147 #endif // GPU_CONFIG_GPU_TEST_CONFIG_H_ | 152 #endif // GPU_CONFIG_GPU_TEST_CONFIG_H_ |
| 148 | 153 |
| OLD | NEW |