Revert "Add shadow to assistant handles"
This reverts commit c445bbf3eb.
Reason for revert: Causes memory issues on the GPU (~50mb -> ~70mb)
Test: Memory usage goes back down to 53mb with this revert.
https://sponge.corp.google.com/invocation?tab=Logfile+Index&id=7643bf50-41bb-45a7-8c93-d0ddb1f82a04&searchFor=
(last file, search for com.android.systemui#anon-and-swap-avg-median)
Bug: 141187457
Change-Id: Ia48eca3f95097562771abc3a523bd32b74f2d443
This commit is contained in:
@@ -19,7 +19,6 @@ package com.android.systemui;
|
||||
import android.animation.ArgbEvaluator;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.RectF;
|
||||
@@ -28,7 +27,6 @@ import android.util.DisplayMetrics;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.internal.graphics.ColorUtils;
|
||||
import com.android.settingslib.Utils;
|
||||
|
||||
/**
|
||||
@@ -109,7 +107,6 @@ public class CornerHandleView extends View {
|
||||
mPaint.setColor((int) ArgbEvaluator.getInstance().evaluate(darkIntensity,
|
||||
mLightColor,
|
||||
mDarkColor));
|
||||
updateShadow();
|
||||
if (getVisibility() == VISIBLE) {
|
||||
invalidate();
|
||||
}
|
||||
@@ -121,21 +118,6 @@ public class CornerHandleView extends View {
|
||||
canvas.drawPath(mPath, mPaint);
|
||||
}
|
||||
|
||||
private void updateShadow() {
|
||||
if (ColorUtils.calculateLuminance(mPaint.getColor()) > 0.7f) {
|
||||
mPaint.setShadowLayer(/** radius */ 5,/** shadowDx */ 0, /** shadowDy */ -1,
|
||||
/** color */ ColorUtils.setAlphaComponent(/** color */ Color.BLACK,
|
||||
/** alpha */ 102));
|
||||
} else {
|
||||
mPaint.setShadowLayer(/** radius */ 0, /** shadowDx */ 0, /** shadowDy */ 0,
|
||||
/** color */ Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
if (getVisibility() == VISIBLE) {
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
private static float convertDpToPixel(float dp, Context context) {
|
||||
return dp * ((float) context.getResources().getDisplayMetrics().densityDpi
|
||||
/ DisplayMetrics.DENSITY_DEFAULT);
|
||||
|
||||
Reference in New Issue
Block a user