The proper way to create a ViewGroup that writes its children is to do this in the dispatchDraw(Canvas) method.
This is an example of how you can crop any child ViewGroup elements with a circle:
private Path path = new Path(); @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh);
The dispatchDraw method is the one that is called for the clips. There is no need to setWillNotDraw(false) if your layout just fixed it.
This image is obtained using the code above, I just expanded Facebook ProfilePictureView (which is FrameLayout , including the ImageView square with facebook profile image):

So, to achieve a round border, you do something like this:
@Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh);

In fact, you can create any difficult path :)
Remember that you can repeatedly call clipPath using the "Op" operation to traverse multiple clips as you like.
NOTE. I created a path in onSizeChanged because this in onDraw bad for performance.
NOTE2: path trimming is performed without smoothing: /, so if you want smooth borders, you will need to do it in a different way. I donβt know how to trim using anti-aliasing right now.
UPDATE (schema)
Since you can apply elevation and shadow to Android Lollipop (API 21). A new concept called Outline has been introduced. This is the path that tells the structure that the presentation form is used to compute the shadow and other things (such as ripple effects).
By default, the Outline this view is a view-size rectangle, but you can easily make it an oval / circle or a rounded rectangle. To define a custom Outline , you must use the setOutlineProvider() method in the view if it is a custom view, which you can set in the constructor with your custom ViewOutlineProvider defined as the inner class of your custom view. You can define your own Outline provider using the Path of your choice if it is a convex path (the meaning of the mathematical concept is a closed path without a notch and without holes, as an example there can be neither a star shape, nor a gear shape).
You can also use the setClipToOutline(true) method to make the outline also a clip (and I think this also works with anti-aliasing, can someone confirm / refute comments?), But this is only supported for Path Outline.
Good luck.