Add an intersect mask warning at parse time (#841)
Fixes #784
diff --git a/lottie/src/main/java/com/airbnb/lottie/model/layer/BaseLayer.java b/lottie/src/main/java/com/airbnb/lottie/model/layer/BaseLayer.java
index 784cc7b..f9e7a2a 100644
--- a/lottie/src/main/java/com/airbnb/lottie/model/layer/BaseLayer.java
+++ b/lottie/src/main/java/com/airbnb/lottie/model/layer/BaseLayer.java
@@ -37,8 +37,6 @@
private static final int SAVE_FLAGS = Canvas.CLIP_SAVE_FLAG | Canvas.CLIP_TO_LAYER_SAVE_FLAG |
Canvas.MATRIX_SAVE_FLAG;
- private static boolean hasLoggedIntersectMasks = false;
-
@Nullable
static BaseLayer forModel(
Layer layerModel, LottieDrawable drawable, LottieComposition composition) {
@@ -349,11 +347,6 @@
paint = subtractMaskPaint;
break;
case MaskModeIntersect:
- if (!hasLoggedIntersectMasks) {
- Log.w(L.TAG, "Animation contains intersect masks. They are not supported but will be " +
- "treated like add masks.");
- hasLoggedIntersectMasks = true;
- }
case MaskModeAdd:
default:
// As a hack, we treat all non-subtract masks like add masks. This is not correct but it's
diff --git a/lottie/src/main/java/com/airbnb/lottie/parser/MaskParser.java b/lottie/src/main/java/com/airbnb/lottie/parser/MaskParser.java
index 134e268..50dadbc 100644
--- a/lottie/src/main/java/com/airbnb/lottie/parser/MaskParser.java
+++ b/lottie/src/main/java/com/airbnb/lottie/parser/MaskParser.java
@@ -34,6 +34,8 @@
maskMode = Mask.MaskMode.MaskModeSubtract;
break;
case "i":
+ composition.addWarning(
+ "Animation contains intersect masks. They are not supported but will be treated like add masks.");
maskMode = Mask.MaskMode.MaskModeIntersect;
break;
default: