private void intersectBoundsWithMatte(RectF rect, Matrix matrix) {
    if (!hasMatteOnThisLayer()) {
      return;
    }

    if (layerModel.getMatteType() == Layer.MatteType.INVERT) {
      // We can't trim the bounds if the mask is inverted since it extends all the way to the
      // composition bounds.
      return;
    }
    matteBoundsRect.set(0f, 0f, 0f, 0f);
    matteLayer.getBounds(matteBoundsRect, matrix, true);
    boolean intersects = rect.intersect(matteBoundsRect);
    if (!intersects) {
      rect.set(0f, 0f, 0f, 0f);
    }
  }
Enable this to debug slow animations by outlining masks and mattes. The performance overhead of the masks and mattes will
be proportional to the surface area of all of the masks/mattes combined.
<p>
DO NOT leave this enabled in production.
lottie/src/main/java/com/airbnb/lottie/model/layer/BaseLayer.java