|
25 | 25 |
|
26 | 26 | import static com.google.android.filament.Asserts.assertFloat3In; |
27 | 27 | import static com.google.android.filament.Asserts.assertFloat4In; |
28 | | -import static com.google.android.filament.Colors.LinearColor; |
29 | 28 |
|
30 | 29 | import com.google.android.filament.proguard.UsedByNative; |
31 | 30 |
|
@@ -674,6 +673,21 @@ public DynamicResolutionOptions getDynamicResolutionOptions() { |
674 | 673 | return mDynamicResolution; |
675 | 674 | } |
676 | 675 |
|
| 676 | + /** |
| 677 | + * Returns the last dynamic resolution scale factor used by this view. This value is updated |
| 678 | + * when Renderer::render(View*) is called |
| 679 | + * @param out A 2-float array where the value will be stored, or null in which case the array is |
| 680 | + * allocated. |
| 681 | + * @return A 2-float array containing the horizontal and the vertical scale factors |
| 682 | + * @see Renderer#render(View) |
| 683 | + */ |
| 684 | + @NonNull @Size(min = 2) |
| 685 | + public float[] getLastDynamicResolutionScale(@Nullable @Size(min = 2) float[] out) { |
| 686 | + out = Asserts.assertFloat2(out); |
| 687 | + nGetLastDynamicResolutionScale(getNativeObject(), out); |
| 688 | + return out; |
| 689 | + } |
| 690 | + |
677 | 691 | /** |
678 | 692 | * Sets the rendering quality for this view (e.g. color precision). |
679 | 693 | * |
@@ -1317,6 +1331,7 @@ void clearNativeObject() { |
1317 | 1331 | private static native void nSetDithering(long nativeView, int dithering); |
1318 | 1332 | private static native int nGetDithering(long nativeView); |
1319 | 1333 | private static native void nSetDynamicResolutionOptions(long nativeView, boolean enabled, boolean homogeneousScaling, float minScale, float maxScale, float sharpness, int quality); |
| 1334 | + private static native void nGetLastDynamicResolutionScale(long nativeView, float[] out); |
1320 | 1335 | private static native void nSetRenderQuality(long nativeView, int hdrColorBufferQuality); |
1321 | 1336 | private static native void nSetDynamicLightingOptions(long nativeView, float zLightNear, float zLightFar); |
1322 | 1337 | private static native void nSetShadowType(long nativeView, int type); |
|
0 commit comments