X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Frendering%2Frenderer.h;h=3dfd9eaabb8ce1f6a4881ec531e81bb85d34e69a;hb=c4750afbf79f15bf71e2aa8ef54f84750463aae2;hp=89b171fec2d3041afe9675e98933658c14f08cc5;hpb=8d052754bcebb819b20471d34be67ed59beebf29;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/rendering/renderer.h b/dali/public-api/rendering/renderer.h index 89b171f..3dfd9ea 100644 --- a/dali/public-api/rendering/renderer.h +++ b/dali/public-api/rendering/renderer.h @@ -2,7 +2,7 @@ #define DALI_RENDERER_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,8 @@ namespace Dali { +class RenderCallback; + /** * @addtogroup dali_core_rendering_effects * @{ @@ -38,56 +40,54 @@ class Renderer; namespace FaceCullingMode { - /** * @brief Enumeration for face culling mode. * @SINCE_1_1.43 */ enum Type { - NONE, ///< None of the faces should be culled @SINCE_1_1.43 - FRONT, ///< Cull front face, front faces should never be shown @SINCE_1_1.43 - BACK, ///< Cull back face, back faces should never be shown @SINCE_1_1.43 - FRONT_AND_BACK, ///< Cull front and back faces; if the geometry is composed of triangles none of the faces will be shown @SINCE_1_1.43 + NONE, ///< None of the faces should be culled @SINCE_1_1.43 + FRONT, ///< Cull front face, front faces should never be shown @SINCE_1_1.43 + BACK, ///< Cull back face, back faces should never be shown @SINCE_1_1.43 + FRONT_AND_BACK, ///< Cull front and back faces; if the geometry is composed of triangles none of the faces will be shown @SINCE_1_1.43 }; } // namespace FaceCullingMode namespace BlendMode { - /** * @brief Enumeration for blend mode. * @SINCE_1_1.43 */ enum Type { - OFF, ///< Blending is disabled. @SINCE_1_1.43 - AUTO, ///< Blending is enabled if there is alpha channel. This is the default mode. @SINCE_1_1.43 - ON ///< Blending is enabled. @SINCE_1_1.43 + OFF, ///< Blending is disabled. @SINCE_1_1.43 + AUTO, ///< Blending is enabled if there is alpha channel. This is the default mode. @SINCE_1_1.43 + ON, ///< Blending is enabled. @SINCE_1_1.43 + ON_WITHOUT_CULL, ///< Blending is enabled, and don't cull the renderer @SINCE_2_0.43 + USE_ACTOR_OPACITY ///< Blending is enabled when the actor is not opaque @SINCE_2_2.7 }; } // namespace BlendMode namespace BlendEquation { - /** * @brief Enumeration for blend equation. * @SINCE_1_1.43 */ enum Type { - ADD = 0x8006, ///< The source and destination colors are added to each other. @SINCE_1_1.43 - SUBTRACT = 0x800A, ///< Subtracts the destination from the source. @SINCE_1_1.43 - REVERSE_SUBTRACT = 0x800B ///< Subtracts the source from the destination. @SINCE_1_1.43 + ADD = 0x8006, ///< The source and destination colors are added to each other. @SINCE_1_1.43 + SUBTRACT = 0x800A, ///< Subtracts the destination from the source. @SINCE_1_1.43 + REVERSE_SUBTRACT = 0x800B ///< Subtracts the source from the destination. @SINCE_1_1.43 }; } // namespace BlendEquation namespace BlendFactor { - /** * @brief Enumeration for blend factor. * @SINCE_1_1.43 @@ -115,7 +115,6 @@ enum Type namespace DepthWriteMode { - /** * @brief Enumeration for depth buffer write modes. * @SINCE_1_1.43 @@ -131,7 +130,6 @@ enum Type namespace DepthTestMode { - /** * @brief Enumeration for depth buffer test (read) modes. * @SINCE_1_1.43 @@ -147,7 +145,6 @@ enum Type namespace DepthFunction { - /** * @brief Enumeration for depth functions. * @SINCE_1_1.43 @@ -168,7 +165,6 @@ enum Type namespace RenderMode { - /** * @brief Enumeration for the controls of how this renderer uses its stencil properties and writes to the color buffer. * @SINCE_1_2_5 @@ -186,7 +182,6 @@ enum Type namespace StencilFunction { - /** * @brief Enumeration for the comparison function used on the stencil buffer. * @SINCE_1_1.43 @@ -207,7 +202,6 @@ enum Type namespace StencilOperation { - /** * @brief Enumeration for specifying the action to take when the stencil (or depth) test fails during stencil test. * @SINCE_1_1.43 @@ -226,7 +220,6 @@ enum Type } // namespace StencilOperation - /** * @brief Renderer is a handle to an object used to show content by combining a Geometry, a TextureSet and a shader. * @@ -235,7 +228,6 @@ enum Type class DALI_CORE_API Renderer : public Handle { public: - /** * @brief Enumeration for instances of properties belonging to the Renderer class. * @SINCE_1_1.43 @@ -434,7 +426,16 @@ public: * @param[in] shader Shader to be used by this renderer * @return A handle to the Renderer */ - static Renderer New( Geometry& geometry, Shader& shader ); + static Renderer New(Geometry& geometry, Shader& shader); + + /** + * @brief Creates a new Renderer object with RenderCallback. + * + * @SINCE_2_1.18 + * @param[in] renderCallback Valid RenderCallback + * @return A handle to the Renderer + */ + static Renderer New(RenderCallback& renderCallback); /** * @brief Default constructor, creates an empty handle @@ -456,7 +457,7 @@ public: * @SINCE_1_1.43 * @param[in] handle Handle to an object */ - Renderer( const Renderer& handle ); + Renderer(const Renderer& handle); /** * @brief Downcasts to a renderer handle. @@ -466,7 +467,7 @@ public: * @param[in] handle Handle to an object * @return Renderer handle or an uninitialized handle */ - static Renderer DownCast( BaseHandle handle ); + static Renderer DownCast(BaseHandle handle); /** * @brief Assignment operator, changes this handle to point at the same object. @@ -475,7 +476,24 @@ public: * @param[in] handle Handle to an object * @return Reference to the assigned object */ - Renderer& operator=( const Renderer& handle ); + Renderer& operator=(const Renderer& handle); + + /** + * @brief Move constructor. + * + * @SINCE_1_9.22 + * @param[in] rhs A reference to the moved handle + */ + Renderer(Renderer&& rhs) noexcept; + + /** + * @brief Move assignment operator. + * + * @SINCE_1_9.22 + * @param[in] rhs A reference to the moved handle + * @return A reference to this handle + */ + Renderer& operator=(Renderer&& rhs) noexcept; /** * @brief Sets the geometry to be used by this renderer. @@ -483,7 +501,7 @@ public: * @SINCE_1_1.43 * @param[in] geometry The geometry to be used by this renderer */ - void SetGeometry( Geometry& geometry ); + void SetGeometry(Geometry& geometry); /** * @brief Gets the geometry used by this renderer. @@ -500,10 +518,10 @@ public: * @param[in] firstElement The First element to draw * @param[in] elementsCount The number of elements to draw */ - inline void SetIndexRange( int firstElement, int elementsCount ) + inline void SetIndexRange(int firstElement, int elementsCount) { - SetProperty( Property::INDEX_RANGE_FIRST, firstElement ); - SetProperty( Property::INDEX_RANGE_COUNT, elementsCount ); + SetProperty(Property::INDEX_RANGE_FIRST, firstElement); + SetProperty(Property::INDEX_RANGE_COUNT, elementsCount); } /** @@ -512,7 +530,7 @@ public: * @SINCE_1_1.43 * @param[in] textureSet The texture set to be used by this renderer */ - void SetTextures( TextureSet& textureSet ); + void SetTextures(TextureSet& textureSet); /** * @brief Gets the texture set used by this renderer. @@ -528,7 +546,7 @@ public: * @SINCE_1_1.43 * @param[in] shader The shader to be used by this renderer */ - void SetShader( Shader& shader ); + void SetShader(Shader& shader); /** * @brief Gets the shader used by this renderer. @@ -538,15 +556,24 @@ public: */ Shader GetShader() const; -public: + /** + * @brief Sets RenderCallback to be used for native rendering + * + * @SINCE_2_1.15 + * @param[in] callback Pointer to a valid RenderCallback object + */ + void SetRenderCallback(RenderCallback* callback); +public: + /// @cond internal /** * @brief The constructor. * @note Not intended for application developers. * @SINCE_1_1.43 * @param[in] pointer A pointer to a newly allocated Renderer */ - explicit DALI_INTERNAL Renderer( Internal::Renderer* pointer ); + explicit DALI_INTERNAL Renderer(Internal::Renderer* pointer); + /// @endcond }; /**