Skip to content

Commit

Permalink
[NUI] Add View.OffScreenRendering property
Browse files Browse the repository at this point in the history
Signed-off-by: jmm <[email protected]>
  • Loading branch information
jmmhappy authored and hinohie committed Dec 12, 2024
1 parent 616664b commit 183047b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Tizen.NUI/src/internal/Interop/Interop.ViewProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ internal static partial class ViewProperty

[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_Property_AUTOMATION_ID_get")]
public static extern int AutomationIdGet();

[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_Property_OFFSCREEN_RENDERING_get")]
public static extern int OffScreenRenderingGet();
}
}
}
33 changes: 32 additions & 1 deletion src/Tizen.NUI/src/public/BaseComponents/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ static View()
DispatchHoverMotionProperty = BindableProperty.Create(nameof(DispatchHoverMotion), typeof(bool), typeof(View), false,
propertyChanged: SetInternalDispatchHoverMotionProperty, defaultValueCreator: GetInternalDispatchHoverMotionProperty);


RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
Expand Down Expand Up @@ -5990,5 +5989,37 @@ public string VoiceInteractionName
return AutomationId;
}
}

/// <summary>
/// Gets of sets the current offscreen rendering type of the view.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public OffScreenRenderingType OffScreenRendering
{
get
{
return GetInternalOffScreenRendering();
}
set
{
SetInternalOffScreenRendering(value);
NotifyPropertyChanged();
}
}
private void SetInternalOffScreenRendering(OffScreenRenderingType value)
{
Object.InternalSetPropertyInt(SwigCPtr, Property.OffScreenRendering, (int)value);
}
private OffScreenRenderingType GetInternalOffScreenRendering()
{
int temp = Object.InternalGetPropertyInt(SwigCPtr, Property.OffScreenRendering);
switch (temp)
{
case 0: return OffScreenRenderingType.None;
case 1: return OffScreenRenderingType.RefreshOnce;
case 2: return OffScreenRenderingType.RefreshAlways;
default: return OffScreenRenderingType.None;
}
}
}
}
27 changes: 27 additions & 0 deletions src/Tizen.NUI/src/public/BaseComponents/ViewEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,32 @@ public enum FocusDirection
CounterClockwise,
}

/// <summary>
/// Describes offscreen rendering types.
/// View with this property enabled renders at offscreen buffer, with all its children.
/// The property expects to reduce many repetitive render calls.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public enum OffScreenRenderingType
{
/// <summary>
/// No offscreen rendering.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
None,
/// <summary>
/// Draw offscreen only once.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
RefreshOnce,
/// <summary>
/// Draw offscreen every frame.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
RefreshAlways,
};


/// <summary>
/// Actions property value to update visual property.
/// Note : Only few kind of properies can be update. Update with invalid property action is undefined.
Expand Down Expand Up @@ -266,6 +292,7 @@ internal class Property
internal static readonly int UpdateAreaHint = Interop.ActorProperty.UpdateAreaHintGet();
internal static readonly int DispatchTouchMotion = Interop.ActorProperty.DispatchTouchMotionGet();
internal static readonly int DispatchHoverMotion = Interop.ActorProperty.DispatchHoverMotionGet();
internal static readonly int OffScreenRendering = Interop.ViewProperty.OffScreenRenderingGet();
}
}
}

0 comments on commit 183047b

Please sign in to comment.