[NUI] Add backendMode to the DirectRenderingGLView constructor.
authorjoogab.yun <joogab.yun@samsung.com>
Thu, 22 Feb 2024 05:02:50 +0000 (14:02 +0900)
committerSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Tue, 27 Feb 2024 08:13:01 +0000 (17:13 +0900)
refer code :
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-core/+/306186/
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-adaptor/+/305990/
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-toolkit/+/306191/
https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-demo/+/305991/

src/Tizen.NUI/src/public/BaseComponents/DirectRenderingGLView.cs

index 8b73bec..2dafb54 100644 (file)
@@ -116,6 +116,17 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// Creates an initialized DirectRenderingGLView.
+        /// </summary>
+        /// <param name="colorFormat">The format of the color buffer</param>
+        /// <param name="backendMode">The backend mode</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public DirectRenderingGLView(ColorFormat colorFormat, BackendMode backendMode) : this(Interop.GLView.New((int)backendMode, (int)colorFormat), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
         /// Enumeration for the color format of the color buffer
         /// </summary>
         public enum ColorFormat
@@ -132,6 +143,50 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// Enumeration for backend mode
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum BackendMode
+        {
+            /// <summary>
+            /// DirectRendering mode executes GL code within DALi graphics
+            /// pipeline but creates isolated context hence it doesn't alter any
+            /// DALi rendering state. When Renderer is about to be drawn, the callback
+            /// will be executed and the custom code "injected" into the pipeline.
+            /// This allows rendering directly to the surface rather than offscreen.
+            /// </summary>
+            DirectRendering = 0,
+
+            /// <summary>
+            /// DirectRenderingThread mode executes GL code on separate thread
+            /// and then blits the result within DALi graphics commands stream.
+            /// The mode is logically compatible with the EglImageOffscreenRendering.
+            /// </summary>
+            DirectRenderingThread,
+
+            /// <summary>
+            /// EglImageOffscreenRendering mode executes GL code in own thread
+            /// and renders to the offscreen NativeImage (EGL) buffer. This backend
+            /// will render in parallel but has higher memory footprint and may suffer
+            /// performance issues due to using EGL image.
+            /// </summary>
+            EglImageOffscreenRendering,
+
+            /// <summary>
+            /// UnsafeDirectRendering mode executes GL code within DALi graphics
+            /// pipeline WITHOUT isolating the GL context so should be used with caution!
+            /// The custom rendering code is executed within current window context and
+            /// may alter the GL state. This mode is considered unsafe and should be used
+            /// only when drawing on main GL context is necessary!
+            ///
+            /// When Renderer is about to be drawn, the callback
+            /// will be executed and the custom code "injected" into the pipeline.
+            /// This allows rendering directly to the surface rather than offscreen.
+            /// </summary>
+            UnsafeDirectRendering
+        }
+
+        /// <summary>
         /// Gets or sets the rendering mode of the DirectRenderingGLView.
         /// </summary>
         public GLRenderingMode RenderingMode