Flutter Engine
The Flutter Engine
rrect.cc
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#include "flutter/lib/ui/painting/rrect.h"
6
7#include "flutter/fml/logging.h"
10
11using flutter::RRect;
12
13namespace tonic {
14
15// Construct an SkRRect from a Dart RRect object.
16// The Dart RRect is a Float32List containing
17// [left, top, right, bottom, xRadius, yRadius]
19 Float32List buffer(value);
20
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}
38
40 int index,
41 Dart_Handle& exception) {
44 return FromDart(value);
45}
46
47} // namespace tonic
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, int index)
struct _Dart_NativeArguments * Dart_NativeArguments
Definition: dart_api.h:3019
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint8_t value
GAsyncResult * result
#define FML_DCHECK(condition)
Definition: logging.h:103
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 vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
bool CheckAndHandleError(Dart_Handle handle)
Definition: dart_error.cc:33
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646