From cab4afeb64bbc6280990b34bd55270b19218ac04 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Tue, 9 May 2023 11:25:22 -0700 Subject: 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 --- graphics/java/android/graphics/RenderNode.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'graphics/java') 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); } -- cgit v1.2.3-59-g8ed1b