Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
context.h File Reference
#include "dart_api.h"
#include "flutter/lib/gpu/export.h"
#include "flutter/lib/ui/dart_wrapper.h"
#include "impeller/renderer/context.h"

Go to the source code of this file.

Classes

class  flutter::gpu::Context
 

Namespaces

namespace  flutter
 
namespace  flutter::gpu
 

Functions

FLUTTER_GPU_EXPORT Dart_Handle InternalFlutterGpu_Context_InitializeDefault (Dart_Handle wrapper)
 
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetBackendType (flutter::gpu::Context *wrapper)
 
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetDefaultColorFormat (flutter::gpu::Context *wrapper)
 
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetDefaultStencilFormat (flutter::gpu::Context *wrapper)
 
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetDefaultDepthStencilFormat (flutter::gpu::Context *wrapper)
 

Function Documentation

◆ InternalFlutterGpu_Context_GetBackendType()

FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetBackendType ( flutter::gpu::Context wrapper)
extern

◆ InternalFlutterGpu_Context_GetDefaultColorFormat()

FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetDefaultColorFormat ( flutter::gpu::Context wrapper)
extern

Definition at line 89 of file context.cc.

90 {
91 return static_cast<int>(flutter::gpu::FromImpellerPixelFormat(
92 wrapper->GetContext()->GetCapabilities()->GetDefaultColorFormat()));
93}
std::shared_ptr< impeller::Context > GetContext()
Definition context.cc:65
constexpr FlutterGPUPixelFormat FromImpellerPixelFormat(impeller::PixelFormat value)
Definition formats.h:102

◆ InternalFlutterGpu_Context_GetDefaultDepthStencilFormat()

FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetDefaultDepthStencilFormat ( flutter::gpu::Context wrapper)
extern

Definition at line 101 of file context.cc.

102 {
103 return static_cast<int>(flutter::gpu::FromImpellerPixelFormat(
104 wrapper->GetContext()
105 ->GetCapabilities()
106 ->GetDefaultDepthStencilFormat()));
107}

◆ InternalFlutterGpu_Context_GetDefaultStencilFormat()

FLUTTER_GPU_EXPORT int InternalFlutterGpu_Context_GetDefaultStencilFormat ( flutter::gpu::Context wrapper)
extern

Definition at line 95 of file context.cc.

96 {
97 return static_cast<int>(flutter::gpu::FromImpellerPixelFormat(
98 wrapper->GetContext()->GetCapabilities()->GetDefaultStencilFormat()));
99}

◆ InternalFlutterGpu_Context_InitializeDefault()

FLUTTER_GPU_EXPORT Dart_Handle InternalFlutterGpu_Context_InitializeDefault ( Dart_Handle  wrapper)
extern

Exports

Definition at line 76 of file context.cc.

76 {
77 std::optional<std::string> out_error;
78 auto impeller_context = flutter::gpu::Context::GetDefaultContext(out_error);
79 if (out_error.has_value()) {
80 return tonic::ToDart(out_error.value());
81 }
82
83 auto res = fml::MakeRefCounted<flutter::gpu::Context>(impeller_context);
84 res->AssociateWithDartWrapper(wrapper);
85
86 return Dart_Null();
87}
static std::shared_ptr< impeller::Context > GetDefaultContext(std::optional< std::string > &out_error)
Definition context.cc:29
DART_EXPORT Dart_Handle Dart_Null(void)
Dart_Handle ToDart(const T &object)