Use a host interface for CustomLayer instead of function pointers (#11553)

Use a host interface for CustomLayer instead of function pointers

Co-authored-by: Julian Rex <julian.rex@mapbox.com>
This commit is contained in:
Asheem Mamoowala
2018-04-02 16:15:25 -07:00
committed by GitHub
parent c3079c6155
commit 099fcc3b3c
21 changed files with 403 additions and 305 deletions

View File

@@ -9,20 +9,8 @@ package com.mapbox.mapboxsdk.style.layers;
public class CustomLayer extends Layer {
public CustomLayer(String id,
long context,
long initializeFunction,
long renderFunction,
long deinitializeFunction) {
this(id, context, initializeFunction, renderFunction, 0L, deinitializeFunction);
}
public CustomLayer(String id,
long context,
long initializeFunction,
long renderFunction,
long contextLostFunction,
long deinitializeFunction) {
initialize(id, initializeFunction, renderFunction, contextLostFunction, deinitializeFunction, context);
long host) {
initialize(id, host);
}
public CustomLayer(long nativePtr) {
@@ -33,9 +21,7 @@ public class CustomLayer extends Layer {
nativeUpdate();
}
protected native void initialize(String id, long initializeFunction, long renderFunction,
long contextLostFunction, long deinitializeFunction,
long context);
protected native void initialize(String id, long host);
protected native void nativeUpdate();