The flexoelectricity of barium and strontium titanates from first principles