diff options
author | Derek Sollenberger <djsollen@google.com> | 2019-10-30 03:11:06 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-10-30 03:11:06 +0000 |
commit | 2db814af51fc14feac253a8595a0fa557aff2205 (patch) | |
tree | e6130915bed6aa8e2c4a844e29b85a38b21f37ed /graphics/java | |
parent | cefcf97730bd9e7fd28a6e2c706f7d0c58453b1d (diff) | |
parent | 79201b16f1dbfcfd23c1bbde08fd86b078a593bf (diff) |
Merge "Remove native calls to HWUI from Surface and use the public API instead"
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/graphics/HardwareRenderer.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/HardwareRenderer.java b/graphics/java/android/graphics/HardwareRenderer.java index b6b2d4e1c46a..3f3ad578e8d7 100644 --- a/graphics/java/android/graphics/HardwareRenderer.java +++ b/graphics/java/android/graphics/HardwareRenderer.java @@ -286,10 +286,24 @@ public class HardwareRenderer { * non-null then {@link Surface#isValid()} must be true. */ public void setSurface(@Nullable Surface surface) { + setSurface(surface, false); + } + + /** + * See {@link #setSurface(Surface)} + * + * @hide + * @param discardBuffer determines whether the surface will attempt to preserve its contents + * between frames. If set to true the renderer will attempt to preserve + * the contents of the buffer between frames if the implementation allows + * it. If set to false no attempt will be made to preserve the buffer's + * contents between frames. + */ + public void setSurface(@Nullable Surface surface, boolean discardBuffer) { if (surface != null && !surface.isValid()) { throw new IllegalArgumentException("Surface is invalid. surface.isValid() == false."); } - nSetSurface(mNativeProxy, surface); + nSetSurface(mNativeProxy, surface, discardBuffer); } /** @@ -1084,7 +1098,7 @@ public class HardwareRenderer { private static native void nSetName(long nativeProxy, String name); - private static native void nSetSurface(long nativeProxy, Surface window); + private static native void nSetSurface(long nativeProxy, Surface window, boolean discardBuffer); private static native boolean nPause(long nativeProxy); |