lottie/optimization: keep painter and surface in composition to avoid memory allocation