summaryrefslogtreecommitdiff
path: root/graphics/java/android
diff options
context:
space:
mode:
author Jorim Jaggi <jjaggi@google.com> 2021-02-16 20:11:45 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-02-16 20:11:45 +0000
commit814951f27e377cbbdbe096014404e05232479e99 (patch)
tree6f86d5057577451b74af463faa1ba6cde3ffe042 /graphics/java/android
parent2532b9d16991b7f998ce1901ec5de7d854f0c415 (diff)
parent5fdf7b8d26f3cd1a2f2fb8a441d40d33270d3b77 (diff)
Merge "Add SurfaceControl to hwui" into sc-dev
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/HardwareRenderer.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/HardwareRenderer.java b/graphics/java/android/graphics/HardwareRenderer.java
index b70fa0e693c2..88cf96a9eb4e 100644
--- a/graphics/java/android/graphics/HardwareRenderer.java
+++ b/graphics/java/android/graphics/HardwareRenderer.java
@@ -39,6 +39,7 @@ import android.view.IGraphicsStatsCallback;
import android.view.NativeVectorDrawableAnimator;
import android.view.PixelCopy;
import android.view.Surface;
+import android.view.SurfaceControl;
import android.view.SurfaceHolder;
import android.view.animation.AnimationUtils;
@@ -314,6 +315,16 @@ public class HardwareRenderer {
}
/**
+ * Sets the SurfaceControl to be used internally inside render thread
+ * @hide
+ * @param surfaceControl The surface control to pass to render thread in hwui.
+ * If null, any previous references held in render thread will be discarded.
+ */
+ public void setSurfaceControl(@Nullable SurfaceControl surfaceControl) {
+ nSetSurfaceControl(mNativeProxy, surfaceControl != null ? surfaceControl.mNativeObject : 0);
+ }
+
+ /**
* Sets the parameters that can be used to control a render request for a
* {@link HardwareRenderer}. This is not thread-safe and must not be held on to for longer
* than a single frame request.
@@ -1216,6 +1227,8 @@ public class HardwareRenderer {
private static native void nSetSurface(long nativeProxy, Surface window, boolean discardBuffer);
+ private static native void nSetSurfaceControl(long nativeProxy, long nativeSurfaceControl);
+
private static native boolean nPause(long nativeProxy);
private static native void nSetStopped(long nativeProxy, boolean stopped);