xref: /third_party/skia/modules/androidkit/src/Path.cpp
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/skia/modules/androidkit/src/
1cb93a386Sopenharmony_ci/*
2cb93a386Sopenharmony_ci * Copyright 2021 Google Inc.
3cb93a386Sopenharmony_ci *
4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be
5cb93a386Sopenharmony_ci * found in the LICENSE file.
6cb93a386Sopenharmony_ci */
7cb93a386Sopenharmony_ci
8cb93a386Sopenharmony_ci#include <jni.h>
9cb93a386Sopenharmony_ci
10cb93a386Sopenharmony_ci#include "include/core/SkPath.h"
11cb93a386Sopenharmony_ci
12cb93a386Sopenharmony_cinamespace {
13cb93a386Sopenharmony_cistatic void Path_Release(JNIEnv* env, jobject, jlong native_path) {
14cb93a386Sopenharmony_ci    delete reinterpret_cast<SkPath*>(native_path);
15cb93a386Sopenharmony_ci}
16cb93a386Sopenharmony_ci
17cb93a386Sopenharmony_ci}  // namespace
18cb93a386Sopenharmony_ci
19cb93a386Sopenharmony_ciint register_androidkit_Path(JNIEnv* env) {
20cb93a386Sopenharmony_ci    static const JNINativeMethod methods[] = {
21cb93a386Sopenharmony_ci        {"nRelease" , "(J)V"    , reinterpret_cast<void*>(Path_Release)},
22cb93a386Sopenharmony_ci    };
23cb93a386Sopenharmony_ci
24cb93a386Sopenharmony_ci    const auto clazz = env->FindClass("org/skia/androidkit/Path");
25cb93a386Sopenharmony_ci    return clazz
26cb93a386Sopenharmony_ci        ? env->RegisterNatives(clazz, methods, SK_ARRAY_COUNT(methods))
27cb93a386Sopenharmony_ci        : JNI_ERR;
28cb93a386Sopenharmony_ci}
29

Indexes created Thu Nov 07 10:32:03 CST 2024