summaryrefslogtreecommitdiff
path: root/graphics/java/android
diff options
context:
space:
mode:
author Ady Abraham <adyabr@google.com> 2023-05-09 11:25:22 -0700
committer Ady Abraham <adyabr@google.com> 2023-05-09 11:58:22 -0700
commitcab4afeb64bbc6280990b34bd55270b19218ac04 (patch)
tree9ad912950ebca362af602fbba25f7c1863f84c6e /graphics/java/android
parent547c0592a3f7f24a9367e77b987f901e8945d5f8 (diff)
hwui: send TextureView hint to SF
So that SF could use this hint when choosing the refresh rate. SF would only try to heuristically calculate the frame rate of a layer when TextureView is updating. This fixes a bug where SF tries to heuristically calculate the frame rate for UI animations but fails due to long frames. Bug: 280249265 Test: Playing a video on Facebook and observe refresh rate Test: go/cb-pcmark Change-Id: I0d54d62b97ff48583fbe3cc0da188fe85810fd5e
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/RenderNode.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/RenderNode.java b/graphics/java/android/graphics/RenderNode.java
index dadbd8d2d1aa..2e91c240d71b 100644
--- a/graphics/java/android/graphics/RenderNode.java
+++ b/graphics/java/android/graphics/RenderNode.java
@@ -1561,6 +1561,16 @@ public final class RenderNode {
return nGetUniqueId(mNativeRenderNode);
}
+ /**
+ * Captures whether this RenderNote represents a TextureView
+ * TODO(b/281695725): Clean this up once TextureView use setFrameRate API
+ *
+ * @hide
+ */
+ public void setIsTextureView() {
+ nSetIsTextureView(mNativeRenderNode);
+ }
+
///////////////////////////////////////////////////////////////////////////
// Animations
///////////////////////////////////////////////////////////////////////////
@@ -1891,4 +1901,7 @@ public final class RenderNode {
@CriticalNative
private static native long nGetUniqueId(long renderNode);
+
+ @CriticalNative
+ private static native void nSetIsTextureView(long renderNode);
}