bool NeedsDeepCopy(const SkPaint& paint) {
/*
- * These fields are known to be immutable, and so can be shallow-copied
+ * The types below are not yet immutable/reentrant-safe, and so we return
+ * true if instances of them are present in the paint.
*
- * getTypeface()
- * getAnnotation()
- * paint.getColorFilter()
- * getXfermode()
- * getPathEffect()
- * getMaskFilter()
+ * Eventually we hope this list will be empty, and we can always return
+ * false.
*/
-
- return paint.getShader() ||
+ return false
+#ifdef SK_SUPPORT_LEGACY_SHADER_LOCALMATRIX
+ || paint.getShader()
+#endif
#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
- paint.getRasterizer() ||
+ || paint.getRasterizer()
#endif
- paint.getLooper() || // needs to hide its addLayer...
- paint.getImageFilter();
+ || paint.getImageFilter()
+ ;
}