summaryrefslogtreecommitdiff
path: root/graphics/java
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/HardwareRenderer.java18
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);