Flutter Engine
 
Loading...
Searching...
No Matches
tonic::DartConverter< flutter::RRect > Struct Reference

#include <rrect.h>

Public Types

using NativeType = flutter::RRect
 
using FfiType = Dart_Handle
 

Static Public Member Functions

static NativeType FromDart (Dart_Handle handle)
 
static NativeType FromArguments (Dart_NativeArguments args, int index, Dart_Handle &exception)
 
static NativeType FromFfi (FfiType val)
 
static const char * GetFfiRepresentation ()
 
static const char * GetDartRepresentation ()
 
static bool AllowedInLeafCall ()
 

Static Public Attributes

static constexpr const char * kFfiRepresentation = "Handle"
 
static constexpr const char * kDartRepresentation = "Object"
 
static constexpr bool kAllowedInLeafCall = false
 

Detailed Description

Definition at line 26 of file rrect.h.

Member Typedef Documentation

◆ FfiType

using tonic::DartConverter< flutter::RRect >::FfiType = Dart_Handle

Definition at line 28 of file rrect.h.

◆ NativeType

Definition at line 27 of file rrect.h.

Member Function Documentation

◆ AllowedInLeafCall()

static bool tonic::DartConverter< flutter::RRect >::AllowedInLeafCall ( )
inlinestatic

Definition at line 41 of file rrect.h.

41{ return kAllowedInLeafCall; }
static constexpr bool kAllowedInLeafCall
Definition rrect.h:31

◆ FromArguments()

RRect tonic::DartConverter< flutter::RRect >::FromArguments ( Dart_NativeArguments  args,
int  index,
Dart_Handle &  exception 
)
static

Definition at line 49 of file rrect.cc.

51 {
52 Dart_Handle value = Dart_GetNativeArgument(args, index);
54 return FromDart(value);
55}
int32_t value
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
#define FML_DCHECK(condition)
Definition logging.h:122
bool CheckAndHandleError(Dart_Handle handle)
Definition dart_error.cc:33
static NativeType FromDart(Dart_Handle handle)
Definition rrect.cc:18

References args, tonic::CheckAndHandleError(), FML_DCHECK, and value.

◆ FromDart()

RRect tonic::DartConverter< flutter::RRect >::FromDart ( Dart_Handle  handle)
static

Definition at line 18 of file rrect.cc.

18 {
19 Float32List buffer(value);
20
21 RRect result;
22 result.is_null = true;
23 if (buffer.data() == nullptr) {
24 return result;
25 }
26
27 // The Flutter rect may be inverted (upside down, backward, or both)
28 // Historically, Skia would normalize such rects but we will do that
29 // manually below when we construct the Impeller RoundRect
30 flutter::DlRect raw_rect =
31 flutter::DlRect::MakeLTRB(buffer[0], buffer[1], buffer[2], buffer[3]);
32
33 // Flutter has radii in TL,TR,BR,BL (clockwise) order,
34 // but Impeller uses TL,TR,BL,BR (zig-zag) order
36 .top_left = flutter::DlSize(buffer[4], buffer[5]),
37 .top_right = flutter::DlSize(buffer[6], buffer[7]),
38 .bottom_left = flutter::DlSize(buffer[10], buffer[11]),
39 .bottom_right = flutter::DlSize(buffer[8], buffer[9]),
40 };
41
42 result.rrect =
44
45 result.is_null = false;
46 return result;
47}
bool is_null
Definition rrect.h:18
DlRoundRect rrect
Definition rrect.h:17
impeller::Size DlSize
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
Definition switch_defs.h:98
static RoundRect MakeRectRadii(const Rect &rect, const RoundingRadii &radii)
Definition round_rect.cc:9
constexpr TRect GetPositive() const
Get a version of this rectangle that has a non-negative size.
Definition rect.h:398
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
Definition rect.h:129

References impeller::TRect< T >::GetPositive(), flutter::RRect::is_null, impeller::TRect< Scalar >::MakeLTRB(), impeller::RoundRect::MakeRectRadii(), flutter::RRect::rrect, impeller::RoundingRadii::top_left, and value.

◆ FromFfi()

static NativeType tonic::DartConverter< flutter::RRect >::FromFfi ( FfiType  val)
inlinestatic

Definition at line 38 of file rrect.h.

38{ return FromDart(val); }

◆ GetDartRepresentation()

static const char * tonic::DartConverter< flutter::RRect >::GetDartRepresentation ( )
inlinestatic

Definition at line 40 of file rrect.h.

40{ return kDartRepresentation; }
static constexpr const char * kDartRepresentation
Definition rrect.h:30

◆ GetFfiRepresentation()

static const char * tonic::DartConverter< flutter::RRect >::GetFfiRepresentation ( )
inlinestatic

Definition at line 39 of file rrect.h.

39{ return kFfiRepresentation; }
static constexpr const char * kFfiRepresentation
Definition rrect.h:29

Member Data Documentation

◆ kAllowedInLeafCall

constexpr bool tonic::DartConverter< flutter::RRect >::kAllowedInLeafCall = false
staticconstexpr

Definition at line 31 of file rrect.h.

◆ kDartRepresentation

constexpr const char* tonic::DartConverter< flutter::RRect >::kDartRepresentation = "Object"
staticconstexpr

Definition at line 30 of file rrect.h.

◆ kFfiRepresentation

constexpr const char* tonic::DartConverter< flutter::RRect >::kFfiRepresentation = "Handle"
staticconstexpr

Definition at line 29 of file rrect.h.


The documentation for this struct was generated from the following files: