From f9daacc4779ff38a3a53486abc6ecd7fcf002f18 Mon Sep 17 00:00:00 2001 From: Woochan Lee Date: Mon, 13 Jan 2025 14:37:55 +0900 Subject: [PATCH] [NUI] Preload static values --- .../src/public/Application/NUIApplication.cs | 1 + .../src/public/Common/NUIConstants.cs | 29 +++++++++++++++++++ src/Tizen.NUI/src/public/Common/Position.cs | 5 ++++ src/Tizen.NUI/src/public/Common/Vector2.cs | 5 ++++ src/Tizen.NUI/src/public/Common/Vector3.cs | 5 ++++ src/Tizen.NUI/src/public/Common/Vector4.cs | 5 ++++ 6 files changed, 50 insertions(+) diff --git a/src/Tizen.NUI/src/public/Application/NUIApplication.cs b/src/Tizen.NUI/src/public/Application/NUIApplication.cs index 7d4e663b966..878c20a89a2 100755 --- a/src/Tizen.NUI/src/public/Application/NUIApplication.cs +++ b/src/Tizen.NUI/src/public/Application/NUIApplication.cs @@ -783,6 +783,7 @@ static public void Preload() BaseComponents.TextField.Preload(); Disposable.Preload(); Color.Preload(); + NUIConstants.Preload(); // Initialize exception tasks. It must be called end of Preload() NDalicPINVOKE.Preload(); diff --git a/src/Tizen.NUI/src/public/Common/NUIConstants.cs b/src/Tizen.NUI/src/public/Common/NUIConstants.cs index 2f94353b4e9..90897de61cc 100755 --- a/src/Tizen.NUI/src/public/Common/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/Common/NUIConstants.cs @@ -1333,6 +1333,11 @@ public struct ParentOrigin private static readonly Position bottomCenter = new Position(Middle, Bottom, Middle); private static readonly Position bottomRight = new Position(Right, Bottom, Middle); + internal static void Preload() + { + // Do nothing. Just call for load static values. + } + /// /// Top /// @@ -1522,6 +1527,11 @@ public struct PositionAxis private static readonly Position negativeYaxis = new Position(0.0f, -1.0f, 0.0f); private static readonly Position negativeZaxis = new Position(0.0f, 0.0f, -1.0f); + internal static void Preload() + { + // Do nothing. Jsut call for load static values. + } + /// /// The X axis /// @@ -1909,6 +1919,11 @@ public struct SlideTransitionDirection private static readonly Vector2 left = new Vector2(-1, 0); private static readonly Vector2 right = new Vector2(1, 0); + internal static void Preload() + { + // Do nothing. Just call for load static values. + } + /// /// Top /// @@ -1958,4 +1973,18 @@ public enum WindowBlurType [EditorBrowsable(EditorBrowsableState.Never)] Behind = 2, } + + internal struct NUIConstants + { + internal static void Preload() + { + ParentOrigin.Preload(); + SlideTransitionDirection.Preload(); + PositionAxis.Preload(); + Position.Preload(); + Vector2.Preload(); + Vector3.Preload(); + Vector4.Preload(); + } + } } diff --git a/src/Tizen.NUI/src/public/Common/Position.cs b/src/Tizen.NUI/src/public/Common/Position.cs index c5958e8ab34..774abc0f6aa 100755 --- a/src/Tizen.NUI/src/public/Common/Position.cs +++ b/src/Tizen.NUI/src/public/Common/Position.cs @@ -32,6 +32,11 @@ public class Position : Disposable, ICloneable private static readonly Position one = new Position(1.0f, 1.0f, 1.0f); private static readonly Position zero = new Position(0.0f, 0.0f, 0.0f); + internal static new void Preload() + { + // Do nothing. Just call for load static values. + } + /// /// The constructor. /// diff --git a/src/Tizen.NUI/src/public/Common/Vector2.cs b/src/Tizen.NUI/src/public/Common/Vector2.cs index e18cca5efe1..605247f2bd5 100755 --- a/src/Tizen.NUI/src/public/Common/Vector2.cs +++ b/src/Tizen.NUI/src/public/Common/Vector2.cs @@ -35,6 +35,11 @@ public class Vector2 : Disposable, ICloneable private static readonly Vector2 negativeXaxis = new Vector2(-1.0f, 0.0f); private static readonly Vector2 negativeYaxis = new Vector2(0.0f, -1.0f); + internal static new void Preload() + { + // Do nothing. Just call for load static values. + } + /// /// The default constructor initializes the vector to 0. /// diff --git a/src/Tizen.NUI/src/public/Common/Vector3.cs b/src/Tizen.NUI/src/public/Common/Vector3.cs index 41cc4fe5a95..4f8e453fbe5 100755 --- a/src/Tizen.NUI/src/public/Common/Vector3.cs +++ b/src/Tizen.NUI/src/public/Common/Vector3.cs @@ -37,6 +37,11 @@ public class Vector3 : Disposable, ICloneable private static readonly Vector3 negativeYaxis = new Vector3(0.0f, -1.0f, 0.0f); private static readonly Vector3 negativeZaxis = new Vector3(0.0f, 0.0f, -1.0f); + internal static new void Preload() + { + // Do nothing. Just call for load static values. + } + /// /// The default constructor of Vector3 class. /// diff --git a/src/Tizen.NUI/src/public/Common/Vector4.cs b/src/Tizen.NUI/src/public/Common/Vector4.cs index 54267ebb9f6..592a8b71ab4 100755 --- a/src/Tizen.NUI/src/public/Common/Vector4.cs +++ b/src/Tizen.NUI/src/public/Common/Vector4.cs @@ -34,6 +34,11 @@ public class Vector4 : Disposable, ICloneable private static readonly Vector4 yaxis = new Vector4(0.0f, 1.0f, 0.0f, 0.0f); private static readonly Vector4 zaxis = new Vector4(0.0f, 0.0f, 1.0f, 0.0f); + internal static new void Preload() + { + // Do nothing. Just call for load static values. + } + /// /// The default constructor initializes the vector to 0. ///