Revert "Make BackgroundBlurDrawable a SystemApi"
Revert "Add permission check for blurs in SurfaceFlinger" Revert "Remove public usages of FLAG_BLUR_BEHIND" Revert "Add pid and uid to SF::setClientStateLocked" Revert "Add USE_BACKGROUND_BLUR to cts expected permissions" Revert submission 13350963-blur_system_api Reason for revert: This topic made blurs a system api. API council voted against that and we will instead aim to make it public for S. None of these changes are relevant in that case. Reverted Changes: I3683db296:Remove public usages of FLAG_BLUR_BEHIND I23b21b603:Add USE_BACKGROUND_BLUR to cts expected permission... Id21f03793:Add pid and uid to SF::setClientStateLocked If5d8344a5:Add permission for blur SystemApi I70d1e1715:Add permission check for blurs in SurfaceFlinger Icf98c3607:Make window background blurs SystemApi I0b881ec6e:Make BackgroundBlurDrawable a SystemApi Bug: 177523043 Test: m Change-Id: Iee4b89b06508c7dc3b7266452bb0b987f8670fac Merged-In: Iee4b89b06508c7dc3b7266452bb0b987f8670fac
This commit is contained in:
@@ -2759,18 +2759,6 @@ package android.debug {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package android.graphics.drawable {
|
|
||||||
|
|
||||||
public final class BackgroundBlurDrawable extends android.graphics.drawable.Drawable {
|
|
||||||
ctor @RequiresPermission(android.Manifest.permission.USE_BACKGROUND_BLUR) public BackgroundBlurDrawable();
|
|
||||||
method public void setBlurRadius(int);
|
|
||||||
method public void setColor(@ColorInt int);
|
|
||||||
method public void setCornerRadius(float);
|
|
||||||
method public void setCornerRadius(float, float, float, float);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
package android.graphics.fonts {
|
package android.graphics.fonts {
|
||||||
|
|
||||||
public class FontManager {
|
public class FontManager {
|
||||||
|
|||||||
@@ -9806,20 +9806,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifyAttachForDrawables() {
|
|
||||||
if (mBackground != null) mBackground.onAttached(this);
|
|
||||||
if (mForegroundInfo != null && mForegroundInfo.mDrawable != null) {
|
|
||||||
mForegroundInfo.mDrawable.onAttached(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void notifyDetachForDrawables() {
|
|
||||||
if (mBackground != null) mBackground.onDetached(this);
|
|
||||||
if (mForegroundInfo != null && mForegroundInfo.mDrawable != null) {
|
|
||||||
mForegroundInfo.mDrawable.onDetached(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setNotifiedContentCaptureAppeared() {
|
private void setNotifiedContentCaptureAppeared() {
|
||||||
mPrivateFlags4 |= PFLAG4_NOTIFIED_CONTENT_CAPTURE_APPEARED;
|
mPrivateFlags4 |= PFLAG4_NOTIFIED_CONTENT_CAPTURE_APPEARED;
|
||||||
mPrivateFlags4 &= ~PFLAG4_NOTIFIED_CONTENT_CAPTURE_DISAPPEARED;
|
mPrivateFlags4 &= ~PFLAG4_NOTIFIED_CONTENT_CAPTURE_DISAPPEARED;
|
||||||
@@ -20671,7 +20657,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
|
|
||||||
notifyEnterOrExitForAutoFillIfNeeded(true);
|
notifyEnterOrExitForAutoFillIfNeeded(true);
|
||||||
notifyAppearedOrDisappearedForContentCaptureIfNeeded(true);
|
notifyAppearedOrDisappearedForContentCaptureIfNeeded(true);
|
||||||
notifyAttachForDrawables();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
|
||||||
@@ -20721,7 +20706,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
|
|
||||||
notifyEnterOrExitForAutoFillIfNeeded(false);
|
notifyEnterOrExitForAutoFillIfNeeded(false);
|
||||||
notifyAppearedOrDisappearedForContentCaptureIfNeeded(false);
|
notifyAppearedOrDisappearedForContentCaptureIfNeeded(false);
|
||||||
notifyDetachForDrawables();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23859,7 +23843,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
if (mBackground != null) {
|
if (mBackground != null) {
|
||||||
if (isAttachedToWindow()) {
|
if (isAttachedToWindow()) {
|
||||||
mBackground.setVisible(false, false);
|
mBackground.setVisible(false, false);
|
||||||
mBackground.onDetached(this);
|
|
||||||
}
|
}
|
||||||
mBackground.setCallback(null);
|
mBackground.setCallback(null);
|
||||||
unscheduleDrawable(mBackground);
|
unscheduleDrawable(mBackground);
|
||||||
@@ -23909,7 +23892,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
background.setState(getDrawableState());
|
background.setState(getDrawableState());
|
||||||
}
|
}
|
||||||
if (isAttachedToWindow()) {
|
if (isAttachedToWindow()) {
|
||||||
background.onAttached(this);
|
|
||||||
background.setVisible(getWindowVisibility() == VISIBLE && isShown(), false);
|
background.setVisible(getWindowVisibility() == VISIBLE && isShown(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24142,7 +24124,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
if (mForegroundInfo.mDrawable != null) {
|
if (mForegroundInfo.mDrawable != null) {
|
||||||
if (isAttachedToWindow()) {
|
if (isAttachedToWindow()) {
|
||||||
mForegroundInfo.mDrawable.setVisible(false, false);
|
mForegroundInfo.mDrawable.setVisible(false, false);
|
||||||
mForegroundInfo.mDrawable.onDetached(this);
|
|
||||||
}
|
}
|
||||||
mForegroundInfo.mDrawable.setCallback(null);
|
mForegroundInfo.mDrawable.setCallback(null);
|
||||||
unscheduleDrawable(mForegroundInfo.mDrawable);
|
unscheduleDrawable(mForegroundInfo.mDrawable);
|
||||||
@@ -24160,7 +24141,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
}
|
}
|
||||||
applyForegroundTint();
|
applyForegroundTint();
|
||||||
if (isAttachedToWindow()) {
|
if (isAttachedToWindow()) {
|
||||||
foreground.onAttached(this);
|
|
||||||
foreground.setVisible(getWindowVisibility() == VISIBLE && isShown(), false);
|
foreground.setVisible(getWindowVisibility() == VISIBLE && isShown(), false);
|
||||||
}
|
}
|
||||||
// Set callback last, since the view may still be initializing.
|
// Set callback last, since the view may still be initializing.
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ import android.graphics.RecordingCanvas;
|
|||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.Region;
|
import android.graphics.Region;
|
||||||
import android.graphics.RenderNode;
|
import android.graphics.RenderNode;
|
||||||
import android.graphics.drawable.BackgroundBlurDrawable;
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.graphics.drawable.GradientDrawable;
|
import android.graphics.drawable.GradientDrawable;
|
||||||
import android.hardware.display.DisplayManager;
|
import android.hardware.display.DisplayManager;
|
||||||
@@ -187,6 +186,7 @@ import android.window.ClientWindowFrames;
|
|||||||
import com.android.internal.R;
|
import com.android.internal.R;
|
||||||
import com.android.internal.annotations.GuardedBy;
|
import com.android.internal.annotations.GuardedBy;
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
import com.android.internal.graphics.drawable.BackgroundBlurDrawable;
|
||||||
import com.android.internal.inputmethod.InputMethodDebug;
|
import com.android.internal.inputmethod.InputMethodDebug;
|
||||||
import com.android.internal.os.IResultReceiver;
|
import com.android.internal.os.IResultReceiver;
|
||||||
import com.android.internal.os.SomeArgs;
|
import com.android.internal.os.SomeArgs;
|
||||||
@@ -671,14 +671,6 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
private final BackgroundBlurDrawable.Aggregator mBlurRegionAggregator =
|
private final BackgroundBlurDrawable.Aggregator mBlurRegionAggregator =
|
||||||
new BackgroundBlurDrawable.Aggregator(this);
|
new BackgroundBlurDrawable.Aggregator(this);
|
||||||
|
|
||||||
/**
|
|
||||||
* @return {@link BackgroundBlurDrawable.Aggregator} for this instance.
|
|
||||||
*/
|
|
||||||
@NonNull
|
|
||||||
public BackgroundBlurDrawable.Aggregator getBlurRegionAggregator() {
|
|
||||||
return mBlurRegionAggregator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {@link ImeFocusController} for this instance.
|
* @return {@link ImeFocusController} for this instance.
|
||||||
*/
|
*/
|
||||||
@@ -10084,6 +10076,13 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a background blur drawable for the backing {@link Surface}.
|
||||||
|
*/
|
||||||
|
public BackgroundBlurDrawable createBackgroundBlurDrawable() {
|
||||||
|
return mBlurRegionAggregator.createBackgroundBlurDrawable(mContext);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDescendantUnbufferedRequested() {
|
public void onDescendantUnbufferedRequested() {
|
||||||
mUnbufferedInputSource = mView.mUnbufferedInputSource;
|
mUnbufferedInputSource = mView.mUnbufferedInputSource;
|
||||||
|
|||||||
@@ -14,13 +14,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package android.graphics.drawable;
|
package com.android.internal.graphics.drawable;
|
||||||
|
|
||||||
import android.annotation.ColorInt;
|
import android.annotation.ColorInt;
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.annotation.RequiresPermission;
|
import android.content.Context;
|
||||||
import android.annotation.SystemApi;
|
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.ColorFilter;
|
import android.graphics.ColorFilter;
|
||||||
@@ -31,71 +30,59 @@ import android.graphics.PorterDuff;
|
|||||||
import android.graphics.PorterDuffXfermode;
|
import android.graphics.PorterDuffXfermode;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.RenderNode;
|
import android.graphics.RenderNode;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.util.ArrayMap;
|
import android.util.ArrayMap;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewRootImpl;
|
import android.view.ViewRootImpl;
|
||||||
|
|
||||||
|
import com.android.internal.R;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A drawable that keeps track of a blur region, pokes a hole under it, and propagates its state
|
* A drawable that keeps track of a blur region, pokes a hole under it, and propagates its state
|
||||||
* to SurfaceFlinger.
|
* to SurfaceFlinger.
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
|
||||||
public final class BackgroundBlurDrawable extends Drawable {
|
public final class BackgroundBlurDrawable extends Drawable {
|
||||||
|
|
||||||
private static final String TAG = BackgroundBlurDrawable.class.getSimpleName();
|
private static final String TAG = BackgroundBlurDrawable.class.getSimpleName();
|
||||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||||
|
|
||||||
|
private final Aggregator mAggregator;
|
||||||
private final RenderNode mRenderNode;
|
private final RenderNode mRenderNode;
|
||||||
private final Paint mPaint = new Paint();
|
private final Paint mPaint = new Paint();
|
||||||
private final Path mRectPath = new Path();
|
private final Path mRectPath = new Path();
|
||||||
private final float[] mTmpRadii = new float[8];
|
private final float[] mTmpRadii = new float[8];
|
||||||
private final SurfaceControl.BlurRegion mBlurRegion = new SurfaceControl.BlurRegion();
|
private final SurfaceControl.BlurRegion mBlurRegion = new SurfaceControl.BlurRegion();
|
||||||
|
|
||||||
private Aggregator mAggregator;
|
|
||||||
|
|
||||||
// This will be called from a thread pool.
|
// This will be called from a thread pool.
|
||||||
private final RenderNode.PositionUpdateListener mPositionUpdateListener =
|
private final RenderNode.PositionUpdateListener mPositionUpdateListener =
|
||||||
new RenderNode.PositionUpdateListener() {
|
new RenderNode.PositionUpdateListener() {
|
||||||
@Override
|
@Override
|
||||||
public void positionChanged(long frameNumber, int left, int top, int right,
|
public void positionChanged(long frameNumber, int left, int top, int right,
|
||||||
int bottom) {
|
int bottom) {
|
||||||
if (mAggregator == null) {
|
|
||||||
mBlurRegion.rect.set(left, top, right, bottom);
|
|
||||||
} else {
|
|
||||||
synchronized (mAggregator) {
|
synchronized (mAggregator) {
|
||||||
mBlurRegion.rect.set(left, top, right, bottom);
|
mBlurRegion.rect.set(left, top, right, bottom);
|
||||||
mAggregator.onBlurRegionUpdated(BackgroundBlurDrawable.this, mBlurRegion);
|
mAggregator.onBlurRegionUpdated(BackgroundBlurDrawable.this, mBlurRegion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void positionLost(long frameNumber) {
|
public void positionLost(long frameNumber) {
|
||||||
if (mAggregator == null) {
|
|
||||||
mBlurRegion.rect.setEmpty();
|
|
||||||
} else {
|
|
||||||
synchronized (mAggregator) {
|
synchronized (mAggregator) {
|
||||||
mBlurRegion.rect.setEmpty();
|
mBlurRegion.rect.setEmpty();
|
||||||
mAggregator.onBlurRegionUpdated(BackgroundBlurDrawable.this, mBlurRegion);
|
mAggregator.onBlurRegionUpdated(BackgroundBlurDrawable.this, mBlurRegion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@RequiresPermission(android.Manifest.permission.USE_BACKGROUND_BLUR)
|
private BackgroundBlurDrawable(Aggregator aggregator) {
|
||||||
public BackgroundBlurDrawable() {
|
mAggregator = aggregator;
|
||||||
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));
|
mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));
|
||||||
mPaint.setColor(Color.TRANSPARENT);
|
mPaint.setColor(Color.TRANSPARENT);
|
||||||
mRenderNode = new RenderNode("BackgroundBlurDrawable");
|
mRenderNode = new RenderNode("BackgroundBlurDrawable");
|
||||||
mRenderNode.addPositionUpdateListener(mPositionUpdateListener);
|
mRenderNode.addPositionUpdateListener(mPositionUpdateListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(@NonNull Canvas canvas) {
|
public void draw(@NonNull Canvas canvas) {
|
||||||
if (mRectPath.isEmpty() || !isVisible() || getAlpha() == 0) {
|
if (mRectPath.isEmpty() || !isVisible() || getAlpha() == 0) {
|
||||||
@@ -113,9 +100,6 @@ public final class BackgroundBlurDrawable extends Drawable {
|
|||||||
mPaint.setColor(color);
|
mPaint.setColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setVisible(boolean visible, boolean restart) {
|
public boolean setVisible(boolean visible, boolean restart) {
|
||||||
boolean changed = super.setVisible(visible, restart);
|
boolean changed = super.setVisible(visible, restart);
|
||||||
@@ -125,9 +109,6 @@ public final class BackgroundBlurDrawable extends Drawable {
|
|||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void setAlpha(int alpha) {
|
public void setAlpha(int alpha) {
|
||||||
mBlurRegion.alpha = alpha / 255f;
|
mBlurRegion.alpha = alpha / 255f;
|
||||||
@@ -158,12 +139,12 @@ public final class BackgroundBlurDrawable extends Drawable {
|
|||||||
*/
|
*/
|
||||||
public void setCornerRadius(float cornerRadiusTL, float cornerRadiusTR, float cornerRadiusBL,
|
public void setCornerRadius(float cornerRadiusTL, float cornerRadiusTR, float cornerRadiusBL,
|
||||||
float cornerRadiusBR) {
|
float cornerRadiusBR) {
|
||||||
maybeRunSynchronized(() -> {
|
synchronized (mAggregator) {
|
||||||
mBlurRegion.cornerRadiusTL = cornerRadiusTL;
|
mBlurRegion.cornerRadiusTL = cornerRadiusTL;
|
||||||
mBlurRegion.cornerRadiusTR = cornerRadiusTR;
|
mBlurRegion.cornerRadiusTR = cornerRadiusTR;
|
||||||
mBlurRegion.cornerRadiusBL = cornerRadiusBL;
|
mBlurRegion.cornerRadiusBL = cornerRadiusBL;
|
||||||
mBlurRegion.cornerRadiusBR = cornerRadiusBR;
|
mBlurRegion.cornerRadiusBR = cornerRadiusBR;
|
||||||
});
|
}
|
||||||
updatePath();
|
updatePath();
|
||||||
invalidateSelf();
|
invalidateSelf();
|
||||||
}
|
}
|
||||||
@@ -176,13 +157,12 @@ public final class BackgroundBlurDrawable extends Drawable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updatePath() {
|
private void updatePath() {
|
||||||
maybeRunSynchronized(() -> {
|
synchronized (mAggregator) {
|
||||||
mTmpRadii[0] = mTmpRadii[1] = mBlurRegion.cornerRadiusTL;
|
mTmpRadii[0] = mTmpRadii[1] = mBlurRegion.cornerRadiusTL;
|
||||||
mTmpRadii[2] = mTmpRadii[3] = mBlurRegion.cornerRadiusTR;
|
mTmpRadii[2] = mTmpRadii[3] = mBlurRegion.cornerRadiusTR;
|
||||||
mTmpRadii[4] = mTmpRadii[5] = mBlurRegion.cornerRadiusBL;
|
mTmpRadii[4] = mTmpRadii[5] = mBlurRegion.cornerRadiusBL;
|
||||||
mTmpRadii[6] = mTmpRadii[7] = mBlurRegion.cornerRadiusBR;
|
mTmpRadii[6] = mTmpRadii[7] = mBlurRegion.cornerRadiusBR;
|
||||||
});
|
}
|
||||||
|
|
||||||
mRectPath.reset();
|
mRectPath.reset();
|
||||||
if (getAlpha() == 0 || !isVisible()) {
|
if (getAlpha() == 0 || !isVisible()) {
|
||||||
return;
|
return;
|
||||||
@@ -192,62 +172,19 @@ public final class BackgroundBlurDrawable extends Drawable {
|
|||||||
Path.Direction.CW);
|
Path.Direction.CW);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void setColorFilter(@Nullable ColorFilter colorFilter) {
|
public void setColorFilter(@Nullable ColorFilter colorFilter) {
|
||||||
throw new IllegalArgumentException("not implemented");
|
throw new IllegalArgumentException("not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int getOpacity() {
|
public int getOpacity() {
|
||||||
return PixelFormat.TRANSLUCENT;
|
return PixelFormat.TRANSLUCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onAttached(@NonNull View v) {
|
|
||||||
super.onAttached(v);
|
|
||||||
mAggregator = v.getViewRootImpl().getBlurRegionAggregator();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onDetached(@NonNull View v) {
|
|
||||||
super.onDetached(v);
|
|
||||||
mAggregator = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Aggregator is called from the RenderThread to aggregate all blur regions and send them
|
|
||||||
* to SurfaceFlinger. Since the BackgroundBlurDrawable could be updated at any time from the
|
|
||||||
* main thread, we need to synchronize the two threads. The BackgroundBlurDrawable may be
|
|
||||||
* instantiated before the ViewRootImpl is created, i.e. before the Aggregator is created.
|
|
||||||
* In that case, updates are not synchronized.
|
|
||||||
*/
|
|
||||||
private void maybeRunSynchronized(Runnable r) {
|
|
||||||
if (mAggregator == null) {
|
|
||||||
r.run();
|
|
||||||
} else {
|
|
||||||
synchronized (mAggregator) {
|
|
||||||
r.run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Responsible for keeping track of all blur regions of a {@link ViewRootImpl} and posting a
|
* Responsible for keeping track of all blur regions of a {@link ViewRootImpl} and posting a
|
||||||
* message when it's time to propagate them.
|
* message when it's time to propagate them.
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
*/
|
||||||
public static final class Aggregator {
|
public static final class Aggregator {
|
||||||
|
|
||||||
@@ -261,6 +198,16 @@ public final class BackgroundBlurDrawable extends Drawable {
|
|||||||
mViewRoot = viewRoot;
|
mViewRoot = viewRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a blur region with default radius.
|
||||||
|
*/
|
||||||
|
public BackgroundBlurDrawable createBackgroundBlurDrawable(Context context) {
|
||||||
|
BackgroundBlurDrawable drawable = new BackgroundBlurDrawable(this);
|
||||||
|
drawable.setBlurRadius(context.getResources().getDimensionPixelSize(
|
||||||
|
R.dimen.default_background_blur_radius));
|
||||||
|
return drawable;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called from RenderThread only, already locked.
|
* Called from RenderThread only, already locked.
|
||||||
* @param drawable
|
* @param drawable
|
||||||
@@ -1464,24 +1464,6 @@ public abstract class Drawable {
|
|||||||
mVisible = attrs.getBoolean(visibleAttr, mVisible);
|
mVisible = attrs.getBoolean(visibleAttr, mVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Notifies the drawable that it has been attached.
|
|
||||||
*
|
|
||||||
* @param v The view that it is attached to
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public void onAttached(View v) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notifies the drawable that it has been detached.
|
|
||||||
*
|
|
||||||
* @param v The view that it is detached from
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public void onDetached(View v) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the source override density for this Drawable. If non-zero, this density is to be used
|
* Sets the source override density for this Drawable. If non-zero, this density is to be used
|
||||||
* for any calls to {@link Resources#getDrawableForDensity(int, int, Theme)} or
|
* for any calls to {@link Resources#getDrawableForDensity(int, int, Theme)} or
|
||||||
|
|||||||
Reference in New Issue
Block a user