190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// found in the LICENSE file. 490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#ifndef GPU_CONFIG_GPU_UTIL_H_ 690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#define GPU_CONFIG_GPU_UTIL_H_ 790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include <set> 990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include <string> 1090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 11a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "base/command_line.h" 1290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "build/build_config.h" 1390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "gpu/gpu_export.h" 1490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 15a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace base { 1690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)class CommandLine; 17a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)} 1890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 1990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)namespace gpu { 2090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 21a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)struct GPUInfo; 22a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 2390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Merge features in src into dst. 2490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)GPU_EXPORT void MergeFeatureSets( 2590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) std::set<int>* dst, const std::set<int>& src); 2690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 2790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Collect basic GPUInfo, compute the driver bug workarounds for the current 2890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// system, and append the |command_line|. 29a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)GPU_EXPORT void ApplyGpuDriverBugWorkarounds(base::CommandLine* command_line); 3090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 31a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// With provided GPUInfo, compute the driver bug workarounds for the current 32a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// system, and append the |command_line|. 33a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)GPU_EXPORT void ApplyGpuDriverBugWorkarounds( 34a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) const GPUInfo& gpu_inco, base::CommandLine* command_line); 35a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 36f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// |str| is in the format of "feature1,feature2,...,featureN". 37f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)GPU_EXPORT void StringToFeatureSet( 38f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) const std::string& str, std::set<int>* feature_set); 39f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 4090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)} // namespace gpu 4190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 4290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#endif // GPU_CONFIG_GPU_UTIL_H_ 4390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 44