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