X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Frendering%2Fscene-graph-renderer.h;h=1886342b7f300ce99ae438db8afdeb192fc91837;hb=0ec8b37a80208c66d87e4322092d40694092bf81;hp=1e672a083b89a87604bf630705a588165a03f19e;hpb=a98207055e4cec73d9f4a3c4256071a872a0170f;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/rendering/scene-graph-renderer.h b/dali/internal/update/rendering/scene-graph-renderer.h index 1e672a0..1886342 100644 --- a/dali/internal/update/rendering/scene-graph-renderer.h +++ b/dali/internal/update/rendering/scene-graph-renderer.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_SCENE_GRAPH_RENDERER_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -19,9 +19,8 @@ #include #include -#include +#include #include -#include #include #include #include @@ -45,17 +44,122 @@ namespace SceneGraph class SceneController; class Renderer; -using RendererContainer = Dali::Vector; +class TextureSet; +class Geometry; + +using RendererKey = MemoryPoolKey; + +} // namespace SceneGraph +} // namespace Internal + +// Ensure RendererKey can be used in Dali::Vector +template<> +struct TypeTraits : public BasicTypes +{ + enum + { + IS_TRIVIAL_TYPE = true + }; +}; + +namespace Internal +{ +namespace SceneGraph +{ +using RendererContainer = Dali::Vector; using RendererIter = RendererContainer::Iterator; using RendererConstIter = RendererContainer::ConstIterator; -class TextureSet; -class Geometry; +namespace VisualRenderer +{ +struct AnimatableVisualProperties +{ + AnimatableVisualProperties() + : mTransformOffset(Vector2::ZERO), + mTransformSize(Vector2::ONE), + mTransformOrigin(Vector2::ZERO), + mTransformAnchorPoint(Vector2::ZERO), + mTransformOffsetSizeMode(Vector4::ZERO), + mExtraSize(Vector2::ZERO), + mMixColor(Vector3::ONE), + mPreMultipliedAlpha(0.0f), + mExtendedPropertiesDeleteFunction(nullptr) + { + } + + ~AnimatableVisualProperties() + { + if(mExtendedProperties && mExtendedPropertiesDeleteFunction) + { + mExtendedPropertiesDeleteFunction(mExtendedProperties); + } + } + + /** + * @brief Cached coefficient value when we calculate visual transformed update size. + * It can reduce complexity of calculate the vertex position. + * + * Vector2 vertexPosition = (XA * aPosition + XB) * originalSize + (CA * aPosition + CB) + Vector2(D, D) * aPosition + */ + struct VisualTransformedUpdateSizeCoefficientCache + { + Vector2 coefXA{Vector2::ZERO}; + Vector2 coefXB{Vector2::ZERO}; + Vector2 coefCA{Vector2::ZERO}; + Vector2 coefCB{Vector2::ZERO}; + float coefD{0.0f}; + + uint64_t hash{0u}; + uint64_t decoratedHash{0u}; + }; + VisualTransformedUpdateSizeCoefficientCache mCoefficient; ///< Coefficient value to calculate visual transformed update size by VisualProperties more faster. + + AnimatableProperty mTransformOffset; + AnimatableProperty mTransformSize; + AnimatableProperty mTransformOrigin; + AnimatableProperty mTransformAnchorPoint; + AnimatableProperty mTransformOffsetSizeMode; + AnimatableProperty mExtraSize; + AnimatableProperty mMixColor; + AnimatableProperty mPreMultipliedAlpha; + + void* mExtendedProperties{nullptr}; // Enable derived class to extend properties further + void (*mExtendedPropertiesDeleteFunction)(void*){nullptr}; // Derived class's custom delete functor +}; + +struct AnimatableDecoratedVisualProperties +{ + AnimatableDecoratedVisualProperties() + : mCornerRadius(Vector4::ZERO), + mCornerRadiusPolicy(1.0f), + mBorderlineWidth(0.0f), + mBorderlineColor(Color::BLACK), + mBorderlineOffset(0.0f), + mBlurRadius(0.0f) + { + } + ~AnimatableDecoratedVisualProperties() + { + } + + // Delete function of AnimatableDecoratedVisualProperties* converted as void* + static void DeleteFunction(void* data) + { + delete static_cast(data); + } + + AnimatableProperty mCornerRadius; + AnimatableProperty mCornerRadiusPolicy; + AnimatableProperty mBorderlineWidth; + AnimatableProperty mBorderlineColor; + AnimatableProperty mBorderlineOffset; + AnimatableProperty mBlurRadius; +}; +} // namespace VisualRenderer class Renderer : public PropertyOwner, public UniformMapDataProvider, - public RenderDataProvider, - public UniformMap::Observer + public RenderDataProvider { public: enum OpacityType @@ -68,7 +172,7 @@ public: /** * Construct a new Renderer */ - static Renderer* New(); + static RendererKey NewKey(); /** * Destructor @@ -82,11 +186,36 @@ public: void operator delete(void* ptr); /** + * Get a pointer to the object from the given key. + * Used by MemoryPoolKey to provide pointer semantics. + */ + static Renderer* Get(RendererKey::KeyType); + + /** + * Get the key of the given renderer in the associated memory pool. + * @param[in] renderer the given renderer + * @return The key in the associated memory pool. + */ + static RendererKey GetKey(const SceneGraph::Renderer& renderer); + + /** + * Get the key of the given renderer in the associated memory pool. + * @param[in] renderer the given renderer + * @return The key in the associated memory pool, or -1 if not + * found. + */ + static RendererKey GetKey(SceneGraph::Renderer* renderer); + + /** * Set the texture set for the renderer * @param[in] textureSet The texture set this renderer will use */ void SetTextures(TextureSet* textureSet); + /** + * Get the associated texture set + * @return the texture set. + */ const SceneGraph::TextureSet* GetTextureSet() const { return mTextureSet; @@ -95,7 +224,7 @@ public: /** * @copydoc RenderDataProvider::GetTextures() */ - const Vector* GetTextures() const override; + const Vector* GetTextures() const override; /** * @copydoc RenderDataProvider::GetSamplers() @@ -347,7 +476,7 @@ public: * Retrieve the Render thread renderer * @return The associated render thread renderer */ - Render::Renderer& GetRenderer(); + Render::RendererKey GetRenderer(); /** * Query whether the renderer is fully opaque, fully transparent or transparent. @@ -380,6 +509,16 @@ public: }; /** + * @copydoc RenderDataProvider::IsUpdated() + */ + bool IsUpdated() const override; + + /** + * @copydoc RenderDataProvider::GetVisualTransformedUpdateArea() + */ + Vector4 GetVisualTransformedUpdateArea(BufferIndex updateBufferIndex, const Vector4& originalUpdateArea) noexcept override; + + /** * Sets RenderCallback object * * @param[in] callback Valid pointer to RenderCallback object @@ -400,34 +539,39 @@ public: * Merge shader uniform map into renderer uniform map if any of the * maps have changed. Only update uniform map if added to render * instructions. + * @param[in] updateBufferIndex The current update buffer index. */ - void UpdateUniformMap(); + void UpdateUniformMap(BufferIndex updateBufferIndex); /** - * @brief CHeck if the uniformMap regenerated - * @return True if the uniformMap changed after latest checkup. - * @note The uniform map updated flag is reset after calling this. + * Set the given external draw commands on this renderer. */ - [[nodiscard]] inline bool UniformMapUpdated() noexcept - { - if(mUniformMapUpdated) - { - mUniformMapUpdated = false; - return true; - } - return false; - } + void SetDrawCommands(Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size); /** - * Set the given external draw commands on this renderer. + * Query whether a renderer is dirty. + * @return true if the renderer is dirty. + * @note It is used to decide whether to reuse the RenderList. We can't reuse the RenderList if this is dirty. */ - void SetDrawCommands(Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size); + bool IsDirty() const; + + /** + * Reset both dirty flag and updated flag. + * @note This is called after rendering has completed. + */ + void ResetDirtyFlag(); + + /** + * Get the capacity of the memory pools + * @return the capacity of the memory pools + */ + static uint32_t GetMemoryPoolCapacity(); -public: // UniformMap::Observer +public: // PropertyOwner::MappingChanged /** - * @copydoc UniformMap::Observer::UniformMappingsChanged + * @copydoc PropertyOwner::OnMappingChanged */ - void UniformMappingsChanged(const UniformMap& mappings) override; + void OnMappingChanged() override; public: // PropertyOwner implementation /** @@ -445,7 +589,7 @@ public: // For VisualProperties /** * To be used only for 1st stage initialization in event thread. */ - void SetVisualProperties(Internal::VisualRenderer::AnimatableVisualProperties* visualProperties) + void SetVisualProperties(VisualRenderer::AnimatableVisualProperties* visualProperties) { mVisualProperties = visualProperties; } @@ -453,21 +597,11 @@ public: // For VisualProperties /** * May be accessed from event thread */ - const Internal::VisualRenderer::AnimatableVisualProperties* GetVisualProperties() const + const VisualRenderer::AnimatableVisualProperties* GetVisualProperties() const { return mVisualProperties.Get(); } - /** - * @brief Recalculate size after visual properties applied. - * - * @param[in] updateBufferIndex The current update buffer index. - * @param[in] originalSize The original size before apply the visual properties. - * - * @return The recalculated size after visual properties applied. - */ - Vector3 CalculateVisualTransformedUpdateSize(BufferIndex updateBufferIndex, const Vector3& originalSize); - private: /** * Protected constructor; See also Renderer::New() @@ -485,22 +619,23 @@ private: private: CollectedUniformMap mCollectedUniformMap; ///< Uniform maps collected by the renderer - SceneController* mSceneController; ///< Used for initializing renderers - Render::Renderer* mRenderer; ///< Raw pointer to the renderer (that's owned by RenderManager) - TextureSet* mTextureSet; ///< The texture set this renderer uses. (Not owned) - Render::Geometry* mGeometry; ///< The geometry this renderer uses. (Not owned) - Shader* mShader; ///< The shader this renderer uses. (Not owned) + SceneController* mSceneController; ///< Used for initializing renderers + Render::RendererKey mRenderer; ///< Key to the renderer (that's owned by RenderManager) + TextureSet* mTextureSet; ///< The texture set this renderer uses. (Not owned) + Render::Geometry* mGeometry; ///< The geometry this renderer uses. (Not owned) + Shader* mShader; ///< The shader this renderer uses. (Not owned) OwnerPointer mVisualProperties{nullptr}; ///< VisualProperties (optional/owned) OwnerPointer mBlendColor; ///< The blend color for blending operation Dali::Internal::Render::Renderer::StencilParameters mStencilParameters; ///< Struct containing all stencil related options - uint32_t mIndexedDrawFirstElement; ///< first element index to be drawn using indexed draw - uint32_t mIndexedDrawElementsCount; ///< number of elements to be drawn using indexed draw - uint32_t mBlendBitmask; ///< The bitmask of blending options - uint32_t mResendFlag; ///< Indicate whether data should be resent to the renderer - uint32_t mUniformMapChangeCounter{0u}; ///< Value to check if uniform data should be updated + uint32_t mIndexedDrawFirstElement; ///< first element index to be drawn using indexed draw + uint32_t mIndexedDrawElementsCount; ///< number of elements to be drawn using indexed draw + uint32_t mBlendBitmask; ///< The bitmask of blending options + uint32_t mResendFlag; ///< Indicate whether data should be resent to the renderer + UniformMap::SizeType mUniformMapChangeCounter{0u}; ///< Value to check if uniform data should be updated + UniformMap::SizeType mShaderMapChangeCounter{0u}; ///< Value to check if uniform data should be updated DepthFunction::Type mDepthFunction : 4; ///< Local copy of the depth function FaceCullingMode::Type mFaceCullingMode : 3; ///< Local copy of the mode of face culling @@ -510,303 +645,20 @@ private: DevelRenderer::Rendering::Type mRenderingBehavior : 2; ///< The rendering behavior Decay mUpdateDecay : 2; ///< Update decay (aging) - bool mRegenerateUniformMap : 1; ///< true if the map should be regenerated - bool mUniformMapUpdated : 1; ///< true if the map regenerated recently. - bool mPremultipledAlphaEnabled : 1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required + bool mRegenerateUniformMap : 1; ///< true if the map should be regenerated + bool mPremultipledAlphaEnabled : 1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required + bool mDirtyFlag : 1; ///< Flag indicating whether the properties are changed + std::vector mDrawCommands; Dali::RenderCallback* mRenderCallback{nullptr}; - /** - * @brief Cached coefficient value when we calculate visual transformed update size. - * It can reduce complexity of calculate the vertex position. - * - * Vector2 vertexPosition = (XA * aPosition + XB) * originalSize + (CA * aPosition + CB) + Vector2(D, D) * aPosition - */ - struct VisualTransformedUpdateSizeCoefficientCache - { - Vector2 coefXA{Vector2::ZERO}; - Vector2 coefXB{Vector2::ZERO}; - Vector2 coefCA{Vector2::ZERO}; - Vector2 coefCB{Vector2::ZERO}; - float coefD{0.0f}; - - uint64_t hash{0u}; - uint64_t decoratedHash{0u}; - }; - VisualTransformedUpdateSizeCoefficientCache mVisualPropertiesCoefficient; ///< Coefficient value to calculate visual transformed update size by VisualProperties more faster. - public: AnimatableProperty mOpacity; ///< The opacity value int32_t mDepthIndex; ///< Used only in PrepareRenderInstructions }; -/// Messages -inline void SetTexturesMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, const TextureSet& textureSet) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - // Construct message in the message queue memory; note that delete should not be called on the return value - new(slot) LocalType(&renderer, &Renderer::SetTextures, const_cast(&textureSet)); -} - -inline void SetGeometryMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, const Render::Geometry& geometry) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - // Construct message in the message queue memory; note that delete should not be called on the return value - new(slot) LocalType(&renderer, &Renderer::SetGeometry, const_cast(&geometry)); -} - -inline void SetShaderMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, const Shader& shader) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - // Construct message in the message queue memory; note that delete should not be called on the return value - new(slot) LocalType(&renderer, &Renderer::SetShader, const_cast(&shader)); -} - -inline void SetDepthIndexMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, int depthIndex) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - // Construct message in the message queue memory; note that delete should not be called on the return value - new(slot) LocalType(&renderer, &Renderer::SetDepthIndex, depthIndex); -} - -inline void SetFaceCullingModeMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, FaceCullingMode::Type faceCullingMode) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetFaceCullingMode, faceCullingMode); -} - -inline void SetBlendModeMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, BlendMode::Type blendingMode) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetBlendMode, blendingMode); -} - -inline void SetBlendingOptionsMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, uint32_t options) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetBlendingOptions, options); -} - -inline void SetBlendColorMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, const Vector4& blendColor) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetBlendColor, blendColor); -} - -inline void SetIndexedDrawFirstElementMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, uint32_t firstElement) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetIndexedDrawFirstElement, firstElement); -} - -inline void SetIndexedDrawElementsCountMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, uint32_t elementsCount) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetIndexedDrawElementsCount, elementsCount); -} - -inline void SetEnablePreMultipliedAlphaMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, bool preMultiplied) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::EnablePreMultipliedAlpha, preMultiplied); -} - -inline void SetDepthWriteModeMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, DepthWriteMode::Type depthWriteMode) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetDepthWriteMode, depthWriteMode); -} - -inline void SetDepthTestModeMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, DepthTestMode::Type depthTestMode) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetDepthTestMode, depthTestMode); -} - -inline void SetDepthFunctionMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, DepthFunction::Type depthFunction) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetDepthFunction, depthFunction); -} - -inline void SetRenderModeMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, RenderMode::Type mode) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetRenderMode, mode); -} - -inline void SetStencilFunctionMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, StencilFunction::Type stencilFunction) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetStencilFunction, stencilFunction); -} - -inline void SetStencilFunctionMaskMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, int mask) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetStencilFunctionMask, mask); -} - -inline void SetStencilFunctionReferenceMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, int stencilFunctionReference) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetStencilFunctionReference, stencilFunctionReference); -} - -inline void SetStencilMaskMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, int stencilMask) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetStencilMask, stencilMask); -} - -inline void SetStencilOperationOnFailMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, StencilOperation::Type stencilOperation) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetStencilOperationOnFail, stencilOperation); -} - -inline void SetStencilOperationOnZFailMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, StencilOperation::Type stencilOperation) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetStencilOperationOnZFail, stencilOperation); -} - -inline void SetStencilOperationOnZPassMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, StencilOperation::Type stencilOperation) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetStencilOperationOnZPass, stencilOperation); -} - -inline void BakeOpacityMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, float opacity) -{ - using LocalType = MessageDoubleBuffered1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::BakeOpacity, opacity); -} - -inline void SetRenderingBehaviorMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, DevelRenderer::Rendering::Type renderingBehavior) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetRenderingBehavior, renderingBehavior); -} - -inline void SetDrawCommandsMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size) -{ - using LocalType = MessageValue2; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetDrawCommands, pDrawCommands, size); -} - -inline void SetRenderCallbackMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, Dali::RenderCallback* callback) -{ - using LocalType = MessageValue1; - - // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType)); - - new(slot) LocalType(&renderer, &Renderer::SetRenderCallback, callback); -} - } // namespace SceneGraph } // namespace Internal } // namespace Dali -#endif // DALI_INTERNAL_SCENE_GRAPH_RENDERER_H +#endif // DALI_INTERNAL_SCENE_GRAPH_RENDERER_H