code: @Override
      public void draw(@NonNull Canvas canvas) {
          pruneRipples();
  
          // Clip to the dirty bounds, which will be the drawable bounds if we
          // have a mask or content and the ripple bounds if we're projecting.
          final Rect bounds = getDirtyBounds();
          final int saveCount = canvas.save();
          canvas.clipRect(bounds);
  
          drawContent(canvas);
          drawBackgroundAndRipples(canvas);
  
          canvas.restoreToCount(saveCount);
      }
docs: Optimized for drawing ripples with a mask layer and optional content.