Generalized gravitational entropy