1 #ifndef DALI_INTERNAL_SCENE_GRAPH_RENDERER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_RENDERER_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 #include <dali/devel-api/rendering/renderer-devel.h>
21 #include <dali/internal/common/blending-options.h>
22 #include <dali/internal/common/type-abstraction-enums.h>
23 #include <dali/internal/event/common/event-thread-services.h>
24 #include <dali/internal/event/rendering/visual-renderer-impl.h>
25 #include <dali/internal/render/data-providers/render-data-provider.h>
26 #include <dali/internal/render/renderers/render-renderer.h>
27 #include <dali/internal/update/common/animatable-property.h>
28 #include <dali/internal/update/common/property-owner.h>
29 #include <dali/internal/update/common/uniform-map.h>
30 #include <dali/public-api/rendering/geometry.h>
31 #include <dali/public-api/rendering/renderer.h> // Dali::Renderer
45 class SceneController;
48 using RendererContainer = Dali::Vector<Renderer*>;
49 using RendererIter = RendererContainer::Iterator;
50 using RendererConstIter = RendererContainer::ConstIterator;
55 class Renderer : public PropertyOwner,
56 public UniformMapDataProvider,
57 public RenderDataProvider,
58 public UniformMap::Observer
69 * Construct a new Renderer
71 static Renderer* New();
79 * Overriden delete operator
80 * Deletes the renderer from its global memory pool
82 void operator delete(void* ptr);
85 * Set the texture set for the renderer
86 * @param[in] textureSet The texture set this renderer will use
88 void SetTextures(TextureSet* textureSet);
90 const SceneGraph::TextureSet* GetTextureSet() const
96 * @copydoc RenderDataProvider::GetTextures()
98 const Vector<Render::Texture*>* GetTextures() const override;
101 * @copydoc RenderDataProvider::GetSamplers()
103 const Vector<Render::Sampler*>* GetSamplers() const override;
106 * Set the shader for the renderer
107 * @param[in] shader The shader this renderer will use
109 void SetShader(Shader* shader);
112 * @copydoc RenderDataProvider::GetShader()
114 const Shader& GetShader() const override
120 * Set the geometry for the renderer
121 * @param[in] geometry The geometry this renderer will use
123 void SetGeometry(Render::Geometry* geometry);
126 * Set the depth index
127 * @param[in] depthIndex the new depth index to use
129 void SetDepthIndex(int depthIndex);
132 * @brief Get the depth index
133 * @return The depth index
135 int GetDepthIndex() const
141 * Set the face culling mode
142 * @param[in] faceCullingMode to use
144 void SetFaceCullingMode(FaceCullingMode::Type faceCullingMode);
147 * Get face culling mode
148 * @return The face culling mode
150 FaceCullingMode::Type GetFaceCullingMode() const;
153 * Set the blending mode
154 * @param[in] blendingMode to use
156 void SetBlendMode(BlendMode::Type blendingMode);
159 * Get the blending mode
160 * @return The the blending mode
162 BlendMode::Type GetBlendMode() const;
165 * Set the blending options. This should only be called from the update thread.
166 * @param[in] options A bitmask of blending options.
168 void SetBlendingOptions(uint32_t options);
171 * Get the blending options
172 * @return The the blending mode
174 uint32_t GetBlendingOptions() const;
177 * Set the blend color for blending operation
178 * @param blendColor to pass to GL
180 void SetBlendColor(const Vector4& blendColor);
183 * Get the blending color
184 * @return The blend color
186 Vector4 GetBlendColor() const;
189 * Set the index of first element for indexed draw
190 * @param[in] firstElement index of first element to draw
192 void SetIndexedDrawFirstElement(uint32_t firstElement);
195 * Get the index of first element for indexed draw
196 * @return The index of first element for indexed draw
198 uint32_t GetIndexedDrawFirstElement() const;
201 * Set the number of elements to draw by indexed draw
202 * @param[in] elementsCount number of elements to draw
204 void SetIndexedDrawElementsCount(uint32_t elementsCount);
207 * Get the number of elements to draw by indexed draw
208 * @return The number of elements to draw by indexed draw
210 uint32_t GetIndexedDrawElementsCount() const;
213 * @brief Set whether the Pre-multiplied Alpha Blending is required
214 * @param[in] preMultipled whether alpha is pre-multiplied.
216 void EnablePreMultipliedAlpha(bool preMultipled);
219 * @brief Query whether alpha is pre-multiplied.
220 * @return True is alpha is pre-multiplied, false otherwise.
222 bool IsPreMultipliedAlphaEnabled() const;
225 * Sets the depth buffer write mode
226 * @param[in] depthWriteMode The depth buffer write mode
228 void SetDepthWriteMode(DepthWriteMode::Type depthWriteMode);
231 * Get the depth buffer write mode
232 * @return The depth buffer write mode
234 DepthWriteMode::Type GetDepthWriteMode() const;
237 * Sets the depth buffer test mode
238 * @param[in] depthTestMode The depth buffer test mode
240 void SetDepthTestMode(DepthTestMode::Type depthTestMode);
243 * Get the depth buffer test mode
244 * @return The depth buffer test mode
246 DepthTestMode::Type GetDepthTestMode() const;
249 * Sets the depth function
250 * @param[in] depthFunction The depth function
252 void SetDepthFunction(DepthFunction::Type depthFunction);
255 * Get the depth function
256 * @return The depth function
258 DepthFunction::Type GetDepthFunction() const;
261 * Sets the render mode
262 * @param[in] mode The render mode
264 void SetRenderMode(RenderMode::Type mode);
267 * Sets the stencil function
268 * @param[in] stencilFunction The stencil function
270 void SetStencilFunction(StencilFunction::Type stencilFunction);
273 * Sets the stencil function mask
274 * @param[in] stencilFunctionMask The stencil function mask
276 void SetStencilFunctionMask(int stencilFunctionMask);
279 * Sets the stencil function reference
280 * @param[in] stencilFunctionReference The stencil function reference
282 void SetStencilFunctionReference(int stencilFunctionReference);
285 * Sets the stencil mask
286 * @param[in] stencilMask The stencil mask
288 void SetStencilMask(int stencilMask);
291 * Sets the stencil operation for when the stencil test fails
292 * @param[in] stencilOperationOnFail The stencil operation
294 void SetStencilOperationOnFail(StencilOperation::Type stencilOperationOnFail);
297 * Sets the stencil operation for when the depth test fails
298 * @param[in] stencilOperationOnZFail The stencil operation
300 void SetStencilOperationOnZFail(StencilOperation::Type stencilOperationOnZFail);
303 * Sets the stencil operation for when the depth test passes
304 * @param[in] stencilOperationOnZPass The stencil operation
306 void SetStencilOperationOnZPass(StencilOperation::Type stencilOperationOnZPass);
309 * Gets the stencil parameters
310 * @return The stencil parameters
312 const Render::Renderer::StencilParameters& GetStencilParameters() const;
316 * @param[in] updateBufferIndex The current update buffer index.
317 * @param[in] opacity The opacity
319 void BakeOpacity(BufferIndex updateBufferIndex, float opacity);
322 * @copydoc RenderDataProvider::GetOpacity()
324 float GetOpacity(BufferIndex updateBufferIndex) const override;
327 * Sets the rendering behavior
328 * @param[in] renderingBehavior The rendering behavior required.
330 void SetRenderingBehavior(DevelRenderer::Rendering::Type renderingBehavior);
333 * Gets the rendering behavior
334 * @return The rendering behavior
336 DevelRenderer::Rendering::Type GetRenderingBehavior() const;
339 * Prepare the object for rendering.
340 * This is called by the UpdateManager when an object is due to be rendered in the current frame.
341 * @param[in] updateBufferIndex The current update buffer index.
342 * @return Whether this renderer has been updated in the current frame
344 bool PrepareRender(BufferIndex updateBufferIndex);
347 * Retrieve the Render thread renderer
348 * @return The associated render thread renderer
350 Render::Renderer& GetRenderer();
353 * Query whether the renderer is fully opaque, fully transparent or transparent.
354 * @param[in] updateBufferIndex The current update buffer index.
355 * @return OPAQUE if fully opaque, TRANSPARENT if fully transparent and TRANSLUCENT if in between
357 OpacityType GetOpacityType(BufferIndex updateBufferIndex, const Node& node) const;
360 * Connect the object to the scene graph
362 * @param[in] sceneController The scene controller - used for sending messages to render thread
363 * @param[in] bufferIndex The current buffer index - used for sending messages to render thread
365 void ConnectToSceneGraph(SceneController& sceneController, BufferIndex bufferIndex);
368 * Disconnect the object from the scene graph
369 * @param[in] sceneController The scene controller - used for sending messages to render thread
370 * @param[in] bufferIndex The current buffer index - used for sending messages to render thread
372 void DisconnectFromSceneGraph(SceneController& sceneController, BufferIndex bufferIndex);
375 * @copydoc RenderDataProvider::GetUniformMapDataProvider()
377 const UniformMapDataProvider& GetUniformMapDataProvider() const override
383 * Sets RenderCallback object
385 * @param[in] callback Valid pointer to RenderCallback object
387 void SetRenderCallback(RenderCallback* callback);
390 * Returns currently set RenderCallback pointer
392 * @return RenderCallback pointer or nullptr
394 RenderCallback* GetRenderCallback()
396 return mRenderCallback;
400 * Merge shader uniform map into renderer uniform map if any of the
401 * maps have changed. Only update uniform map if added to render
404 void UpdateUniformMap();
407 * @brief CHeck if the uniformMap regenerated
408 * @return True if the uniformMap changed after latest checkup.
409 * @note The uniform map updated flag is reset after calling this.
411 [[nodiscard]] inline bool UniformMapUpdated() noexcept
413 if(mUniformMapUpdated)
415 mUniformMapUpdated = false;
422 * Set the given external draw commands on this renderer.
424 void SetDrawCommands(Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size);
426 public: // UniformMap::Observer
428 * @copydoc UniformMap::Observer::UniformMappingsChanged
430 void UniformMappingsChanged(const UniformMap& mappings) override;
432 public: // PropertyOwner implementation
434 * @copydoc Dali::Internal::SceneGraph::PropertyOwner::ResetDefaultProperties()
436 virtual void ResetDefaultProperties(BufferIndex updateBufferIndex){};
438 public: // From UniformMapDataProvider
440 * @copydoc UniformMapDataProvider::GetCollectedUniformMap
442 const CollectedUniformMap& GetCollectedUniformMap() const override;
444 public: // For VisualProperties
446 * To be used only for 1st stage initialization in event thread.
448 void SetVisualProperties(Internal::VisualRenderer::AnimatableVisualProperties* visualProperties)
450 mVisualProperties = visualProperties;
454 * May be accessed from event thread
456 const Internal::VisualRenderer::AnimatableVisualProperties* GetVisualProperties() const
458 return mVisualProperties.Get();
462 * @brief Recalculate size after visual properties applied.
464 * @param[in] updateBufferIndex The current update buffer index.
465 * @param[in] originalSize The original size before apply the visual properties.
467 * @return The recalculated size after visual properties applied.
469 Vector3 CalculateVisualTransformedUpdateSize(BufferIndex updateBufferIndex, const Vector3& originalSize);
473 * Protected constructor; See also Renderer::New()
486 CollectedUniformMap mCollectedUniformMap; ///< Uniform maps collected by the renderer
488 SceneController* mSceneController; ///< Used for initializing renderers
489 Render::Renderer* mRenderer; ///< Raw pointer to the renderer (that's owned by RenderManager)
490 TextureSet* mTextureSet; ///< The texture set this renderer uses. (Not owned)
491 Render::Geometry* mGeometry; ///< The geometry this renderer uses. (Not owned)
492 Shader* mShader; ///< The shader this renderer uses. (Not owned)
494 OwnerPointer<VisualRenderer::AnimatableVisualProperties> mVisualProperties{nullptr}; ///< VisualProperties (optional/owned)
495 OwnerPointer<Vector4> mBlendColor; ///< The blend color for blending operation
497 Dali::Internal::Render::Renderer::StencilParameters mStencilParameters; ///< Struct containing all stencil related options
499 uint32_t mIndexedDrawFirstElement; ///< first element index to be drawn using indexed draw
500 uint32_t mIndexedDrawElementsCount; ///< number of elements to be drawn using indexed draw
501 uint32_t mBlendBitmask; ///< The bitmask of blending options
502 uint32_t mResendFlag; ///< Indicate whether data should be resent to the renderer
503 uint32_t mUniformMapChangeCounter{0u}; ///< Value to check if uniform data should be updated
505 DepthFunction::Type mDepthFunction : 4; ///< Local copy of the depth function
506 FaceCullingMode::Type mFaceCullingMode : 3; ///< Local copy of the mode of face culling
507 BlendMode::Type mBlendMode : 3; ///< Local copy of the mode of blending
508 DepthWriteMode::Type mDepthWriteMode : 3; ///< Local copy of the depth write mode
509 DepthTestMode::Type mDepthTestMode : 3; ///< Local copy of the depth test mode
510 DevelRenderer::Rendering::Type mRenderingBehavior : 2; ///< The rendering behavior
511 Decay mUpdateDecay : 2; ///< Update decay (aging)
513 bool mRegenerateUniformMap : 1; ///< true if the map should be regenerated
514 bool mUniformMapUpdated : 1; ///< true if the map regenerated recently.
515 bool mPremultipledAlphaEnabled : 1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
516 std::vector<Dali::DevelRenderer::DrawCommand> mDrawCommands;
517 Dali::RenderCallback* mRenderCallback{nullptr};
520 * @brief Cached coefficient value when we calculate visual transformed update size.
521 * It can reduce complexity of calculate the vertex position.
523 * Vector2 vertexPosition = (XA * aPosition + XB) * originalSize + (CA * aPosition + CB) + Vector2(D, D) * aPosition
525 struct VisualTransformedUpdateSizeCoefficientCache
527 Vector2 coefXA{Vector2::ZERO};
528 Vector2 coefXB{Vector2::ZERO};
529 Vector2 coefCA{Vector2::ZERO};
530 Vector2 coefCB{Vector2::ZERO};
534 uint64_t decoratedHash{0u};
536 VisualTransformedUpdateSizeCoefficientCache mVisualPropertiesCoefficient; ///< Coefficient value to calculate visual transformed update size by VisualProperties more faster.
539 AnimatableProperty<float> mOpacity; ///< The opacity value
540 int32_t mDepthIndex; ///< Used only in PrepareRenderInstructions
544 inline void SetTexturesMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, const TextureSet& textureSet)
546 using LocalType = MessageValue1<Renderer, TextureSet*>;
548 // Reserve some memory inside the message queue
549 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
551 // Construct message in the message queue memory; note that delete should not be called on the return value
552 new(slot) LocalType(&renderer, &Renderer::SetTextures, const_cast<TextureSet*>(&textureSet));
555 inline void SetGeometryMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, const Render::Geometry& geometry)
557 using LocalType = MessageValue1<Renderer, Render::Geometry*>;
559 // Reserve some memory inside the message queue
560 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
562 // Construct message in the message queue memory; note that delete should not be called on the return value
563 new(slot) LocalType(&renderer, &Renderer::SetGeometry, const_cast<Render::Geometry*>(&geometry));
566 inline void SetShaderMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, const Shader& shader)
568 using LocalType = MessageValue1<Renderer, Shader*>;
570 // Reserve some memory inside the message queue
571 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
573 // Construct message in the message queue memory; note that delete should not be called on the return value
574 new(slot) LocalType(&renderer, &Renderer::SetShader, const_cast<Shader*>(&shader));
577 inline void SetDepthIndexMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, int depthIndex)
579 using LocalType = MessageValue1<Renderer, int>;
581 // Reserve some memory inside the message queue
582 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
584 // Construct message in the message queue memory; note that delete should not be called on the return value
585 new(slot) LocalType(&renderer, &Renderer::SetDepthIndex, depthIndex);
588 inline void SetFaceCullingModeMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, FaceCullingMode::Type faceCullingMode)
590 using LocalType = MessageValue1<Renderer, FaceCullingMode::Type>;
592 // Reserve some memory inside the message queue
593 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
595 new(slot) LocalType(&renderer, &Renderer::SetFaceCullingMode, faceCullingMode);
598 inline void SetBlendModeMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, BlendMode::Type blendingMode)
600 using LocalType = MessageValue1<Renderer, BlendMode::Type>;
602 // Reserve some memory inside the message queue
603 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
605 new(slot) LocalType(&renderer, &Renderer::SetBlendMode, blendingMode);
608 inline void SetBlendingOptionsMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, uint32_t options)
610 using LocalType = MessageValue1<Renderer, uint32_t>;
612 // Reserve some memory inside the message queue
613 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
615 new(slot) LocalType(&renderer, &Renderer::SetBlendingOptions, options);
618 inline void SetBlendColorMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, const Vector4& blendColor)
620 using LocalType = MessageValue1<Renderer, Vector4>;
622 // Reserve some memory inside the message queue
623 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
625 new(slot) LocalType(&renderer, &Renderer::SetBlendColor, blendColor);
628 inline void SetIndexedDrawFirstElementMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, uint32_t firstElement)
630 using LocalType = MessageValue1<Renderer, uint32_t>;
632 // Reserve some memory inside the message queue
633 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
635 new(slot) LocalType(&renderer, &Renderer::SetIndexedDrawFirstElement, firstElement);
638 inline void SetIndexedDrawElementsCountMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, uint32_t elementsCount)
640 using LocalType = MessageValue1<Renderer, uint32_t>;
642 // Reserve some memory inside the message queue
643 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
645 new(slot) LocalType(&renderer, &Renderer::SetIndexedDrawElementsCount, elementsCount);
648 inline void SetEnablePreMultipliedAlphaMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, bool preMultiplied)
650 using LocalType = MessageValue1<Renderer, bool>;
652 // Reserve some memory inside the message queue
653 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
655 new(slot) LocalType(&renderer, &Renderer::EnablePreMultipliedAlpha, preMultiplied);
658 inline void SetDepthWriteModeMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, DepthWriteMode::Type depthWriteMode)
660 using LocalType = MessageValue1<Renderer, DepthWriteMode::Type>;
662 // Reserve some memory inside the message queue
663 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
665 new(slot) LocalType(&renderer, &Renderer::SetDepthWriteMode, depthWriteMode);
668 inline void SetDepthTestModeMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, DepthTestMode::Type depthTestMode)
670 using LocalType = MessageValue1<Renderer, DepthTestMode::Type>;
672 // Reserve some memory inside the message queue
673 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
675 new(slot) LocalType(&renderer, &Renderer::SetDepthTestMode, depthTestMode);
678 inline void SetDepthFunctionMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, DepthFunction::Type depthFunction)
680 using LocalType = MessageValue1<Renderer, DepthFunction::Type>;
682 // Reserve some memory inside the message queue
683 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
685 new(slot) LocalType(&renderer, &Renderer::SetDepthFunction, depthFunction);
688 inline void SetRenderModeMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, RenderMode::Type mode)
690 using LocalType = MessageValue1<Renderer, RenderMode::Type>;
692 // Reserve some memory inside the message queue
693 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
695 new(slot) LocalType(&renderer, &Renderer::SetRenderMode, mode);
698 inline void SetStencilFunctionMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, StencilFunction::Type stencilFunction)
700 using LocalType = MessageValue1<Renderer, StencilFunction::Type>;
702 // Reserve some memory inside the message queue
703 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
705 new(slot) LocalType(&renderer, &Renderer::SetStencilFunction, stencilFunction);
708 inline void SetStencilFunctionMaskMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, int mask)
710 using LocalType = MessageValue1<Renderer, int>;
712 // Reserve some memory inside the message queue
713 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
715 new(slot) LocalType(&renderer, &Renderer::SetStencilFunctionMask, mask);
718 inline void SetStencilFunctionReferenceMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, int stencilFunctionReference)
720 using LocalType = MessageValue1<Renderer, int>;
722 // Reserve some memory inside the message queue
723 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
725 new(slot) LocalType(&renderer, &Renderer::SetStencilFunctionReference, stencilFunctionReference);
728 inline void SetStencilMaskMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, int stencilMask)
730 using LocalType = MessageValue1<Renderer, int>;
732 // Reserve some memory inside the message queue
733 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
735 new(slot) LocalType(&renderer, &Renderer::SetStencilMask, stencilMask);
738 inline void SetStencilOperationOnFailMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, StencilOperation::Type stencilOperation)
740 using LocalType = MessageValue1<Renderer, StencilOperation::Type>;
742 // Reserve some memory inside the message queue
743 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
745 new(slot) LocalType(&renderer, &Renderer::SetStencilOperationOnFail, stencilOperation);
748 inline void SetStencilOperationOnZFailMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, StencilOperation::Type stencilOperation)
750 using LocalType = MessageValue1<Renderer, StencilOperation::Type>;
752 // Reserve some memory inside the message queue
753 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
755 new(slot) LocalType(&renderer, &Renderer::SetStencilOperationOnZFail, stencilOperation);
758 inline void SetStencilOperationOnZPassMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, StencilOperation::Type stencilOperation)
760 using LocalType = MessageValue1<Renderer, StencilOperation::Type>;
762 // Reserve some memory inside the message queue
763 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
765 new(slot) LocalType(&renderer, &Renderer::SetStencilOperationOnZPass, stencilOperation);
768 inline void BakeOpacityMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, float opacity)
770 using LocalType = MessageDoubleBuffered1<Renderer, float>;
772 // Reserve some memory inside the message queue
773 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
775 new(slot) LocalType(&renderer, &Renderer::BakeOpacity, opacity);
778 inline void SetRenderingBehaviorMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, DevelRenderer::Rendering::Type renderingBehavior)
780 using LocalType = MessageValue1<Renderer, DevelRenderer::Rendering::Type>;
782 // Reserve some memory inside the message queue
783 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
785 new(slot) LocalType(&renderer, &Renderer::SetRenderingBehavior, renderingBehavior);
788 inline void SetDrawCommandsMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size)
790 using LocalType = MessageValue2<Renderer, Dali::DevelRenderer::DrawCommand*, uint32_t>;
792 // Reserve some memory inside the message queue
793 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
795 new(slot) LocalType(&renderer, &Renderer::SetDrawCommands, pDrawCommands, size);
798 inline void SetRenderCallbackMessage(EventThreadServices& eventThreadServices, const Renderer& renderer, Dali::RenderCallback* callback)
800 using LocalType = MessageValue1<Renderer, Dali::RenderCallback*>;
802 // Reserve some memory inside the message queue
803 uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
805 new(slot) LocalType(&renderer, &Renderer::SetRenderCallback, callback);
808 } // namespace SceneGraph
809 } // namespace Internal
812 #endif // DALI_INTERNAL_SCENE_GRAPH_RENDERER_H