summaryrefslogtreecommitdiff
path: root/graphics/java/android
diff options
context:
space:
mode:
author Derek Sollenberger <djsollen@google.com> 2019-08-30 13:53:29 -0400
committer Derek Sollenberger <djsollen@google.com> 2019-10-25 16:25:39 -0400
commit79201b16f1dbfcfd23c1bbde08fd86b078a593bf (patch)
treefb86ef5d4ddd00c4998404c26d062d86d85c4fd3 /graphics/java/android
parentf2acf9fe7482b9868710e21880eee74179cc8295 (diff)
Remove native calls to HWUI from Surface and use the public API instead
Test: CtsGraphicsTestCases Bug: 137655431 Change-Id: I1eda485282306d571ca973e179e7202958b59105
Diffstat (limited to 'graphics/java/android')
-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);