Cache soft focus shadows and compare TV rendering performance

This commit is contained in:
Elijah Kuntz 2026-10-19 10:01:28 -07:00
parent 1f69422354
commit 5bb15fa69e
11 changed files with 85 additions and 17 deletions

View file

@ -56,6 +56,15 @@ public final class PerformanceInstrumentation extends Instrumentation {
for (View item : items) {
try {
((View) field(item, "art")).setOutlineProvider(null);
try {
((android.graphics.Paint) field(item, "shadowPaint"))
.setColorFilter(
new android.graphics.PorterDuffColorFilter(
android.graphics.Color.TRANSPARENT,
android.graphics.PorterDuff.Mode.SRC_IN));
} catch (NoSuchFieldException legacyNativeShadow) {
// Older builds only have Android's elevation shadow.
}
} catch (Exception e) {
throw new RuntimeException(e);
}