Gate off "mixBlendMode" and "filter" on Paper (#45443)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45443

We are only building these out for Fabric. This means only one natural iOS impl, but that other Android bits will not work fully correctly on Paper (like setting containing block for filter element). This also means we can remove view configs once we're on Fabric CSS parser. We will do the same for boxShadow once that is ready.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D59762282

fbshipit-source-id: 14ce07f04b822c6aee908894c9081419594fc484
This commit is contained in:
Nick Gerleman
2024-07-15 13:05:40 -07:00
committed by Facebook GitHub Bot
parent 018d0621c1
commit 2d67b723d3
3 changed files with 17 additions and 2 deletions
@@ -5531,6 +5531,7 @@ public final class com/facebook/react/uimanager/common/ViewUtil {
public static final field NO_SURFACE_ID I
public static final fun getUIManagerType (I)I
public static final fun getUIManagerType (II)I
public static final fun getUIManagerType (Landroid/view/View;)I
public static final fun isRootTag (I)Z
}
@@ -31,6 +31,8 @@ import com.facebook.react.common.ReactConstants;
import com.facebook.react.uimanager.ReactAccessibilityDelegate.AccessibilityRole;
import com.facebook.react.uimanager.ReactAccessibilityDelegate.Role;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.common.UIManagerType;
import com.facebook.react.uimanager.common.ViewUtil;
import com.facebook.react.uimanager.events.PointerEventHelper;
import com.facebook.react.uimanager.util.ReactFindViewUtil;
import java.util.ArrayList;
@@ -190,13 +192,17 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
@Override
@ReactProp(name = ViewProps.FILTER, customType = "Filter")
public void setFilter(@NonNull T view, @Nullable ReadableArray filter) {
view.setTag(R.id.filter, filter);
if (ViewUtil.getUIManagerType(view) == UIManagerType.FABRIC) {
view.setTag(R.id.filter, filter);
}
}
@Override
@ReactProp(name = ViewProps.MIX_BLEND_MODE)
public void setMixBlendMode(@NonNull T view, @Nullable String mixBlendMode) {
view.setTag(R.id.mix_blend_mode, BlendModeHelper.parseMixBlendMode(mixBlendMode));
if (ViewUtil.getUIManagerType(view) == UIManagerType.FABRIC) {
view.setTag(R.id.mix_blend_mode, BlendModeHelper.parseMixBlendMode(mixBlendMode));
}
}
@Override
@@ -7,6 +7,8 @@
package com.facebook.react.uimanager.common
import android.view.View
public object ViewUtil {
public const val NO_SURFACE_ID: Int = -1
@@ -26,6 +28,12 @@ public object ViewUtil {
UIManagerType.DEFAULT
}
/**
* Overload for {@link #getUIManagerType(int)} that uses the view's id to determine if it
* originated from Fabric
*/
@JvmStatic @UIManagerType public fun getUIManagerType(view: View): Int = getUIManagerType(view.id)
/**
* Version of getUIManagerType that uses both surfaceId and viewTag heuristics
*