2 * Copyright (c) 2022 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_WITH_SCOPE(BlendMode, ON_WITHOUT_CULL)
83 DALI_ENUM_TO_STRING_TABLE_END(BLEND_MODE)
85 DALI_ENUM_TO_STRING_TABLE_BEGIN(BLEND_EQUATION)
86 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, ADD)
87 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, SUBTRACT)
88 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, REVERSE_SUBTRACT)
89 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MIN)
90 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MAX)
91 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MULTIPLY)
92 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SCREEN)
93 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, OVERLAY)
94 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, DARKEN)
95 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, LIGHTEN)
96 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR_DODGE)
97 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR_BURN)
98 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, HARD_LIGHT)
99 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SOFT_LIGHT)
100 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, DIFFERENCE)
101 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, EXCLUSION)
102 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, HUE)
103 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SATURATION)
104 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR)
105 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, LUMINOSITY)
106 DALI_ENUM_TO_STRING_TABLE_END(BLEND_EQUATION)
108 DALI_ENUM_TO_STRING_TABLE_BEGIN(BLEND_FACTOR)
109 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ZERO)
110 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE)
111 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_COLOR)
112 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_SRC_COLOR)
113 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_ALPHA)
114 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_SRC_ALPHA)
115 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, DST_ALPHA)
116 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_DST_ALPHA)
117 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, DST_COLOR)
118 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_DST_COLOR)
119 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_ALPHA_SATURATE)
120 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, CONSTANT_COLOR)
121 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_CONSTANT_COLOR)
122 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, CONSTANT_ALPHA)
123 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_CONSTANT_ALPHA)
124 DALI_ENUM_TO_STRING_TABLE_END(BLEND_FACTOR)
126 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_WRITE_MODE)
127 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, OFF)
128 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, AUTO)
129 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, ON)
130 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_WRITE_MODE)
132 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_TEST_MODE)
133 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, OFF)
134 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, AUTO)
135 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, ON)
136 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_TEST_MODE)
138 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_FUNCTION)
139 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, NEVER)
140 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, ALWAYS)
141 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, LESS)
142 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, GREATER)
143 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, EQUAL)
144 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, NOT_EQUAL)
145 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, LESS_EQUAL)
146 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, GREATER_EQUAL)
147 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_FUNCTION)
149 DALI_ENUM_TO_STRING_TABLE_BEGIN(STENCIL_FUNCTION)
150 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, NEVER)
151 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, LESS)
152 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, EQUAL)
153 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, LESS_EQUAL)
154 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, GREATER)
155 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, NOT_EQUAL)
156 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, GREATER_EQUAL)
157 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, ALWAYS)
158 DALI_ENUM_TO_STRING_TABLE_END(STENCIL_FUNCTION)
160 DALI_ENUM_TO_STRING_TABLE_BEGIN(RENDER_MODE)
161 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, NONE)
162 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, AUTO)
163 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, COLOR)
164 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, STENCIL)
165 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, COLOR_STENCIL)
166 DALI_ENUM_TO_STRING_TABLE_END(RENDER_MODE)
168 DALI_ENUM_TO_STRING_TABLE_BEGIN(STENCIL_OPERATION)
169 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, ZERO)
170 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, KEEP)
171 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, REPLACE)
172 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INCREMENT)
173 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, DECREMENT)
174 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INVERT)
175 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INCREMENT_WRAP)
176 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, DECREMENT_WRAP)
177 DALI_ENUM_TO_STRING_TABLE_END(STENCIL_OPERATION)
179 DALI_ENUM_TO_STRING_TABLE_BEGIN(RENDERING_BEHAVIOR)
180 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelRenderer::Rendering, IF_REQUIRED)
181 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelRenderer::Rendering, CONTINUOUSLY)
182 DALI_ENUM_TO_STRING_TABLE_END(RENDERING_BEHAVIOR)
186 return Dali::BaseHandle();
189 TypeRegistration mType(typeid(Dali::Renderer), typeid(Dali::Handle), Create, RendererDefaultProperties);
191 } // unnamed namespace
193 RendererPtr Renderer::New()
195 // create scene object first so it's guaranteed to exist for the event side
196 auto sceneObject = SceneGraph::Renderer::New();
197 OwnerPointer<SceneGraph::Renderer> transferOwnership(sceneObject);
198 // pass the pointer to base for message passing
199 RendererPtr rendererPtr(new Renderer(sceneObject));
200 // transfer scene object ownership to update manager
201 EventThreadServices& eventThreadServices = rendererPtr->GetEventThreadServices();
202 SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
203 AddRendererMessage(updateManager, transferOwnership);
205 eventThreadServices.RegisterObject(rendererPtr.Get());
209 void Renderer::SetGeometry(Geometry& geometry)
211 mGeometry = &geometry;
213 const Render::Geometry* geometrySceneObject = geometry.GetRenderObject();
214 SetGeometryMessage(GetEventThreadServices(), GetRendererSceneObject(), *geometrySceneObject);
217 GeometryPtr Renderer::GetGeometry() const
222 void Renderer::SetTextures(TextureSet& textureSet)
224 mTextureSet = &textureSet;
225 const SceneGraph::TextureSet* textureSetSceneObject = textureSet.GetTextureSetSceneObject();
226 SetTexturesMessage(GetEventThreadServices(), GetRendererSceneObject(), *textureSetSceneObject);
229 TextureSetPtr Renderer::GetTextures() const
234 void Renderer::SetShader(Shader& shader)
237 const SceneGraph::Shader& sceneGraphShader = shader.GetShaderSceneObject();
238 SceneGraph::SetShaderMessage(GetEventThreadServices(), GetRendererSceneObject(), sceneGraphShader);
241 ShaderPtr Renderer::GetShader() const
246 void Renderer::SetDepthIndex(int32_t depthIndex)
248 if(mDepthIndex != depthIndex)
250 mDepthIndex = depthIndex;
251 SetDepthIndexMessage(GetEventThreadServices(), GetRendererSceneObject(), depthIndex);
255 int32_t Renderer::GetDepthIndex() const
260 void Renderer::SetBlendMode(BlendMode::Type mode)
262 if(mBlendMode != mode)
266 SetBlendModeMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendMode);
270 BlendMode::Type Renderer::GetBlendMode() const
275 void Renderer::SetBlendFunc(BlendFactor::Type srcFactorRgba, BlendFactor::Type destFactorRgba)
277 mBlendingOptions.SetBlendFunc(srcFactorRgba, destFactorRgba, srcFactorRgba, destFactorRgba);
278 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
281 void Renderer::SetBlendFunc(BlendFactor::Type srcFactorRgb,
282 BlendFactor::Type destFactorRgb,
283 BlendFactor::Type srcFactorAlpha,
284 BlendFactor::Type destFactorAlpha)
286 mBlendingOptions.SetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
287 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
290 void Renderer::GetBlendFunc(BlendFactor::Type& srcFactorRgb,
291 BlendFactor::Type& destFactorRgb,
292 BlendFactor::Type& srcFactorAlpha,
293 BlendFactor::Type& destFactorAlpha) const
295 srcFactorRgb = mBlendingOptions.GetBlendSrcFactorRgb();
296 destFactorRgb = mBlendingOptions.GetBlendDestFactorRgb();
297 srcFactorAlpha = mBlendingOptions.GetBlendSrcFactorAlpha();
298 destFactorAlpha = mBlendingOptions.GetBlendDestFactorAlpha();
301 void Renderer::SetBlendEquation(DevelBlendEquation::Type equationRgba)
303 mBlendingOptions.SetBlendEquation(equationRgba, equationRgba);
304 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
307 void Renderer::SetBlendEquation(DevelBlendEquation::Type equationRgb,
308 DevelBlendEquation::Type equationAlpha)
310 if(mBlendingOptions.IsAdvancedBlendEquation(equationRgb) || mBlendingOptions.IsAdvancedBlendEquation(equationAlpha))
312 DALI_LOG_ERROR("Advanced blend equation requires to be set by using SetBlendEquation( DevelBlendEquation::Type equationRgba ).");
315 mBlendingOptions.SetBlendEquation(equationRgb, equationAlpha);
316 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
319 void Renderer::GetBlendEquation(DevelBlendEquation::Type& equationRgb,
320 DevelBlendEquation::Type& equationAlpha) const
322 // These are not animatable, the cached values are up-to-date.
323 equationRgb = mBlendingOptions.GetBlendEquationRgb();
324 equationAlpha = mBlendingOptions.GetBlendEquationAlpha();
327 void Renderer::SetIndexedDrawFirstElement(uint32_t firstElement)
329 if(firstElement != mIndexedDrawFirstElement)
331 mIndexedDrawFirstElement = firstElement;
332 SetIndexedDrawFirstElementMessage(GetEventThreadServices(), GetRendererSceneObject(), mIndexedDrawFirstElement);
336 void Renderer::SetIndexedDrawElementsCount(uint32_t elementsCount)
338 if(elementsCount != mIndexedDrawElementCount)
340 mIndexedDrawElementCount = elementsCount;
341 SetIndexedDrawElementsCountMessage(GetEventThreadServices(), GetRendererSceneObject(), mIndexedDrawElementCount);
345 void Renderer::EnablePreMultipliedAlpha(bool preMultipled)
347 if(mPremultipledAlphaEnabled != preMultipled)
351 SetBlendFunc(BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA);
355 SetBlendFunc(BlendFactor::SRC_ALPHA, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA);
357 mPremultipledAlphaEnabled = preMultipled;
358 SetEnablePreMultipliedAlphaMessage(GetEventThreadServices(), GetRendererSceneObject(), mPremultipledAlphaEnabled);
362 bool Renderer::IsPreMultipliedAlphaEnabled() const
364 return mPremultipledAlphaEnabled;
367 bool Renderer::IsAdvancedBlendEquationApplied() const
369 DevelBlendEquation::Type equationRgb, equationAlpha;
370 GetBlendEquation(equationRgb, equationAlpha);
372 if(equationRgb != equationAlpha)
377 return mBlendingOptions.IsAdvancedBlendEquation(equationRgb);
380 const SceneGraph::Renderer& Renderer::GetRendererSceneObject() const
382 return static_cast<const SceneGraph::Renderer&>(GetSceneObject());
385 void Renderer::SetDefaultProperty(Property::Index index,
386 const Property::Value& propertyValue)
390 case Dali::Renderer::Property::DEPTH_INDEX:
392 SetDepthIndex(propertyValue.Get<int32_t>());
395 case Dali::Renderer::Property::FACE_CULLING_MODE:
397 FaceCullingMode::Type convertedValue = mFaceCullingMode;
398 if(Scripting::GetEnumerationProperty<FaceCullingMode::Type>(propertyValue, FACE_CULLING_MODE_TABLE, FACE_CULLING_MODE_TABLE_COUNT, convertedValue))
400 mFaceCullingMode = convertedValue;
401 SetFaceCullingModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
405 case Dali::Renderer::Property::BLEND_MODE:
407 BlendMode::Type convertedValue = mBlendMode;
408 if(Scripting::GetEnumerationProperty<BlendMode::Type>(propertyValue, BLEND_MODE_TABLE, BLEND_MODE_TABLE_COUNT, convertedValue))
410 SetBlendMode(convertedValue);
414 case Dali::DevelRenderer::Property::BLEND_EQUATION:
416 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationRgb();
418 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
420 mBlendingOptions.SetBlendEquation(convertedValue, convertedValue);
421 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
425 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
427 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationRgb();
429 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
431 if(mBlendingOptions.IsAdvancedBlendEquation(convertedValue))
433 DALI_LOG_ERROR("Advanced blend equation requires to be set by using DevelBlendEquation::BLEND_EQUATION.");
436 DevelBlendEquation::Type alphaEquation = mBlendingOptions.GetBlendEquationAlpha();
437 mBlendingOptions.SetBlendEquation(convertedValue, alphaEquation);
438 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
442 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
444 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationAlpha();
446 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
448 if(mBlendingOptions.IsAdvancedBlendEquation(convertedValue))
450 DALI_LOG_ERROR("Advanced blend equation requires to be set by using DevelBlendEquation::BLEND_EQUATION.");
453 DevelBlendEquation::Type rgbEquation = mBlendingOptions.GetBlendEquationRgb();
454 mBlendingOptions.SetBlendEquation(rgbEquation, convertedValue);
455 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
459 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
461 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
462 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
464 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, sourceFactorRgb))
466 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
470 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
472 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
473 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
475 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, destinationFactorRgb))
477 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
481 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
483 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
484 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
486 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, sourceFactorAlpha))
488 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
492 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
494 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
495 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
497 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, destinationFactorAlpha))
499 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
503 case Dali::Renderer::Property::BLEND_COLOR:
506 if(propertyValue.Get(blendColor))
508 SetBlendColor(blendColor);
512 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
515 if(propertyValue.Get(preMultipled))
517 EnablePreMultipliedAlpha(preMultipled);
521 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
523 int32_t firstElement;
524 if(propertyValue.Get(firstElement))
526 SetIndexedDrawFirstElement(firstElement);
530 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
532 int32_t elementsCount;
533 if(propertyValue.Get(elementsCount))
535 SetIndexedDrawElementsCount(elementsCount);
539 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
541 DepthWriteMode::Type convertedValue = mDepthWriteMode;
542 if(Scripting::GetEnumerationProperty<DepthWriteMode::Type>(propertyValue, DEPTH_WRITE_MODE_TABLE, DEPTH_WRITE_MODE_TABLE_COUNT, convertedValue))
544 mDepthWriteMode = convertedValue;
545 SetDepthWriteModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
549 case Dali::Renderer::Property::DEPTH_FUNCTION:
551 DepthFunction::Type convertedValue = mDepthFunction;
552 if(Scripting::GetEnumerationProperty<DepthFunction::Type>(propertyValue, DEPTH_FUNCTION_TABLE, DEPTH_FUNCTION_TABLE_COUNT, convertedValue))
554 mDepthFunction = convertedValue;
555 SetDepthFunctionMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
559 case Dali::Renderer::Property::DEPTH_TEST_MODE:
561 DepthTestMode::Type convertedValue = mDepthTestMode;
562 if(Scripting::GetEnumerationProperty<DepthTestMode::Type>(propertyValue, DEPTH_TEST_MODE_TABLE, DEPTH_TEST_MODE_TABLE_COUNT, convertedValue))
564 mDepthTestMode = convertedValue;
565 SetDepthTestModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
569 case Dali::Renderer::Property::RENDER_MODE:
571 RenderMode::Type convertedValue = mStencilParameters.renderMode;
572 if(Scripting::GetEnumerationProperty<RenderMode::Type>(propertyValue, RENDER_MODE_TABLE, RENDER_MODE_TABLE_COUNT, convertedValue))
574 mStencilParameters.renderMode = convertedValue;
575 SetRenderModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
579 case Dali::Renderer::Property::STENCIL_FUNCTION:
581 StencilFunction::Type convertedValue = mStencilParameters.stencilFunction;
582 if(Scripting::GetEnumerationProperty<StencilFunction::Type>(propertyValue, STENCIL_FUNCTION_TABLE, STENCIL_FUNCTION_TABLE_COUNT, convertedValue))
584 mStencilParameters.stencilFunction = convertedValue;
585 SetStencilFunctionMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
589 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
591 int32_t stencilFunctionMask;
592 if(propertyValue.Get(stencilFunctionMask))
594 if(stencilFunctionMask != mStencilParameters.stencilFunctionMask)
596 mStencilParameters.stencilFunctionMask = stencilFunctionMask;
597 SetStencilFunctionMaskMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilFunctionMask);
602 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
604 int32_t stencilFunctionReference;
605 if(propertyValue.Get(stencilFunctionReference))
607 if(stencilFunctionReference != mStencilParameters.stencilFunctionReference)
609 mStencilParameters.stencilFunctionReference = stencilFunctionReference;
610 SetStencilFunctionReferenceMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilFunctionReference);
615 case Dali::Renderer::Property::STENCIL_MASK:
618 if(propertyValue.Get(stencilMask))
620 if(stencilMask != mStencilParameters.stencilMask)
622 mStencilParameters.stencilMask = stencilMask;
623 SetStencilMaskMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilMask);
628 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
630 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnFail;
631 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
633 mStencilParameters.stencilOperationOnFail = convertedValue;
634 SetStencilOperationOnFailMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
638 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
640 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnZFail;
641 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
643 mStencilParameters.stencilOperationOnZFail = convertedValue;
644 SetStencilOperationOnZFailMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
648 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
650 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnZPass;
651 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
653 mStencilParameters.stencilOperationOnZPass = convertedValue;
654 SetStencilOperationOnZPassMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
658 case Dali::DevelRenderer::Property::OPACITY:
661 if(propertyValue.Get(opacity))
663 if(!Equals(mOpacity, opacity))
666 BakeOpacityMessage(GetEventThreadServices(), GetRendererSceneObject(), mOpacity);
671 case DevelRenderer::Property::RENDERING_BEHAVIOR:
673 DevelRenderer::Rendering::Type convertedValue = mRenderingBehavior;
674 if(Scripting::GetEnumerationProperty<DevelRenderer::Rendering::Type>(propertyValue, RENDERING_BEHAVIOR_TABLE, RENDERING_BEHAVIOR_TABLE_COUNT, convertedValue))
676 mRenderingBehavior = convertedValue;
677 SetRenderingBehaviorMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
684 Property::Value Renderer::GetDefaultProperty(Property::Index index) const
686 Property::Value value;
688 if(!GetCachedPropertyValue(index, value))
690 // If property value is not stored in the event-side, then it must be a scene-graph only property
691 GetCurrentPropertyValue(index, value);
697 Property::Value Renderer::GetDefaultPropertyCurrentValue(Property::Index index) const
699 Property::Value value;
701 if(!GetCurrentPropertyValue(index, value))
703 // If unable to retrieve scene-graph property value, then it must be an event-side only property
704 GetCachedPropertyValue(index, value);
710 void Renderer::OnNotifyDefaultPropertyAnimation(Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType)
712 switch(animationType)
715 case Animation::BETWEEN:
719 case Dali::DevelRenderer::Property::OPACITY:
732 case Dali::DevelRenderer::Property::OPACITY:
734 AdjustValue<float>(mOpacity, value);
743 const SceneGraph::PropertyBase* Renderer::GetSceneObjectAnimatableProperty(Property::Index index) const
745 const SceneGraph::PropertyBase* property = nullptr;
747 if(index == DevelRenderer::Property::OPACITY)
749 property = &GetRendererSceneObject().mOpacity;
753 // not our property, ask base
754 property = Object::GetSceneObjectAnimatableProperty(index);
760 const PropertyInputImpl* Renderer::GetSceneObjectInputProperty(Property::Index index) const
762 // reuse animatable property getter, Object::GetSceneObjectInputProperty does the same so no need to call that0
763 return GetSceneObjectAnimatableProperty(index);
766 void Renderer::AddDrawCommand(const Dali::DevelRenderer::DrawCommand& command)
768 if(!mDrawCommands.capacity())
770 mDrawCommands.reserve(8);
773 mDrawCommands.emplace_back(command);
775 Dali::Internal::SceneGraph::SetDrawCommandsMessage(GetEventThreadServices(),
776 GetRendererSceneObject(),
777 mDrawCommands.data(),
778 uint32_t(mDrawCommands.size())
783 Renderer::Renderer(const SceneGraph::Renderer* sceneObject)
784 : Object(sceneObject),
786 mIndexedDrawFirstElement(0),
787 mIndexedDrawElementCount(0),
788 mStencilParameters(RenderMode::AUTO, StencilFunction::ALWAYS, 0xFF, 0x00, 0xFF, StencilOperation::KEEP, StencilOperation::KEEP, StencilOperation::KEEP),
791 mDepthFunction(DepthFunction::LESS),
792 mFaceCullingMode(FaceCullingMode::NONE),
793 mBlendMode(BlendMode::AUTO),
794 mDepthWriteMode(DepthWriteMode::AUTO),
795 mDepthTestMode(DepthTestMode::AUTO),
796 mRenderingBehavior(DevelRenderer::Rendering::IF_REQUIRED),
797 mPremultipledAlphaEnabled(false)
801 Renderer::~Renderer()
803 if(EventThreadServices::IsCoreRunning())
805 EventThreadServices& eventThreadServices = GetEventThreadServices();
806 SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
807 RemoveRendererMessage(updateManager, GetRendererSceneObject());
809 eventThreadServices.UnregisterObject(this);
813 bool Renderer::GetCachedPropertyValue(Property::Index index, Property::Value& value) const
815 bool valueSet = true;
819 case Dali::Renderer::Property::DEPTH_INDEX:
821 value = GetDepthIndex();
824 case Dali::Renderer::Property::FACE_CULLING_MODE:
826 value = mFaceCullingMode;
829 case Dali::Renderer::Property::BLEND_MODE:
834 case Dali::DevelRenderer::Property::BLEND_EQUATION:
836 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationRgb());
839 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
841 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationRgb());
844 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
846 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationAlpha());
849 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
851 BlendFactor::Type srcFactorRgb;
852 BlendFactor::Type destFactorRgb;
853 BlendFactor::Type srcFactorAlpha;
854 BlendFactor::Type destFactorAlpha;
855 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
856 value = static_cast<int32_t>(srcFactorRgb);
859 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
861 BlendFactor::Type srcFactorRgb;
862 BlendFactor::Type destFactorRgb;
863 BlendFactor::Type srcFactorAlpha;
864 BlendFactor::Type destFactorAlpha;
865 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
866 value = static_cast<int32_t>(destFactorRgb);
869 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
871 BlendFactor::Type srcFactorRgb;
872 BlendFactor::Type destFactorRgb;
873 BlendFactor::Type srcFactorAlpha;
874 BlendFactor::Type destFactorAlpha;
875 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
876 value = static_cast<int32_t>(srcFactorAlpha);
879 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
881 BlendFactor::Type srcFactorRgb;
882 BlendFactor::Type destFactorRgb;
883 BlendFactor::Type srcFactorAlpha;
884 BlendFactor::Type destFactorAlpha;
885 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
886 value = static_cast<int32_t>(destFactorAlpha);
889 case Dali::Renderer::Property::BLEND_COLOR:
891 value = GetBlendColor();
894 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
896 value = IsPreMultipliedAlphaEnabled();
899 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
901 value = static_cast<int32_t>(mIndexedDrawFirstElement);
904 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
906 value = static_cast<int32_t>(mIndexedDrawElementCount);
909 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
911 value = mDepthWriteMode;
914 case Dali::Renderer::Property::DEPTH_FUNCTION:
916 value = mDepthFunction;
919 case Dali::Renderer::Property::DEPTH_TEST_MODE:
921 value = mDepthTestMode;
924 case Dali::Renderer::Property::STENCIL_FUNCTION:
926 value = mStencilParameters.stencilFunction;
929 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
931 value = mStencilParameters.stencilFunctionMask;
934 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
936 value = mStencilParameters.stencilFunctionReference;
939 case Dali::Renderer::Property::STENCIL_MASK:
941 value = mStencilParameters.stencilMask;
944 case Dali::Renderer::Property::RENDER_MODE:
946 value = mStencilParameters.renderMode;
949 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
951 value = mStencilParameters.stencilOperationOnFail;
954 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
956 value = mStencilParameters.stencilOperationOnZFail;
959 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
961 value = mStencilParameters.stencilOperationOnZPass;
964 case Dali::DevelRenderer::Property::OPACITY:
969 case Dali::DevelRenderer::Property::RENDERING_BEHAVIOR:
971 value = mRenderingBehavior;
976 // Must be a scene-graph only property
985 bool Renderer::GetCurrentPropertyValue(Property::Index index, Property::Value& value) const
987 bool valueSet = true;
988 const SceneGraph::Renderer& sceneObject = GetRendererSceneObject();
992 case Dali::Renderer::Property::DEPTH_INDEX:
994 value = sceneObject.GetDepthIndex();
997 case Dali::Renderer::Property::FACE_CULLING_MODE:
999 value = sceneObject.GetFaceCullingMode();
1002 case Dali::Renderer::Property::BLEND_MODE:
1004 value = sceneObject.GetBlendMode();
1007 case Dali::DevelRenderer::Property::BLEND_EQUATION:
1009 uint32_t bitMask = sceneObject.GetBlendingOptions();
1010 BlendingOptions blendingOptions;
1011 blendingOptions.SetBitmask(bitMask);
1012 value = static_cast<int32_t>(blendingOptions.GetBlendEquationRgb());
1015 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
1017 uint32_t bitMask = sceneObject.GetBlendingOptions();
1018 BlendingOptions blendingOptions;
1019 blendingOptions.SetBitmask(bitMask);
1020 value = static_cast<int32_t>(blendingOptions.GetBlendEquationRgb());
1023 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
1025 uint32_t bitMask = sceneObject.GetBlendingOptions();
1026 BlendingOptions blendingOptions;
1027 blendingOptions.SetBitmask(bitMask);
1028 value = static_cast<int32_t>(blendingOptions.GetBlendEquationAlpha());
1031 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
1033 uint32_t bitMask = sceneObject.GetBlendingOptions();
1034 BlendingOptions blendingOptions;
1035 blendingOptions.SetBitmask(bitMask);
1036 value = static_cast<int32_t>(blendingOptions.GetBlendSrcFactorRgb());
1039 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
1041 uint32_t bitMask = sceneObject.GetBlendingOptions();
1042 BlendingOptions blendingOptions;
1043 blendingOptions.SetBitmask(bitMask);
1044 value = static_cast<int32_t>(blendingOptions.GetBlendDestFactorRgb());
1047 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
1049 uint32_t bitMask = sceneObject.GetBlendingOptions();
1050 BlendingOptions blendingOptions;
1051 blendingOptions.SetBitmask(bitMask);
1052 value = static_cast<int32_t>(blendingOptions.GetBlendSrcFactorAlpha());
1055 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
1057 uint32_t bitMask = sceneObject.GetBlendingOptions();
1058 BlendingOptions blendingOptions;
1059 blendingOptions.SetBitmask(bitMask);
1060 value = static_cast<int32_t>(blendingOptions.GetBlendDestFactorAlpha());
1063 case Dali::Renderer::Property::BLEND_COLOR:
1065 value = sceneObject.GetBlendColor();
1068 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
1070 value = sceneObject.IsPreMultipliedAlphaEnabled();
1073 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
1075 value = static_cast<int32_t>(sceneObject.GetIndexedDrawFirstElement());
1078 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
1080 value = static_cast<int32_t>(sceneObject.GetIndexedDrawElementsCount());
1083 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
1085 value = sceneObject.GetDepthWriteMode();
1088 case Dali::Renderer::Property::DEPTH_FUNCTION:
1090 value = sceneObject.GetDepthFunction();
1093 case Dali::Renderer::Property::DEPTH_TEST_MODE:
1095 value = sceneObject.GetDepthTestMode();
1098 case Dali::Renderer::Property::STENCIL_FUNCTION:
1100 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1101 value = stencilParameters.stencilFunction;
1104 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
1106 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1107 value = stencilParameters.stencilFunctionMask;
1110 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
1112 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1113 value = stencilParameters.stencilFunctionReference;
1116 case Dali::Renderer::Property::STENCIL_MASK:
1118 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1119 value = stencilParameters.stencilMask;
1122 case Dali::Renderer::Property::RENDER_MODE:
1124 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1125 value = stencilParameters.renderMode;
1128 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
1130 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1131 value = stencilParameters.stencilOperationOnFail;
1134 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
1136 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1137 value = stencilParameters.stencilOperationOnZFail;
1140 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
1142 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1143 value = stencilParameters.stencilOperationOnZPass;
1146 case Dali::DevelRenderer::Property::OPACITY:
1148 value = sceneObject.GetOpacity(GetEventThreadServices().GetEventBufferIndex());
1151 case Dali::DevelRenderer::Property::RENDERING_BEHAVIOR:
1153 value = sceneObject.GetRenderingBehavior();
1158 // Must be an event-side only property
1167 void Renderer::SetBlendColor(const Vector4& blendColor)
1169 mBlendingOptions.SetBlendColor(blendColor);
1170 SetBlendColorMessage(GetEventThreadServices(), GetRendererSceneObject(), GetBlendColor());
1173 const Vector4& Renderer::GetBlendColor() const
1175 const Vector4* blendColor = mBlendingOptions.GetBlendColor();
1180 return Color::TRANSPARENT; // GL default
1183 } // namespace Internal