1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #pragma once 17 18 #include <ostream> 19 #include <string> 20 21 namespace cuttlefish { 22 23 struct GraphicsAvailability { 24 bool has_gl = false; 25 bool has_gles1 = false; 26 bool has_gles2 = false; 27 bool has_egl = false; 28 bool has_egl_default_display = false; 29 std::string egl_client_extensions; 30 std::string egl_version; 31 std::string egl_vendor; 32 std::string egl_extensions; 33 bool has_egl_surfaceless_with_gles = false; 34 bool has_vulkan = false; 35 bool has_discrete_gpu = false; 36 std::string discrete_gpu_device_name; 37 std::string discrete_gpu_device_extensions; 38 }; 39 40 bool ShouldEnableAcceleratedRendering(const GraphicsAvailability& availability); 41 GraphicsAvailability GetGraphicsAvailabilityWithSubprocessCheck(); 42 43 std::ostream& operator<<(std::ostream& out, const GraphicsAvailability& info); 44 45 } // namespace cuttlefish 46