1 // Copyright (c) 2019 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 UI_GFX_GPU_EXTRA_INFO_H_
6 #define UI_GFX_GPU_EXTRA_INFO_H_
7 
8 #include <string>
9 #include <vector>
10 
11 #include "ui/gfx/buffer_types.h"
12 #include "ui/gfx/gfx_export.h"
13 
14 #if defined(USE_OZONE) || defined(USE_X11)
15 typedef unsigned long VisualID;
16 #endif
17 
18 namespace gfx {
19 
20 // Specification of a feature that can be enabled/disable in ANGLE
21 struct GFX_EXPORT ANGLEFeature {
22   ANGLEFeature();
23   ANGLEFeature(const ANGLEFeature& other);
24   ANGLEFeature(ANGLEFeature&& other);
25   ~ANGLEFeature();
26   ANGLEFeature& operator=(const ANGLEFeature& other);
27   ANGLEFeature& operator=(ANGLEFeature&& other);
28 
29   // Name of the feature in camel_case.
30   std::string name;
31 
32   // Name of the category that the feature belongs to.
33   std::string category;
34 
35   // One sentence description of the feature, why it's available.
36   std::string description;
37 
38   // Full link to cr/angle bug if applicable.
39   std::string bug;
40 
41   // Status, can be "enabled" or "disabled".
42   std::string status;
43 
44   // Condition, contains the condition that set 'status'.
45   std::string condition;
46 };
47 using ANGLEFeatures = std::vector<ANGLEFeature>;
48 
49 struct GFX_EXPORT GpuExtraInfo {
50   GpuExtraInfo();
51   GpuExtraInfo(const GpuExtraInfo&);
52   GpuExtraInfo(GpuExtraInfo&&);
53   ~GpuExtraInfo();
54   GpuExtraInfo& operator=(const GpuExtraInfo&);
55   GpuExtraInfo& operator=(GpuExtraInfo&&);
56 
57   // List of the currently available ANGLE features. May be empty if not
58   // applicable.
59   ANGLEFeatures angle_features;
60 
61 #if defined(USE_OZONE) || defined(USE_X11)
62   VisualID system_visual = 0;
63   VisualID rgba_visual = 0;
64 
65   std::vector<gfx::BufferUsageAndFormat> gpu_memory_buffer_support_x11;
66 #endif
67 };
68 
69 }  // namespace gfx
70 
71 #endif  // UI_GFX_GPU_EXTRA_INFO_H_
72