From 69050ddabbc254b12fa3ac61536f4eece7459249 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Tue, 22 Aug 2017 16:32:45 +0300 Subject: [android] map snapshotter --- .../android/src/snapshotter/map_snapshotter.hpp | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 platform/android/src/snapshotter/map_snapshotter.hpp (limited to 'platform/android/src/snapshotter/map_snapshotter.hpp') diff --git a/platform/android/src/snapshotter/map_snapshotter.hpp b/platform/android/src/snapshotter/map_snapshotter.hpp new file mode 100644 index 0000000000..093f589c05 --- /dev/null +++ b/platform/android/src/snapshotter/map_snapshotter.hpp @@ -0,0 +1,61 @@ +#pragma once + +#include +#include +#include + +#include "../file_source.hpp" +#include "../geometry/lat_lng_bounds.hpp" +#include "../map/camera_position.hpp" + +#include +#include "../jni/generic_global_ref_deleter.hpp" + +#include + +namespace mbgl { +namespace android { + +class SnapshotterRendererFrontend; + +class MapSnapshotter { +public: + + static constexpr auto Name() { return "com/mapbox/mapboxsdk/snapshotter/MapSnapshotter"; }; + + static jni::Class javaClass; + + static void registerNative(jni::JNIEnv&); + + MapSnapshotter(jni::JNIEnv&, + jni::Object, + jni::Object, + jni::jfloat pixelRatio, + jni::jint width, + jni::jint height, + jni::String styleURL, + jni::Object region, + jni::Object position, + jni::String programCacheDir); + + ~MapSnapshotter(); + + void start(JNIEnv&); + + void cancel(JNIEnv&); + +private: + MBGL_STORE_THREAD(tid); + + JavaVM *vm = nullptr; + GenericUniqueWeakObject javaPeer; + + float pixelRatio; + + std::shared_ptr threadPool; + std::unique_ptr> snapshotCallback; + std::unique_ptr snapshotter; +}; + +} // namespace android +} // namespace mbgl \ No newline at end of file -- cgit v1.2.1