1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef GPU_CONFIG_GPU_SWITCHING_H_ 6 #define GPU_CONFIG_GPU_SWITCHING_H_ 7 8 #include <stdint.h> 9 10 #include <vector> 11 12 #include "build/build_config.h" 13 #include "gpu/gpu_export.h" 14 15 namespace base { 16 class CommandLine; 17 } 18 19 namespace gpu { 20 21 struct GPUInfo; 22 23 // Returns true if GPU dynamic switching inside Chrome is supported. 24 // Currently it's only for Mac with switchable dual GPUs. 25 GPU_EXPORT bool SwitchableGPUsSupported(const GPUInfo& gpu_info, 26 const base::CommandLine& command_line); 27 28 // Depending on the GPU driver bug workarounds, if needed, force onto the 29 // discrete GPU or try best to stay on the integrated GPU. 30 // This should only be called if SwitchableGPUsSupported() returns true. 31 GPU_EXPORT void InitializeSwitchableGPUs( 32 const std::vector<int32_t>& driver_bug_workarounds); 33 34 // Destroy the CGLPixelFormatObj that's used to force discrete GPU. 35 GPU_EXPORT void StopForceDiscreteGPU(); 36 37 } // namespace gpu 38 39 #endif // GPU_CONFIG_GPU_SWITCHING_H_ 40