summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgnelo Vaz <agnelo.vaz@samsung.com>2017-09-27 15:28:14 +0100
committerAgnelo Vaz <agnelo.vaz@samsung.com>2017-10-18 14:34:14 +0000
commitdeec08bd67d3d8f25fca8e482cb8141f0aa96c65 (patch)
treeda19c55e3efc5df7f0e8cf301ec909d2d568f0d1
parentdd4d91b104bfd604076760d6568a0a59d04cfc8a (diff)
downloadnui-deec08bd67d3d8f25fca8e482cb8141f0aa96c65.tar.gz
nui-deec08bd67d3d8f25fca8e482cb8141f0aa96c65.tar.bz2
nui-deec08bd67d3d8f25fca8e482cb8141f0aa96c65.zip
Adding ImageVisual ReleasePolicy & LoadPolicy
Change-Id: I9c434fb9336426556142c1a3fad8d73797d22f24
-rwxr-xr-xTizen.NUI/src/internal/NDalic.cs2
-rwxr-xr-xTizen.NUI/src/internal/NDalicPINVOKE.cs6
-rwxr-xr-xTizen.NUI/src/public/NUIConstants.cs39
-rwxr-xr-xTizen.NUI/src/public/VisualMaps.cs39
4 files changed, 85 insertions, 1 deletions
diff --git a/Tizen.NUI/src/internal/NDalic.cs b/Tizen.NUI/src/internal/NDalic.cs
index 13697ac..62c3f1c 100755
--- a/Tizen.NUI/src/internal/NDalic.cs
+++ b/Tizen.NUI/src/internal/NDalic.cs
@@ -885,6 +885,8 @@ namespace Tizen.NUI
internal static readonly int IMAGE_VISUAL_FRAME_DELAY = NDalicPINVOKE.IMAGE_VISUAL_FRAME_DELAY_get();
internal static readonly int IMAGE_VISUAL_MASK_CONTENT_SCALE = NDalicPINVOKE.IMAGE_VISUAL_MASK_CONTENT_SCALE_get();
internal static readonly int IMAGE_VISUAL_CROP_TO_MASK = NDalicPINVOKE.IMAGE_VISUAL_CROP_TO_MASK_get();
+ internal static readonly int IMAGE_VISUAL_RELEASE_POLICY = NDalicPINVOKE.IMAGE_VISUAL_RELEASE_POLICY_get();
+ internal static readonly int IMAGE_VISUAL_LOAD_POLICY = NDalicPINVOKE.IMAGE_VISUAL_LOAD_POLICY_get();
internal static readonly int MESH_VISUAL_OBJECT_URL = NDalicPINVOKE.MESH_VISUAL_OBJECT_URL_get();
internal static readonly int MESH_VISUAL_MATERIAL_URL = NDalicPINVOKE.MESH_VISUAL_MATERIAL_URL_get();
diff --git a/Tizen.NUI/src/internal/NDalicPINVOKE.cs b/Tizen.NUI/src/internal/NDalicPINVOKE.cs
index 728cea5..73ce6d8 100755
--- a/Tizen.NUI/src/internal/NDalicPINVOKE.cs
+++ b/Tizen.NUI/src/internal/NDalicPINVOKE.cs
@@ -6564,6 +6564,12 @@ class NDalicPINVOKE {
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_CROP_TO_MASK_get")]
public static extern int IMAGE_VISUAL_CROP_TO_MASK_get();
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_RELEASE_POLICY_get")]
+ public static extern int IMAGE_VISUAL_RELEASE_POLICY_get();
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_LOAD_POLICY_get")]
+ public static extern int IMAGE_VISUAL_LOAD_POLICY_get();
+
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_MESH_VISUAL_OBJECT_URL_get")]
public static extern int MESH_VISUAL_OBJECT_URL_get();
diff --git a/Tizen.NUI/src/public/NUIConstants.cs b/Tizen.NUI/src/public/NUIConstants.cs
index b89e0cd..6b8e184 100755
--- a/Tizen.NUI/src/public/NUIConstants.cs
+++ b/Tizen.NUI/src/public/NUIConstants.cs
@@ -481,6 +481,42 @@ namespace Tizen.NUI
}
/// <summary>
+ /// Specifies the Release Policy types <br>
+ /// Decides if the image should be cached in different conditions
+ /// </summary>
+ public enum ReleasePolicyType
+ {
+ /// <summary>
+ /// Image is released when visual detached from scene
+ /// </summary>
+ Detached = 0,
+ /// <summary>
+ /// Image is only released when visual is destroyed
+ /// </summary>
+ Destroyed,
+ /// <summary>
+ /// Image is not released.
+ /// </summary>
+ Never
+ }
+
+ /// <summary>
+ /// Specifies the Load Policy types <br>
+ /// Decides when the image texture should be loaded
+ /// </summary>
+ public enum LoadPolicyType
+ {
+ /// <summary>
+ /// Load texture once the image source has been provided. Even if not being used yet.
+ /// </summary>
+ Immediate = 0,
+ /// <summary>
+ /// Only load texture once the visual is attached, when the image needs to be shown.
+ /// </summary>
+ Attached
+ }
+
+ /// <summary>
/// The type of coordinate system for certain attributes of the points in a gradient.
/// </summary>
public enum GradientVisualUnitsType
@@ -833,7 +869,8 @@ namespace Tizen.NUI
public static readonly int BatchSize = NDalic.IMAGE_VISUAL_BATCH_SIZE;
public static readonly int CacheSize = NDalic.IMAGE_VISUAL_CACHE_SIZE;
public static readonly int FrameDelay = NDalic.IMAGE_VISUAL_FRAME_DELAY;
-
+ public static readonly int ReleasePolicy = NDalic.IMAGE_VISUAL_RELEASE_POLICY;
+ public static readonly int LoadPolicy = NDalic.IMAGE_VISUAL_LOAD_POLICY;
}
/// <summary>
diff --git a/Tizen.NUI/src/public/VisualMaps.cs b/Tizen.NUI/src/public/VisualMaps.cs
index 6dc815d..da6550e 100755
--- a/Tizen.NUI/src/public/VisualMaps.cs
+++ b/Tizen.NUI/src/public/VisualMaps.cs
@@ -570,6 +570,8 @@ namespace Tizen.NUI
private WrapModeType? _wrapModeV = null;
private float? _maskContentScale = null;
private bool? _cropToMask = null;
+ private ReleasePolicyType? _releasePolicy = null;
+ private LoadPolicyType? _loadPolicy = null;
/// <summary>
/// Get or set the URL of the image.<br>
@@ -809,6 +811,41 @@ namespace Tizen.NUI
}
}
+ /// <summary>
+ /// Get or set the Image Visual release policy<br>
+ /// It decides if a texture should be released from the cache or kept to reduce loading time <br>
+ /// </summary>
+ public ReleasePolicyType ReleasePolicy
+ {
+ get
+ {
+ return _releasePolicy ?? (ReleasePolicyType.Destroyed );
+ }
+ set
+ {
+ _releasePolicy = value;
+ UpdateVisual();
+ }
+ }
+
+
+ /// <summary>
+ /// Get or set the Image Visual image loading policy<br>
+ /// It decides if a texture should be loaded immediately after source set or only after visual is added to window <br>
+ /// </summary>
+ public LoadPolicyType LoadPolicy
+ {
+ get
+ {
+ return _loadPolicy ?? (LoadPolicyType.Attached);
+ }
+ set
+ {
+ _loadPolicy = value;
+ UpdateVisual();
+ }
+ }
+
protected override void ComposingPropertyMap()
{
if (_url != null)
@@ -832,6 +869,8 @@ namespace Tizen.NUI
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
+ if (_releasePolicy != null) { _outputVisualMap.Add( ImageVisualProperty.ReleasePolicy , new PropertyValue((int)_releasePolicy)); }
+ if (_loadPolicy != null) { _outputVisualMap.Add( ImageVisualProperty.LoadPolicy, new PropertyValue((int)_loadPolicy)); }
}
}
}