2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/event/rendering/renderer-impl.h> // Dali::Internal::Renderer
22 #include <dali/devel-api/scripting/scripting.h>
23 #include <dali/internal/event/common/property-helper.h> // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
24 #include <dali/internal/event/common/property-input-impl.h>
25 #include <dali/internal/render/renderers/render-geometry.h>
26 #include <dali/internal/update/manager/update-manager.h>
27 #include <dali/internal/update/rendering/scene-graph-renderer.h>
28 #include <dali/public-api/object/type-registry.h>
37 * Properties: |name |type |writable|animatable|constraint-input|enum for index-checking|
39 DALI_PROPERTY_TABLE_BEGIN
40 DALI_PROPERTY("depthIndex", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_INDEX)
41 DALI_PROPERTY("faceCullingMode", INTEGER, true, false, false, Dali::Renderer::Property::FACE_CULLING_MODE)
42 DALI_PROPERTY("blendMode", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_MODE)
43 DALI_PROPERTY("blendEquationRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_EQUATION_RGB)
44 DALI_PROPERTY("blendEquationAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_EQUATION_ALPHA)
45 DALI_PROPERTY("blendFactorSrcRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB)
46 DALI_PROPERTY("blendFactorDestRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB)
47 DALI_PROPERTY("blendFactorSrcAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA)
48 DALI_PROPERTY("blendFactorDestAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA)
49 DALI_PROPERTY("blendColor", VECTOR4, true, false, false, Dali::Renderer::Property::BLEND_COLOR)
50 DALI_PROPERTY("blendPreMultipliedAlpha", BOOLEAN, true, false, false, Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA)
51 DALI_PROPERTY("indexRangeFirst", INTEGER, true, false, false, Dali::Renderer::Property::INDEX_RANGE_FIRST)
52 DALI_PROPERTY("indexRangeCount", INTEGER, true, false, false, Dali::Renderer::Property::INDEX_RANGE_COUNT)
53 DALI_PROPERTY("depthWriteMode", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_WRITE_MODE)
54 DALI_PROPERTY("depthFunction", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_FUNCTION)
55 DALI_PROPERTY("depthTestMode", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_TEST_MODE)
56 DALI_PROPERTY("renderMode", INTEGER, true, false, false, Dali::Renderer::Property::RENDER_MODE)
57 DALI_PROPERTY("stencilFunction", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION)
58 DALI_PROPERTY("stencilFunctionMask", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION_MASK)
59 DALI_PROPERTY("stencilFunctionReference", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE)
60 DALI_PROPERTY("stencilMask", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_MASK)
61 DALI_PROPERTY("stencilOperationOnFail", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL)
62 DALI_PROPERTY("stencilOperationOnZFail", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL)
63 DALI_PROPERTY("stencilOperationOnZPass", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS)
64 DALI_PROPERTY("opacity", FLOAT, true, true, true, Dali::DevelRenderer::Property::OPACITY)
65 DALI_PROPERTY("renderingBehavior", INTEGER, true, false, false, Dali::DevelRenderer::Property::RENDERING_BEHAVIOR)
66 DALI_PROPERTY("blendEquation", INTEGER, true, false, false, Dali::DevelRenderer::Property::BLEND_EQUATION)
67 DALI_PROPERTY_TABLE_END(DEFAULT_RENDERER_PROPERTY_START_INDEX, RendererDefaultProperties)
69 // Property string to enumeration tables:
71 DALI_ENUM_TO_STRING_TABLE_BEGIN(FACE_CULLING_MODE)
72 DALI_ENUM_TO_STRING_WITH_SCOPE(FaceCullingMode, NONE)
73 DALI_ENUM_TO_STRING_WITH_SCOPE(FaceCullingMode, FRONT)
74 DALI_ENUM_TO_STRING_WITH_SCOPE(FaceCullingMode, BACK)
75 DALI_ENUM_TO_STRING_WITH_SCOPE(FaceCullingMode, FRONT_AND_BACK)
76 DALI_ENUM_TO_STRING_TABLE_END(FACE_CULLING_MODE)
78 DALI_ENUM_TO_STRING_TABLE_BEGIN(BLEND_MODE)
79 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendMode, OFF)
80 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendMode, AUTO)
81 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendMode, ON)
82 DALI_ENUM_TO_STRING_TABLE_END(BLEND_MODE)
84 DALI_ENUM_TO_STRING_TABLE_BEGIN(BLEND_EQUATION)
85 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, ADD)
86 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, SUBTRACT)
87 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, REVERSE_SUBTRACT)
88 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MIN)
89 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MAX)
90 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MULTIPLY)
91 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SCREEN)
92 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, OVERLAY)
93 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, DARKEN)
94 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, LIGHTEN)
95 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR_DODGE)
96 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR_BURN)
97 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, HARD_LIGHT)
98 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SOFT_LIGHT)
99 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, DIFFERENCE)
100 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, EXCLUSION)
101 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, HUE)
102 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SATURATION)
103 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR)
104 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, LUMINOSITY)
105 DALI_ENUM_TO_STRING_TABLE_END(BLEND_EQUATION)
107 DALI_ENUM_TO_STRING_TABLE_BEGIN(BLEND_FACTOR)
108 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ZERO)
109 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE)
110 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_COLOR)
111 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_SRC_COLOR)
112 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_ALPHA)
113 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_SRC_ALPHA)
114 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, DST_ALPHA)
115 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_DST_ALPHA)
116 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, DST_COLOR)
117 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_DST_COLOR)
118 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_ALPHA_SATURATE)
119 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, CONSTANT_COLOR)
120 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_CONSTANT_COLOR)
121 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, CONSTANT_ALPHA)
122 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_CONSTANT_ALPHA)
123 DALI_ENUM_TO_STRING_TABLE_END(BLEND_FACTOR)
125 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_WRITE_MODE)
126 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, OFF)
127 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, AUTO)
128 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, ON)
129 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_WRITE_MODE)
131 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_TEST_MODE)
132 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, OFF)
133 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, AUTO)
134 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, ON)
135 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_TEST_MODE)
137 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_FUNCTION)
138 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, NEVER)
139 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, ALWAYS)
140 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, LESS)
141 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, GREATER)
142 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, EQUAL)
143 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, NOT_EQUAL)
144 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, LESS_EQUAL)
145 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, GREATER_EQUAL)
146 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_FUNCTION)
148 DALI_ENUM_TO_STRING_TABLE_BEGIN(STENCIL_FUNCTION)
149 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, NEVER)
150 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, LESS)
151 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, EQUAL)
152 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, LESS_EQUAL)
153 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, GREATER)
154 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, NOT_EQUAL)
155 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, GREATER_EQUAL)
156 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, ALWAYS)
157 DALI_ENUM_TO_STRING_TABLE_END(STENCIL_FUNCTION)
159 DALI_ENUM_TO_STRING_TABLE_BEGIN(RENDER_MODE)
160 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, NONE)
161 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, AUTO)
162 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, COLOR)
163 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, STENCIL)
164 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, COLOR_STENCIL)
165 DALI_ENUM_TO_STRING_TABLE_END(RENDER_MODE)
167 DALI_ENUM_TO_STRING_TABLE_BEGIN(STENCIL_OPERATION)
168 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, ZERO)
169 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, KEEP)
170 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, REPLACE)
171 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INCREMENT)
172 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, DECREMENT)
173 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INVERT)
174 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INCREMENT_WRAP)
175 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, DECREMENT_WRAP)
176 DALI_ENUM_TO_STRING_TABLE_END(STENCIL_OPERATION)
178 DALI_ENUM_TO_STRING_TABLE_BEGIN(RENDERING_BEHAVIOR)
179 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelRenderer::Rendering, IF_REQUIRED)
180 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelRenderer::Rendering, CONTINUOUSLY)
181 DALI_ENUM_TO_STRING_TABLE_END(RENDERING_BEHAVIOR)
185 return Dali::BaseHandle();
188 TypeRegistration mType(typeid(Dali::Renderer), typeid(Dali::Handle), Create, RendererDefaultProperties);
190 } // unnamed namespace
192 RendererPtr Renderer::New()
194 // create scene object first so it's guaranteed to exist for the event side
195 auto sceneObject = SceneGraph::Renderer::New();
196 OwnerPointer<SceneGraph::Renderer> transferOwnership(sceneObject);
197 // pass the pointer to base for message passing
198 RendererPtr rendererPtr(new Renderer(sceneObject));
199 // transfer scene object ownership to update manager
200 EventThreadServices& eventThreadServices = rendererPtr->GetEventThreadServices();
201 SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
202 AddRendererMessage(updateManager, transferOwnership);
204 eventThreadServices.RegisterObject(rendererPtr.Get());
208 void Renderer::SetGeometry(Geometry& geometry)
210 mGeometry = &geometry;
212 const Render::Geometry* geometrySceneObject = geometry.GetRenderObject();
213 SetGeometryMessage(GetEventThreadServices(), GetRendererSceneObject(), *geometrySceneObject);
216 GeometryPtr Renderer::GetGeometry() const
221 void Renderer::SetTextures(TextureSet& textureSet)
223 mTextureSet = &textureSet;
224 const SceneGraph::TextureSet* textureSetSceneObject = textureSet.GetTextureSetSceneObject();
225 SetTexturesMessage(GetEventThreadServices(), GetRendererSceneObject(), *textureSetSceneObject);
228 TextureSetPtr Renderer::GetTextures() const
233 void Renderer::SetShader(Shader& shader)
236 const SceneGraph::Shader& sceneGraphShader = shader.GetShaderSceneObject();
237 SceneGraph::SetShaderMessage(GetEventThreadServices(), GetRendererSceneObject(), sceneGraphShader);
240 ShaderPtr Renderer::GetShader() const
245 void Renderer::SetDepthIndex(int32_t depthIndex)
247 if(mDepthIndex != depthIndex)
249 mDepthIndex = depthIndex;
250 SetDepthIndexMessage(GetEventThreadServices(), GetRendererSceneObject(), depthIndex);
254 int32_t Renderer::GetDepthIndex() const
259 void Renderer::SetBlendMode(BlendMode::Type mode)
261 if(mBlendMode != mode)
265 SetBlendModeMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendMode);
269 BlendMode::Type Renderer::GetBlendMode() const
274 void Renderer::SetBlendFunc(BlendFactor::Type srcFactorRgba, BlendFactor::Type destFactorRgba)
276 mBlendingOptions.SetBlendFunc(srcFactorRgba, destFactorRgba, srcFactorRgba, destFactorRgba);
277 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
280 void Renderer::SetBlendFunc(BlendFactor::Type srcFactorRgb,
281 BlendFactor::Type destFactorRgb,
282 BlendFactor::Type srcFactorAlpha,
283 BlendFactor::Type destFactorAlpha)
285 mBlendingOptions.SetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
286 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
289 void Renderer::GetBlendFunc(BlendFactor::Type& srcFactorRgb,
290 BlendFactor::Type& destFactorRgb,
291 BlendFactor::Type& srcFactorAlpha,
292 BlendFactor::Type& destFactorAlpha) const
294 srcFactorRgb = mBlendingOptions.GetBlendSrcFactorRgb();
295 destFactorRgb = mBlendingOptions.GetBlendDestFactorRgb();
296 srcFactorAlpha = mBlendingOptions.GetBlendSrcFactorAlpha();
297 destFactorAlpha = mBlendingOptions.GetBlendDestFactorAlpha();
300 void Renderer::SetBlendEquation(DevelBlendEquation::Type equationRgba)
302 mBlendingOptions.SetBlendEquation(equationRgba, equationRgba);
303 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
306 void Renderer::SetBlendEquation(DevelBlendEquation::Type equationRgb,
307 DevelBlendEquation::Type equationAlpha)
309 if(mBlendingOptions.IsAdvancedBlendEquation(equationRgb) || mBlendingOptions.IsAdvancedBlendEquation(equationAlpha))
311 DALI_LOG_ERROR("Advanced blend equation requires to be set by using SetBlendEquation( DevelBlendEquation::Type equationRgba ).");
314 mBlendingOptions.SetBlendEquation(equationRgb, equationAlpha);
315 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
318 void Renderer::GetBlendEquation(DevelBlendEquation::Type& equationRgb,
319 DevelBlendEquation::Type& equationAlpha) const
321 // These are not animatable, the cached values are up-to-date.
322 equationRgb = mBlendingOptions.GetBlendEquationRgb();
323 equationAlpha = mBlendingOptions.GetBlendEquationAlpha();
326 void Renderer::SetIndexedDrawFirstElement(uint32_t firstElement)
328 if(firstElement != mIndexedDrawFirstElement)
330 mIndexedDrawFirstElement = firstElement;
331 SetIndexedDrawFirstElementMessage(GetEventThreadServices(), GetRendererSceneObject(), mIndexedDrawFirstElement);
335 void Renderer::SetIndexedDrawElementsCount(uint32_t elementsCount)
337 if(elementsCount != mIndexedDrawElementCount)
339 mIndexedDrawElementCount = elementsCount;
340 SetIndexedDrawElementsCountMessage(GetEventThreadServices(), GetRendererSceneObject(), mIndexedDrawElementCount);
344 void Renderer::EnablePreMultipliedAlpha(bool preMultipled)
346 if(mPremultipledAlphaEnabled != preMultipled)
350 SetBlendFunc(BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA);
354 SetBlendFunc(BlendFactor::SRC_ALPHA, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA);
356 mPremultipledAlphaEnabled = preMultipled;
357 SetEnablePreMultipliedAlphaMessage(GetEventThreadServices(), GetRendererSceneObject(), mPremultipledAlphaEnabled);
361 bool Renderer::IsPreMultipliedAlphaEnabled() const
363 return mPremultipledAlphaEnabled;
366 bool Renderer::IsAdvancedBlendEquationApplied() const
368 DevelBlendEquation::Type equationRgb, equationAlpha;
369 GetBlendEquation(equationRgb, equationAlpha);
371 if(equationRgb != equationAlpha)
376 return mBlendingOptions.IsAdvancedBlendEquation(equationRgb);
379 const SceneGraph::Renderer& Renderer::GetRendererSceneObject() const
381 return static_cast<const SceneGraph::Renderer&>(GetSceneObject());
384 void Renderer::SetDefaultProperty(Property::Index index,
385 const Property::Value& propertyValue)
389 case Dali::Renderer::Property::DEPTH_INDEX:
391 SetDepthIndex(propertyValue.Get<int32_t>());
394 case Dali::Renderer::Property::FACE_CULLING_MODE:
396 FaceCullingMode::Type convertedValue = mFaceCullingMode;
397 if(Scripting::GetEnumerationProperty<FaceCullingMode::Type>(propertyValue, FACE_CULLING_MODE_TABLE, FACE_CULLING_MODE_TABLE_COUNT, convertedValue))
399 mFaceCullingMode = convertedValue;
400 SetFaceCullingModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
404 case Dali::Renderer::Property::BLEND_MODE:
406 BlendMode::Type convertedValue = mBlendMode;
407 if(Scripting::GetEnumerationProperty<BlendMode::Type>(propertyValue, BLEND_MODE_TABLE, BLEND_MODE_TABLE_COUNT, convertedValue))
409 SetBlendMode(convertedValue);
413 case Dali::DevelRenderer::Property::BLEND_EQUATION:
415 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationRgb();
417 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
419 mBlendingOptions.SetBlendEquation(convertedValue, convertedValue);
420 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
424 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
426 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationRgb();
428 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
430 if(mBlendingOptions.IsAdvancedBlendEquation(convertedValue))
432 DALI_LOG_ERROR("Advanced blend equation requires to be set by using DevelBlendEquation::BLEND_EQUATION.");
435 DevelBlendEquation::Type alphaEquation = mBlendingOptions.GetBlendEquationAlpha();
436 mBlendingOptions.SetBlendEquation(convertedValue, alphaEquation);
437 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
441 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
443 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationAlpha();
445 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
447 if(mBlendingOptions.IsAdvancedBlendEquation(convertedValue))
449 DALI_LOG_ERROR("Advanced blend equation requires to be set by using DevelBlendEquation::BLEND_EQUATION.");
452 DevelBlendEquation::Type rgbEquation = mBlendingOptions.GetBlendEquationRgb();
453 mBlendingOptions.SetBlendEquation(rgbEquation, convertedValue);
454 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
458 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
460 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
461 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
463 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, sourceFactorRgb))
465 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
469 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
471 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
472 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
474 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, destinationFactorRgb))
476 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
480 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
482 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
483 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
485 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, sourceFactorAlpha))
487 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
491 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
493 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
494 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
496 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, destinationFactorAlpha))
498 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
502 case Dali::Renderer::Property::BLEND_COLOR:
505 if(propertyValue.Get(blendColor))
507 SetBlendColor(blendColor);
511 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
514 if(propertyValue.Get(preMultipled))
516 EnablePreMultipliedAlpha(preMultipled);
520 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
522 int32_t firstElement;
523 if(propertyValue.Get(firstElement))
525 SetIndexedDrawFirstElement(firstElement);
529 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
531 int32_t elementsCount;
532 if(propertyValue.Get(elementsCount))
534 SetIndexedDrawElementsCount(elementsCount);
538 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
540 DepthWriteMode::Type convertedValue = mDepthWriteMode;
541 if(Scripting::GetEnumerationProperty<DepthWriteMode::Type>(propertyValue, DEPTH_WRITE_MODE_TABLE, DEPTH_WRITE_MODE_TABLE_COUNT, convertedValue))
543 mDepthWriteMode = convertedValue;
544 SetDepthWriteModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
548 case Dali::Renderer::Property::DEPTH_FUNCTION:
550 DepthFunction::Type convertedValue = mDepthFunction;
551 if(Scripting::GetEnumerationProperty<DepthFunction::Type>(propertyValue, DEPTH_FUNCTION_TABLE, DEPTH_FUNCTION_TABLE_COUNT, convertedValue))
553 mDepthFunction = convertedValue;
554 SetDepthFunctionMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
558 case Dali::Renderer::Property::DEPTH_TEST_MODE:
560 DepthTestMode::Type convertedValue = mDepthTestMode;
561 if(Scripting::GetEnumerationProperty<DepthTestMode::Type>(propertyValue, DEPTH_TEST_MODE_TABLE, DEPTH_TEST_MODE_TABLE_COUNT, convertedValue))
563 mDepthTestMode = convertedValue;
564 SetDepthTestModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
568 case Dali::Renderer::Property::RENDER_MODE:
570 RenderMode::Type convertedValue = mStencilParameters.renderMode;
571 if(Scripting::GetEnumerationProperty<RenderMode::Type>(propertyValue, RENDER_MODE_TABLE, RENDER_MODE_TABLE_COUNT, convertedValue))
573 mStencilParameters.renderMode = convertedValue;
574 SetRenderModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
578 case Dali::Renderer::Property::STENCIL_FUNCTION:
580 StencilFunction::Type convertedValue = mStencilParameters.stencilFunction;
581 if(Scripting::GetEnumerationProperty<StencilFunction::Type>(propertyValue, STENCIL_FUNCTION_TABLE, STENCIL_FUNCTION_TABLE_COUNT, convertedValue))
583 mStencilParameters.stencilFunction = convertedValue;
584 SetStencilFunctionMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
588 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
590 int32_t stencilFunctionMask;
591 if(propertyValue.Get(stencilFunctionMask))
593 if(stencilFunctionMask != mStencilParameters.stencilFunctionMask)
595 mStencilParameters.stencilFunctionMask = stencilFunctionMask;
596 SetStencilFunctionMaskMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilFunctionMask);
601 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
603 int32_t stencilFunctionReference;
604 if(propertyValue.Get(stencilFunctionReference))
606 if(stencilFunctionReference != mStencilParameters.stencilFunctionReference)
608 mStencilParameters.stencilFunctionReference = stencilFunctionReference;
609 SetStencilFunctionReferenceMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilFunctionReference);
614 case Dali::Renderer::Property::STENCIL_MASK:
617 if(propertyValue.Get(stencilMask))
619 if(stencilMask != mStencilParameters.stencilMask)
621 mStencilParameters.stencilMask = stencilMask;
622 SetStencilMaskMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilMask);
627 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
629 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnFail;
630 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
632 mStencilParameters.stencilOperationOnFail = convertedValue;
633 SetStencilOperationOnFailMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
637 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
639 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnZFail;
640 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
642 mStencilParameters.stencilOperationOnZFail = convertedValue;
643 SetStencilOperationOnZFailMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
647 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
649 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnZPass;
650 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
652 mStencilParameters.stencilOperationOnZPass = convertedValue;
653 SetStencilOperationOnZPassMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
657 case Dali::DevelRenderer::Property::OPACITY:
660 if(propertyValue.Get(opacity))
662 if(!Equals(mOpacity, opacity))
665 BakeOpacityMessage(GetEventThreadServices(), GetRendererSceneObject(), mOpacity);
670 case DevelRenderer::Property::RENDERING_BEHAVIOR:
672 DevelRenderer::Rendering::Type convertedValue = mRenderingBehavior;
673 if(Scripting::GetEnumerationProperty<DevelRenderer::Rendering::Type>(propertyValue, RENDERING_BEHAVIOR_TABLE, RENDERING_BEHAVIOR_TABLE_COUNT, convertedValue))
675 mRenderingBehavior = convertedValue;
676 SetRenderingBehaviorMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
683 Property::Value Renderer::GetDefaultProperty(Property::Index index) const
685 Property::Value value;
687 if(!GetCachedPropertyValue(index, value))
689 // If property value is not stored in the event-side, then it must be a scene-graph only property
690 GetCurrentPropertyValue(index, value);
696 Property::Value Renderer::GetDefaultPropertyCurrentValue(Property::Index index) const
698 Property::Value value;
700 if(!GetCurrentPropertyValue(index, value))
702 // If unable to retrieve scene-graph property value, then it must be an event-side only property
703 GetCachedPropertyValue(index, value);
709 void Renderer::OnNotifyDefaultPropertyAnimation(Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType)
711 switch(animationType)
714 case Animation::BETWEEN:
718 case Dali::DevelRenderer::Property::OPACITY:
731 case Dali::DevelRenderer::Property::OPACITY:
733 AdjustValue<float>(mOpacity, value);
742 const SceneGraph::PropertyBase* Renderer::GetSceneObjectAnimatableProperty(Property::Index index) const
744 const SceneGraph::PropertyBase* property = nullptr;
746 if(index == DevelRenderer::Property::OPACITY)
748 property = &GetRendererSceneObject().mOpacity;
752 // not our property, ask base
753 property = Object::GetSceneObjectAnimatableProperty(index);
759 const PropertyInputImpl* Renderer::GetSceneObjectInputProperty(Property::Index index) const
761 // reuse animatable property getter, Object::GetSceneObjectInputProperty does the same so no need to call that0
762 return GetSceneObjectAnimatableProperty(index);
765 Renderer::Renderer(const SceneGraph::Renderer* sceneObject)
766 : Object(sceneObject),
768 mIndexedDrawFirstElement(0),
769 mIndexedDrawElementCount(0),
770 mStencilParameters(RenderMode::AUTO, StencilFunction::ALWAYS, 0xFF, 0x00, 0xFF, StencilOperation::KEEP, StencilOperation::KEEP, StencilOperation::KEEP),
773 mDepthFunction(DepthFunction::LESS),
774 mFaceCullingMode(FaceCullingMode::NONE),
775 mBlendMode(BlendMode::AUTO),
776 mDepthWriteMode(DepthWriteMode::AUTO),
777 mDepthTestMode(DepthTestMode::AUTO),
778 mRenderingBehavior(DevelRenderer::Rendering::IF_REQUIRED),
779 mPremultipledAlphaEnabled(false)
783 void Renderer::SetBlendColor(const Vector4& blendColor)
785 mBlendingOptions.SetBlendColor(blendColor);
786 SetBlendColorMessage(GetEventThreadServices(), GetRendererSceneObject(), GetBlendColor());
789 const Vector4& Renderer::GetBlendColor() const
791 const Vector4* blendColor = mBlendingOptions.GetBlendColor();
796 return Color::TRANSPARENT; // GL default
799 Renderer::~Renderer()
801 if(EventThreadServices::IsCoreRunning())
803 EventThreadServices& eventThreadServices = GetEventThreadServices();
804 SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
805 RemoveRendererMessage(updateManager, GetRendererSceneObject());
807 eventThreadServices.UnregisterObject(this);
811 bool Renderer::GetCachedPropertyValue(Property::Index index, Property::Value& value) const
813 bool valueSet = true;
817 case Dali::Renderer::Property::DEPTH_INDEX:
819 value = GetDepthIndex();
822 case Dali::Renderer::Property::FACE_CULLING_MODE:
824 value = mFaceCullingMode;
827 case Dali::Renderer::Property::BLEND_MODE:
832 case Dali::DevelRenderer::Property::BLEND_EQUATION:
834 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationRgb());
837 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
839 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationRgb());
842 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
844 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationAlpha());
847 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
849 BlendFactor::Type srcFactorRgb;
850 BlendFactor::Type destFactorRgb;
851 BlendFactor::Type srcFactorAlpha;
852 BlendFactor::Type destFactorAlpha;
853 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
854 value = static_cast<int32_t>(srcFactorRgb);
857 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
859 BlendFactor::Type srcFactorRgb;
860 BlendFactor::Type destFactorRgb;
861 BlendFactor::Type srcFactorAlpha;
862 BlendFactor::Type destFactorAlpha;
863 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
864 value = static_cast<int32_t>(destFactorRgb);
867 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
869 BlendFactor::Type srcFactorRgb;
870 BlendFactor::Type destFactorRgb;
871 BlendFactor::Type srcFactorAlpha;
872 BlendFactor::Type destFactorAlpha;
873 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
874 value = static_cast<int32_t>(srcFactorAlpha);
877 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
879 BlendFactor::Type srcFactorRgb;
880 BlendFactor::Type destFactorRgb;
881 BlendFactor::Type srcFactorAlpha;
882 BlendFactor::Type destFactorAlpha;
883 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
884 value = static_cast<int32_t>(destFactorAlpha);
887 case Dali::Renderer::Property::BLEND_COLOR:
889 value = GetBlendColor();
892 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
894 value = IsPreMultipliedAlphaEnabled();
897 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
899 value = static_cast<int32_t>(mIndexedDrawFirstElement);
902 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
904 value = static_cast<int32_t>(mIndexedDrawElementCount);
907 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
909 value = mDepthWriteMode;
912 case Dali::Renderer::Property::DEPTH_FUNCTION:
914 value = mDepthFunction;
917 case Dali::Renderer::Property::DEPTH_TEST_MODE:
919 value = mDepthTestMode;
922 case Dali::Renderer::Property::STENCIL_FUNCTION:
924 value = mStencilParameters.stencilFunction;
927 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
929 value = mStencilParameters.stencilFunctionMask;
932 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
934 value = mStencilParameters.stencilFunctionReference;
937 case Dali::Renderer::Property::STENCIL_MASK:
939 value = mStencilParameters.stencilMask;
942 case Dali::Renderer::Property::RENDER_MODE:
944 value = mStencilParameters.renderMode;
947 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
949 value = mStencilParameters.stencilOperationOnFail;
952 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
954 value = mStencilParameters.stencilOperationOnZFail;
957 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
959 value = mStencilParameters.stencilOperationOnZPass;
962 case Dali::DevelRenderer::Property::OPACITY:
967 case Dali::DevelRenderer::Property::RENDERING_BEHAVIOR:
969 value = mRenderingBehavior;
974 // Must be a scene-graph only property
983 bool Renderer::GetCurrentPropertyValue(Property::Index index, Property::Value& value) const
985 bool valueSet = true;
986 const SceneGraph::Renderer& sceneObject = GetRendererSceneObject();
990 case Dali::Renderer::Property::DEPTH_INDEX:
992 value = sceneObject.GetDepthIndex();
995 case Dali::Renderer::Property::FACE_CULLING_MODE:
997 value = sceneObject.GetFaceCullingMode();
1000 case Dali::Renderer::Property::BLEND_MODE:
1002 value = sceneObject.GetBlendMode();
1005 case Dali::DevelRenderer::Property::BLEND_EQUATION:
1007 uint32_t bitMask = sceneObject.GetBlendingOptions();
1008 BlendingOptions blendingOptions;
1009 blendingOptions.SetBitmask(bitMask);
1010 value = static_cast<int32_t>(blendingOptions.GetBlendEquationRgb());
1013 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
1015 uint32_t bitMask = sceneObject.GetBlendingOptions();
1016 BlendingOptions blendingOptions;
1017 blendingOptions.SetBitmask(bitMask);
1018 value = static_cast<int32_t>(blendingOptions.GetBlendEquationRgb());
1021 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
1023 uint32_t bitMask = sceneObject.GetBlendingOptions();
1024 BlendingOptions blendingOptions;
1025 blendingOptions.SetBitmask(bitMask);
1026 value = static_cast<int32_t>(blendingOptions.GetBlendEquationAlpha());
1029 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
1031 uint32_t bitMask = sceneObject.GetBlendingOptions();
1032 BlendingOptions blendingOptions;
1033 blendingOptions.SetBitmask(bitMask);
1034 value = static_cast<int32_t>(blendingOptions.GetBlendSrcFactorRgb());
1037 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
1039 uint32_t bitMask = sceneObject.GetBlendingOptions();
1040 BlendingOptions blendingOptions;
1041 blendingOptions.SetBitmask(bitMask);
1042 value = static_cast<int32_t>(blendingOptions.GetBlendDestFactorRgb());
1045 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
1047 uint32_t bitMask = sceneObject.GetBlendingOptions();
1048 BlendingOptions blendingOptions;
1049 blendingOptions.SetBitmask(bitMask);
1050 value = static_cast<int32_t>(blendingOptions.GetBlendSrcFactorAlpha());
1053 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
1055 uint32_t bitMask = sceneObject.GetBlendingOptions();
1056 BlendingOptions blendingOptions;
1057 blendingOptions.SetBitmask(bitMask);
1058 value = static_cast<int32_t>(blendingOptions.GetBlendDestFactorAlpha());
1061 case Dali::Renderer::Property::BLEND_COLOR:
1063 value = sceneObject.GetBlendColor();
1066 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
1068 value = sceneObject.IsPreMultipliedAlphaEnabled();
1071 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
1073 value = static_cast<int32_t>(sceneObject.GetIndexedDrawFirstElement());
1076 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
1078 value = static_cast<int32_t>(sceneObject.GetIndexedDrawElementsCount());
1081 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
1083 value = sceneObject.GetDepthWriteMode();
1086 case Dali::Renderer::Property::DEPTH_FUNCTION:
1088 value = sceneObject.GetDepthFunction();
1091 case Dali::Renderer::Property::DEPTH_TEST_MODE:
1093 value = sceneObject.GetDepthTestMode();
1096 case Dali::Renderer::Property::STENCIL_FUNCTION:
1098 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1099 value = stencilParameters.stencilFunction;
1102 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
1104 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1105 value = stencilParameters.stencilFunctionMask;
1108 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
1110 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1111 value = stencilParameters.stencilFunctionReference;
1114 case Dali::Renderer::Property::STENCIL_MASK:
1116 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1117 value = stencilParameters.stencilMask;
1120 case Dali::Renderer::Property::RENDER_MODE:
1122 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1123 value = stencilParameters.renderMode;
1126 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
1128 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1129 value = stencilParameters.stencilOperationOnFail;
1132 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
1134 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1135 value = stencilParameters.stencilOperationOnZFail;
1138 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
1140 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1141 value = stencilParameters.stencilOperationOnZPass;
1144 case Dali::DevelRenderer::Property::OPACITY:
1146 value = sceneObject.GetOpacity(GetEventThreadServices().GetEventBufferIndex());
1149 case Dali::DevelRenderer::Property::RENDERING_BEHAVIOR:
1151 value = sceneObject.GetRenderingBehavior();
1156 // Must be an event-side only property
1165 void Renderer::AddDrawCommand(const Dali::DevelRenderer::DrawCommand& command)
1167 if(!mDrawCommands.capacity())
1169 mDrawCommands.reserve(8);
1172 mDrawCommands.emplace_back(command);
1174 Dali::Internal::SceneGraph::SetDrawCommandsMessage(GetEventThreadServices(),
1175 GetRendererSceneObject(),
1176 mDrawCommands.data(),
1177 uint32_t(mDrawCommands.size())
1182 } // namespace Internal