gpu_switching.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifndef GPU_CONFIG_GPU_SWITCHING_H_
  5. #define GPU_CONFIG_GPU_SWITCHING_H_
  6. #include <stdint.h>
  7. #include <vector>
  8. #include "build/build_config.h"
  9. #include "gpu/gpu_export.h"
  10. namespace base {
  11. class CommandLine;
  12. }
  13. namespace gpu {
  14. struct GPUInfo;
  15. // Returns true if GPU dynamic switching inside Chrome is supported.
  16. // Currently it's only for Mac with switchable dual GPUs.
  17. GPU_EXPORT bool SwitchableGPUsSupported(const GPUInfo& gpu_info,
  18. const base::CommandLine& command_line);
  19. // Depending on the GPU driver bug workarounds, if needed, force onto the
  20. // discrete GPU or try best to stay on the integrated GPU.
  21. // This should only be called if SwitchableGPUsSupported() returns true.
  22. GPU_EXPORT void InitializeSwitchableGPUs(
  23. const std::vector<int32_t>& driver_bug_workarounds);
  24. // Destroy the CGLPixelFormatObj that's used to force discrete GPU.
  25. GPU_EXPORT void StopForceDiscreteGPU();
  26. } // namespace gpu
  27. #endif // GPU_CONFIG_GPU_SWITCHING_H_