Cache soft focus shadows and compare TV rendering performance
This commit is contained in:
parent
1f69422354
commit
5bb15fa69e
11 changed files with 85 additions and 17 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,6 +189,12 @@ public final class WakeRegressionInstrumentation extends Instrumentation {
|
|||
callActivityOnPause(activity);
|
||||
callActivityOnStop(activity);
|
||||
try {
|
||||
for (Object tile : ((Map<?, ?>) field(activity, "tiles")).values()) {
|
||||
android.animation.ValueAnimator shadow =
|
||||
(android.animation.ValueAnimator) field(tile, "shadowAnimation");
|
||||
if (shadow != null && shadow.isRunning())
|
||||
throw new AssertionError("focus shadow still animating after stop");
|
||||
}
|
||||
Object scene = field(activity, "scene");
|
||||
for (String name : new String[] {"wallpaper", "mediaArt", "frame", "previousFrame"})
|
||||
if (field(scene, name) != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue