Given a Drawable, how to mask it to a given shape?
问题 Background I wanted (here) to see how to create an alternative to AdaptiveIconDrawable , but change its background drawable to be shaped in to a given Path . The problem Well, what I did worked for Bitmap, but I wanted to know if it's possible to convert a given Drawable directly to a Bitmap and even a Drawable that is shaped to the given Path , without creating extra Bitmap instances. What I've tried This is the current code : fun resizePath(path: Path, width: Float, height: Float): Path {