Flutter Engine
The Flutter Engine
Namespaces | Functions
context.cc File Reference
#include "flutter/lib/gpu/context.h"
#include <future>
#include "flutter/lib/gpu/formats.h"
#include "flutter/lib/ui/ui_dart_state.h"
#include "fml/make_copyable.h"
#include "tonic/converter/dart_converter.h"

Go to the source code of this file.

Namespaces

namespace  flutter
 
namespace  flutter::gpu
 

Functions

 flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, Context)
 
Dart_Handle InternalFlutterGpu_Context_InitializeDefault (Dart_Handle wrapper)
 
int InternalFlutterGpu_Context_GetDefaultColorFormat (flutter::gpu::Context *wrapper)
 
int InternalFlutterGpu_Context_GetDefaultStencilFormat (flutter::gpu::Context *wrapper)
 
int InternalFlutterGpu_Context_GetDefaultDepthStencilFormat (flutter::gpu::Context *wrapper)
 

Function Documentation

◆ InternalFlutterGpu_Context_GetDefaultColorFormat()

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

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()

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

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()

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

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()

Dart_Handle InternalFlutterGpu_Context_InitializeDefault ( Dart_Handle  wrapper)

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)