• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_vulkan = false;
29 
30   std::string egl_client_extensions;
31 
32   std::string egl_version;
33   std::string egl_vendor;
34   std::string egl_extensions;
35 
36   bool can_init_gles2_on_egl_surfaceless = false;
37   std::string gles2_vendor;
38   std::string gles2_version;
39   std::string gles2_renderer;
40   std::string gles2_extensions;
41 
42   bool has_discrete_gpu = false;
43   std::string discrete_gpu_device_name;
44   std::string discrete_gpu_device_extensions;
45 };
46 
47 bool ShouldEnableAcceleratedRendering(const GraphicsAvailability& availability);
48 GraphicsAvailability GetGraphicsAvailabilityWithSubprocessCheck();
49 
50 std::ostream& operator<<(std::ostream& out, const GraphicsAvailability& info);
51 
52 }  // namespace cuttlefish
53