summaryrefslogtreecommitdiff
path: root/platform/android/src/graphics
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-08-22 12:27:43 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-09-06 17:26:28 -0700
commit9cd50a891dbd320e9e4816eef4545e0a41f9ab32 (patch)
treeb424e2dcee3090d9c3f37864112d19799dd9af35 /platform/android/src/graphics
parent70a204924552463eaeca975a5dd28c00b21aa53d (diff)
downloadqtlocation-mapboxgl-upstream/jni.hpp-4.tar.gz
[android] jni.hpp 4.0.0upstream/jni.hpp-4
Diffstat (limited to 'platform/android/src/graphics')
-rw-r--r--platform/android/src/graphics/pointf.cpp8
-rw-r--r--platform/android/src/graphics/pointf.hpp4
-rw-r--r--platform/android/src/graphics/rectf.cpp16
-rw-r--r--platform/android/src/graphics/rectf.hpp8
4 files changed, 18 insertions, 18 deletions
diff --git a/platform/android/src/graphics/pointf.cpp b/platform/android/src/graphics/pointf.cpp
index eceb65b07a..2fc762d6e9 100644
--- a/platform/android/src/graphics/pointf.cpp
+++ b/platform/android/src/graphics/pointf.cpp
@@ -4,14 +4,14 @@
namespace mbgl {
namespace android {
-jni::Object<PointF> PointF::New(jni::JNIEnv& env, float x, float y) {
- static auto javaClass = jni::Class<PointF>::Singleton(env);
+jni::Local<jni::Object<PointF>> PointF::New(jni::JNIEnv& env, float x, float y) {
+ static auto& javaClass = jni::Class<PointF>::Singleton(env);
static auto constructor = javaClass.GetConstructor<float, float>(env);
return javaClass.New(env, constructor, x, y);
}
-mbgl::ScreenCoordinate PointF::getScreenCoordinate(jni::JNIEnv& env, jni::Object<PointF> point) {
- static auto javaClass = jni::Class<PointF>::Singleton(env);
+mbgl::ScreenCoordinate PointF::getScreenCoordinate(jni::JNIEnv& env, const jni::Object<PointF>& point) {
+ static auto& javaClass = jni::Class<PointF>::Singleton(env);
static auto xField = javaClass.GetField<jni::jfloat>(env, "x");
static auto yField = javaClass.GetField<jni::jfloat>(env, "y");
return mbgl::ScreenCoordinate{point.Get(env, xField), point.Get(env, yField)};
diff --git a/platform/android/src/graphics/pointf.hpp b/platform/android/src/graphics/pointf.hpp
index 27bd49138f..899468b8e3 100644
--- a/platform/android/src/graphics/pointf.hpp
+++ b/platform/android/src/graphics/pointf.hpp
@@ -12,9 +12,9 @@ public:
static constexpr auto Name() { return "android/graphics/PointF"; };
- static jni::Object<PointF> New(jni::JNIEnv&, float, float);
+ static jni::Local<jni::Object<PointF>> New(jni::JNIEnv&, float, float);
- static mbgl::ScreenCoordinate getScreenCoordinate(jni::JNIEnv&, jni::Object<PointF>);
+ static mbgl::ScreenCoordinate getScreenCoordinate(jni::JNIEnv&, const jni::Object<PointF>&);
static void registerNative(jni::JNIEnv&);
};
diff --git a/platform/android/src/graphics/rectf.cpp b/platform/android/src/graphics/rectf.cpp
index 9f05728b4c..8f418da037 100644
--- a/platform/android/src/graphics/rectf.cpp
+++ b/platform/android/src/graphics/rectf.cpp
@@ -3,26 +3,26 @@
namespace mbgl {
namespace android {
-float RectF::getLeft(jni::JNIEnv& env, jni::Object<RectF> rectf) {
- static auto javaClass = jni::Class<RectF>::Singleton(env);
+float RectF::getLeft(jni::JNIEnv& env, const jni::Object<RectF>& rectf) {
+ static auto& javaClass = jni::Class<RectF>::Singleton(env);
static auto field = javaClass.GetField<float>(env, "left");
return rectf.Get(env, field);
}
-float RectF::getTop(jni::JNIEnv& env, jni::Object<RectF> rectf) {
- static auto javaClass = jni::Class<RectF>::Singleton(env);
+float RectF::getTop(jni::JNIEnv& env, const jni::Object<RectF>& rectf) {
+ static auto& javaClass = jni::Class<RectF>::Singleton(env);
static auto field = javaClass.GetField<float>(env, "top");
return rectf.Get(env, field);
}
-float RectF::getRight(jni::JNIEnv& env, jni::Object<RectF> rectf) {
- static auto javaClass = jni::Class<RectF>::Singleton(env);
+float RectF::getRight(jni::JNIEnv& env, const jni::Object<RectF>& rectf) {
+ static auto& javaClass = jni::Class<RectF>::Singleton(env);
static auto field = javaClass.GetField<float>(env, "right");
return rectf.Get(env, field);
}
-float RectF::getBottom(jni::JNIEnv& env, jni::Object<RectF> rectf) {
- static auto javaClass = jni::Class<RectF>::Singleton(env);
+float RectF::getBottom(jni::JNIEnv& env, const jni::Object<RectF>& rectf) {
+ static auto& javaClass = jni::Class<RectF>::Singleton(env);
static auto field = javaClass.GetField<float>(env, "bottom");
return rectf.Get(env, field);
}
diff --git a/platform/android/src/graphics/rectf.hpp b/platform/android/src/graphics/rectf.hpp
index db836e78ba..ba611f2262 100644
--- a/platform/android/src/graphics/rectf.hpp
+++ b/platform/android/src/graphics/rectf.hpp
@@ -12,13 +12,13 @@ public:
static constexpr auto Name() { return "android/graphics/RectF"; };
- static float getLeft(jni::JNIEnv&, jni::Object<RectF>);
+ static float getLeft(jni::JNIEnv&, const jni::Object<RectF>&);
- static float getTop(jni::JNIEnv&, jni::Object<RectF>);
+ static float getTop(jni::JNIEnv&, const jni::Object<RectF>&);
- static float getRight(jni::JNIEnv&, jni::Object<RectF>);
+ static float getRight(jni::JNIEnv&, const jni::Object<RectF>&);
- static float getBottom(jni::JNIEnv&, jni::Object<RectF>);
+ static float getBottom(jni::JNIEnv&, const jni::Object<RectF>&);
static void registerNative(jni::JNIEnv&);
};