Allow setting frustum offset to not render edges of the screen (#3676)
Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
@@ -117,6 +117,18 @@ public final class MapLibreMap {
|
||||
nativeMapView.enableRenderingStatsView(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Frustum offset used to disable rendering of elements at the edge of the screen
|
||||
*
|
||||
* Offset applied to camera frustum and scissor rectangle. The camrea frustum is modified
|
||||
* to avoid loading geometry that's behind UI elements at the top of the screen. The scissor
|
||||
* rectangle is used to avoid shading fragments that are behind UI elements at the edges of
|
||||
* the screen. All values are in logical pixels.
|
||||
*/
|
||||
public void setFrustumOffset(@NonNull RectF offset) {
|
||||
nativeMapView.setFrustumOffset(offset);
|
||||
}
|
||||
|
||||
public void setSwapBehaviorFlush(boolean flush) {
|
||||
nativeMapView.setSwapBehaviorFlush(flush);
|
||||
}
|
||||
|
||||
@@ -270,6 +270,8 @@ interface NativeMap {
|
||||
|
||||
void enableRenderingStatsView(boolean value);
|
||||
|
||||
void setFrustumOffset(RectF offset);
|
||||
|
||||
void setSwapBehaviorFlush(boolean flush);
|
||||
|
||||
//
|
||||
|
||||
@@ -1149,6 +1149,14 @@ final class NativeMapView implements NativeMap {
|
||||
nativeEnableRenderingStatsView(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFrustumOffset(RectF offset) {
|
||||
if (checkState("setFrustumOffset")) {
|
||||
return;
|
||||
}
|
||||
nativeSetFrustumOffset(offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSwapBehaviorFlush(boolean flush) {
|
||||
mapRenderer.setSwapBehaviorFlush(flush);
|
||||
@@ -1746,6 +1754,9 @@ final class NativeMapView implements NativeMap {
|
||||
@Keep
|
||||
private native void nativeEnableRenderingStatsView(boolean enabled);
|
||||
|
||||
@Keep
|
||||
private native void nativeSetFrustumOffset(RectF offsset);
|
||||
|
||||
//
|
||||
// Snapshot
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user