From: seungho Date: Thu, 7 Jul 2022 08:43:59 +0000 (+0900) Subject: Add MaskingMode property in imageView to use Rendering Time Masking X-Git-Tag: accepted/tizen/unified/20231205.024657~823 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5101cd27f351ecb46fdf923e382cbef36cdca21d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Add MaskingMode property in imageView to use Rendering Time Masking Signed-off-by: seungho --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index a5703df..27c15b1 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -236,6 +236,24 @@ namespace Tizen.NUI.BaseComponents } /// + /// Enumeration for MaskingMode of image. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum MaskingModeType + { + /// + /// Applies alpha masking on rendering time. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + MaskingOnRendering, + /// + /// Applies alpha masking on loading time. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + MaskingOnLoading + } + + /// /// ImageView ResourceUrl, type string. /// This is one of mandatory property. Even if not set or null set, it sets empty string ("") internally. /// When it is set as null, it gives empty string ("") to be read. @@ -510,6 +528,44 @@ namespace Tizen.NUI.BaseComponents } /// + /// Gets or sets whether to apply mask on GPU or not.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public MaskingModeType MaskingMode + { + get + { + return (MaskingModeType)GetValue(MaskingModeProperty); + } + set + { + SetValue(MaskingModeProperty, value); + NotifyPropertyChanged(); + } + } + + private MaskingModeType InternalMaskingMode + { + get + { + int ret = (int)MaskingModeType.MaskingOnLoading; + + PropertyValue maskingMode = GetCachedImageVisualProperty(ImageVisualProperty.MaskingMode); + maskingMode?.Get(out ret); + maskingMode?.Dispose(); + + return (MaskingModeType)ret; + } + set + { + MaskingModeType ret = value; + PropertyValue setValue = new PropertyValue((int)ret); + UpdateImage(ImageVisualProperty.MaskingMode, setValue); + setValue?.Dispose(); + } + } + + /// /// Gets the loading state of the visual resource. /// /// 5 @@ -839,8 +895,6 @@ namespace Tizen.NUI.BaseComponents } } - - /// /// Gets or sets the desired image width.
/// If not specified, the actual image width is used.
diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs index bb1aa8f..3dc1024 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageViewBindableProperty.cs @@ -325,6 +325,24 @@ namespace Tizen.NUI.BaseComponents })); /// + /// MaskingModeProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MaskingModeProperty = BindableProperty.Create(nameof(MaskingMode), typeof(MaskingModeType), typeof(ImageView), default(MaskingModeType), propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Tizen.NUI.BaseComponents.ImageView)bindable; + if (newValue != null) + { + instance.InternalMaskingMode = (ImageView.MaskingModeType)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Tizen.NUI.BaseComponents.ImageView)bindable; + return instance.InternalMaskingMode; + }); + + /// /// ImageMapProperty /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/src/Tizen.NUI/src/public/Visuals/VisualConstants.cs b/src/Tizen.NUI/src/public/Visuals/VisualConstants.cs index 11abf87..595fce7 100755 --- a/src/Tizen.NUI/src/public/Visuals/VisualConstants.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualConstants.cs @@ -945,6 +945,14 @@ namespace Tizen.NUI /// [EditorBrowsable(EditorBrowsableState.Never)] public static readonly int RedrawInScalingDown = NDalic.ImageVisualOrientationCorrection + 11; + + /// + /// @brief Whether to apply mask on the GPU or not. + /// @details Name "MaskingMode", type MaskingModeType (Property::INTEGER). + /// @note It is used in the ImageVisual, and AnimatedImageVisual.The default is MaskingOnLoading. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int MaskingMode = NDalic.ImageVisualOrientationCorrection + 12; } ///