summaryrefslogtreecommitdiff
path: root/graphics/java
diff options
context:
space:
mode:
author Huihong Luo <huisinro@google.com> 2021-01-15 14:27:06 -0800
committer Jorim Jaggi <jjaggi@google.com> 2021-02-16 17:38:12 +0100
commit5fdf7b8d26f3cd1a2f2fb8a441d40d33270d3b77 (patch)
tree42fb177d3a385875f96f560e5abc6ab35d034d7c /graphics/java
parentd8385e060c12acc21010956f4fbe57daa526a41a (diff)
Add SurfaceControl to hwui
add a method, setSurfaceControl, for java layer to pass surface control to the render thread Bug: 173671170 Test: call setSurfaceControl method in ViewRootImpl.java Change-Id: I886a79c377938f19cf38b9058f2bec64e1439000
Diffstat (limited to 'graphics/java')
-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);