| Flutter Impeller |

config.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter 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 FLUTTER_IMPELLER_TOOLKIT_EGL_CONFIG_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_EGL_CONFIG_H_
7
8 #include "flutter/fml/macros.h"
9 #include "impeller/toolkit/egl/egl.h"
10
11 namespace impeller {
12 namespace egl {
13
14 enum class API {
15 kOpenGL,
16 kOpenGLES2,
17 kOpenGLES3,
18 };
19
20 enum class Samples {
21 kOne = 1,
22 kTwo = 2,
23 kFour = 4,
24 };
25
26 enum class ColorFormat {
27 kRGBA8888,
28 kRGB565,
29 };
30
31 enum class StencilBits {
32 kZero = 0,
33 kEight = 8,
34 };
35
36 enum class DepthBits {
37 kZero = 0,
38 kEight = 8,
39 };
40
41 enum class SurfaceType {
42 kWindow,
43 kPBuffer,
44 };
45
46 struct ConfigDescriptor {
47 API api = API::kOpenGLES2;
48 Samples samples = Samples::kOne;
49 ColorFormat color_format = ColorFormat::kRGB565;
50 StencilBits stencil_bits = StencilBits::kZero;
51 DepthBits depth_bits = DepthBits::kZero;
52 SurfaceType surface_type = SurfaceType::kPBuffer;
53 };
54
55 class Config {
56 public:
57 Config(ConfigDescriptor descriptor, EGLConfig config);
58
59 ~Config();
60
61 bool IsValid() const;
62
63 const ConfigDescriptor& GetDescriptor() const;
64
65 const EGLConfig& GetHandle() const;
66
67 private:
68 const ConfigDescriptor desc_;
69 EGLConfig config_ = nullptr;
70
71 Config(const Config&) = delete;
72
73 Config& operator=(const Config&) = delete;
74 };
75
76 } // namespace egl
77 } // namespace impeller
78
79 #endif // FLUTTER_IMPELLER_TOOLKIT_EGL_CONFIG_H_
impeller::egl::Samples::kOne
@ kOne
impeller::egl::StencilBits::kEight
@ kEight
impeller::egl::API
API
Definition: config.h:14
impeller::egl::ColorFormat::kRGB565
@ kRGB565
impeller::egl::StencilBits
StencilBits
Definition: config.h:31
impeller::egl::Samples::kTwo
@ kTwo
impeller::egl::DepthBits::kZero
@ kZero
impeller::egl::Config::GetDescriptor
const ConfigDescriptor & GetDescriptor() const
Definition: config.cc:17
impeller::egl::StencilBits::kZero
@ kZero
impeller::egl::DepthBits
DepthBits
Definition: config.h:36
impeller::egl::Config::Config
Config(ConfigDescriptor descriptor, EGLConfig config)
Definition: config.cc:12
egl.h
impeller::egl::SurfaceType
SurfaceType
Definition: config.h:41
impeller::egl::ConfigDescriptor::samples
Samples samples
Definition: config.h:48
impeller::egl::API::kOpenGLES2
@ kOpenGLES2
impeller::egl::ColorFormat
ColorFormat
Definition: config.h:26
impeller::egl::DepthBits::kEight
@ kEight
impeller::egl::Config::GetHandle
const EGLConfig & GetHandle() const
Definition: config.cc:21
impeller::egl::Config::IsValid
bool IsValid() const
Definition: config.cc:25
impeller::egl::Samples::kFour
@ kFour
impeller::egl::ConfigDescriptor::surface_type
SurfaceType surface_type
Definition: config.h:52
impeller::egl::ConfigDescriptor
Definition: config.h:46
impeller::egl::Config::~Config
~Config()
impeller::egl::API::kOpenGL
@ kOpenGL
impeller::egl::SurfaceType::kWindow
@ kWindow
impeller::egl::Samples
Samples
Definition: config.h:20
impeller::egl::ColorFormat::kRGBA8888
@ kRGBA8888
impeller::egl::Config
Definition: config.h:55
impeller::egl::ConfigDescriptor::color_format
ColorFormat color_format
Definition: config.h:49
impeller
Definition: aiks_blur_unittests.cc:20
impeller::egl::API::kOpenGLES3
@ kOpenGLES3
impeller::egl::SurfaceType::kPBuffer
@ kPBuffer
impeller::egl::ConfigDescriptor::stencil_bits
StencilBits stencil_bits
Definition: config.h:50
impeller::egl::ConfigDescriptor::api
API api
Definition: config.h:47
impeller::egl::ConfigDescriptor::depth_bits
DepthBits depth_bits
Definition: config.h:51