Add a short circuit so that a layer is not processed if opacity == 0.