Flutter Engine
The Flutter Engine
JetSki.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2021 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include <android/log.h>
9#include <jni.h>
10
11#define REGISTER_NATIVES(class_name) \
12extern int register_jetski_##class_name(JNIEnv*); \
13if (auto rc = register_jetski_##class_name(env)) { \
14 __android_log_print(ANDROID_LOG_ERROR, "JetSki", \
15 "Failed to load natives: " #class_name); \
16 return rc; \
17}
18
19
20JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
21 JNIEnv* env;
22 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {
23 return JNI_ERR;
24 }
25
26 REGISTER_NATIVES(Canvas)
28 REGISTER_NATIVES(ComposeColorFilter)
29 REGISTER_NATIVES(HSLAMatrixColorFilter)
31 REGISTER_NATIVES(ImageFilter)
34 REGISTER_NATIVES(MatrixColorFilter)
37 REGISTER_NATIVES(PathBuilder)
39 REGISTER_NATIVES(RuntimeShaderBuilder)
40 REGISTER_NATIVES(Shader)
45
46 return JNI_VERSION_1_6;
47}
#define REGISTER_NATIVES(class_name)
Definition: JetSki.cpp:11
JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
Definition: JetSki.cpp:20
Definition: __init__.py:1
CanvasImage Image
Definition: dart_ui.cc:55
CanvasPath Path
Definition: dart_ui.cc:58
SK_API sk_sp< PrecompileColorFilter > Matrix()
SK_API sk_sp< PrecompileShader > ColorFilter(SkSpan< const sk_sp< PrecompileShader > > shaders, SkSpan< const sk_sp< PrecompileColorFilter > > colorFilters)
SK_API sk_sp< PrecompileShader > LinearGradient()
SK_API sk_sp< PrecompileShader > RadialGradient()
SK_API sk_sp< PrecompileShader > SweepGradient()
SK_API sk_sp< PrecompileShader > TwoPointConicalGradient()