Flutter Engine
tonic::DartConverter< flutter::RRect > Struct Template Reference

#include <rrect.h>

Static Public Member Functions

static flutter::RRect FromDart (Dart_Handle handle)
 
static flutter::RRect FromArguments (Dart_NativeArguments args, int index, Dart_Handle &exception)
 

Detailed Description

template<>
struct tonic::DartConverter< flutter::RRect >

Definition at line 25 of file rrect.h.

Member Function Documentation

◆ FromArguments()

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

Definition at line 39 of file rrect.cc.

References FML_DCHECK, tonic::LogIfError(), and value.

41  {
42  Dart_Handle value = Dart_GetNativeArgument(args, index);
43  FML_DCHECK(!LogIfError(value));
44  return FromDart(value);
45 }
G_BEGIN_DECLS FlValue * args
#define FML_DCHECK(condition)
Definition: logging.h:86
static flutter::RRect FromDart(Dart_Handle handle)
Definition: rrect.cc:18
uint8_t value
bool LogIfError(Dart_Handle handle)
Definition: dart_error.cc:15

◆ FromDart()

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

Definition at line 18 of file rrect.cc.

References flutter::RRect::is_null, and flutter::RRect::sk_rrect.

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  SkVector radii[4] = {{buffer[4], buffer[5]},
28  {buffer[6], buffer[7]},
29  {buffer[8], buffer[9]},
30  {buffer[10], buffer[11]}};
31 
32  result.sk_rrect.setRectRadii(
33  SkRect::MakeLTRB(buffer[0], buffer[1], buffer[2], buffer[3]), radii);
34 
35  result.is_null = false;
36  return result;
37 }
SkRRect sk_rrect
Definition: rrect.h:16
bool is_null
Definition: rrect.h:17
uint8_t value

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