summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2019-11-08 13:40:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-11-08 13:40:22 +0000
commit36cf8b2c1290670b5eda56c10ecbd344bf869534 (patch)
tree3756913512b3cc5bc4e6828334b2da2c87d09117 /graphics
parentb298aeb3db215441cf46580ef1f686f8e25bc074 (diff)
parent4aa30d07c542cec423ec36db7c294825e757a157 (diff)
Merge "Remove native calls to HWUI from Surface and use the public API instead"
Diffstat (limited to 'graphics')
-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);