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