Flutter Engine
The Flutter Engine
context_options.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_SHELL_COMMON_CONTEXT_OPTIONS_H_
6#define FLUTTER_SHELL_COMMON_CONTEXT_OPTIONS_H_
7
8#if !SLIMPELLER
9
10#include <optional>
11
12#include "flutter/fml/macros.h"
14
15namespace flutter {
16
17enum class ContextType {
18 /// The context is used to render to a texture or renderbuffer.
19 kRender,
20 /// The context will only be used to transfer resources to and from device
21 /// memory. No rendering will be performed using this context.
23};
24
25//------------------------------------------------------------------------------
26/// @brief Initializes GrContextOptions with values suitable for Flutter.
27/// The options can be further tweaked before a GrContext is created
28/// from these options.
29///
30/// @param[in] type The type of context that will be created using these
31/// options.
32/// @param[in] type The client rendering API that will be wrapped using a
33/// context with these options. This argument is only required
34/// if the context is going to be used with a particular
35/// client rendering API.
36///
37/// @return The default graphics context options.
38///
41 std::optional<GrBackendApi> api = std::nullopt);
42
43} // namespace flutter
44
45#endif // !SLIMPELLER
46
47#endif // FLUTTER_SHELL_COMMON_CONTEXT_OPTIONS_H_
GLenum type
GrContextOptions MakeDefaultContextOptions(ContextType type, std::optional< GrBackendApi > api)
Initializes GrContextOptions with values suitable for Flutter. The options can be further tweaked bef...
@ kRender
The context is used to render to a texture or renderbuffer.
ContextType
Definition: ContextType.h:19