2 * Copyright (c) 2023 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-messages.h>
28 #include <dali/internal/update/rendering/scene-graph-renderer.h>
29 #include <dali/public-api/object/type-registry.h>
38 * Properties: |name |type |writable|animatable|constraint-input|enum for index-checking|
40 DALI_PROPERTY_TABLE_BEGIN
41 DALI_PROPERTY("depthIndex", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_INDEX)
42 DALI_PROPERTY("faceCullingMode", INTEGER, true, false, false, Dali::Renderer::Property::FACE_CULLING_MODE)
43 DALI_PROPERTY("blendMode", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_MODE)
44 DALI_PROPERTY("blendEquationRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_EQUATION_RGB)
45 DALI_PROPERTY("blendEquationAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_EQUATION_ALPHA)
46 DALI_PROPERTY("blendFactorSrcRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB)
47 DALI_PROPERTY("blendFactorDestRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB)
48 DALI_PROPERTY("blendFactorSrcAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA)
49 DALI_PROPERTY("blendFactorDestAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA)
50 DALI_PROPERTY("blendColor", VECTOR4, true, false, false, Dali::Renderer::Property::BLEND_COLOR)
51 DALI_PROPERTY("blendPreMultipliedAlpha", BOOLEAN, true, false, false, Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA)
52 DALI_PROPERTY("indexRangeFirst", INTEGER, true, false, false, Dali::Renderer::Property::INDEX_RANGE_FIRST)
53 DALI_PROPERTY("indexRangeCount", INTEGER, true, false, false, Dali::Renderer::Property::INDEX_RANGE_COUNT)
54 DALI_PROPERTY("depthWriteMode", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_WRITE_MODE)
55 DALI_PROPERTY("depthFunction", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_FUNCTION)
56 DALI_PROPERTY("depthTestMode", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_TEST_MODE)
57 DALI_PROPERTY("renderMode", INTEGER, true, false, false, Dali::Renderer::Property::RENDER_MODE)
58 DALI_PROPERTY("stencilFunction", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION)
59 DALI_PROPERTY("stencilFunctionMask", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION_MASK)
60 DALI_PROPERTY("stencilFunctionReference", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE)
61 DALI_PROPERTY("stencilMask", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_MASK)
62 DALI_PROPERTY("stencilOperationOnFail", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL)
63 DALI_PROPERTY("stencilOperationOnZFail", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL)
64 DALI_PROPERTY("stencilOperationOnZPass", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS)
65 DALI_PROPERTY("opacity", FLOAT, true, true, true, Dali::DevelRenderer::Property::OPACITY)
66 DALI_PROPERTY("renderingBehavior", INTEGER, true, false, false, Dali::DevelRenderer::Property::RENDERING_BEHAVIOR)
67 DALI_PROPERTY("blendEquation", INTEGER, true, false, false, Dali::DevelRenderer::Property::BLEND_EQUATION)
68 DALI_PROPERTY_TABLE_END(DEFAULT_RENDERER_PROPERTY_START_INDEX, RendererDefaultProperties)
70 // Property string to enumeration tables:
72 DALI_ENUM_TO_STRING_TABLE_BEGIN(FACE_CULLING_MODE)
73 DALI_ENUM_TO_STRING_WITH_SCOPE(FaceCullingMode, NONE)
74 DALI_ENUM_TO_STRING_WITH_SCOPE(FaceCullingMode, FRONT)
75 DALI_ENUM_TO_STRING_WITH_SCOPE(FaceCullingMode, BACK)
76 DALI_ENUM_TO_STRING_WITH_SCOPE(FaceCullingMode, FRONT_AND_BACK)
77 DALI_ENUM_TO_STRING_TABLE_END(FACE_CULLING_MODE)
79 DALI_ENUM_TO_STRING_TABLE_BEGIN(BLEND_MODE)
80 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendMode, OFF)
81 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendMode, AUTO)
82 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendMode, ON)
83 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendMode, ON_WITHOUT_CULL)
84 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendMode, USE_ACTOR_OPACITY)
85 DALI_ENUM_TO_STRING_TABLE_END(BLEND_MODE)
87 DALI_ENUM_TO_STRING_TABLE_BEGIN(BLEND_EQUATION)
88 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, ADD)
89 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, SUBTRACT)
90 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, REVERSE_SUBTRACT)
91 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MIN)
92 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MAX)
93 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MULTIPLY)
94 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SCREEN)
95 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, OVERLAY)
96 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, DARKEN)
97 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, LIGHTEN)
98 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR_DODGE)
99 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR_BURN)
100 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, HARD_LIGHT)
101 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SOFT_LIGHT)
102 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, DIFFERENCE)
103 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, EXCLUSION)
104 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, HUE)
105 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SATURATION)
106 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR)
107 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, LUMINOSITY)
108 DALI_ENUM_TO_STRING_TABLE_END(BLEND_EQUATION)
110 DALI_ENUM_TO_STRING_TABLE_BEGIN(BLEND_FACTOR)
111 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ZERO)
112 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE)
113 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_COLOR)
114 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_SRC_COLOR)
115 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_ALPHA)
116 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_SRC_ALPHA)
117 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, DST_ALPHA)
118 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_DST_ALPHA)
119 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, DST_COLOR)
120 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_DST_COLOR)
121 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_ALPHA_SATURATE)
122 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, CONSTANT_COLOR)
123 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_CONSTANT_COLOR)
124 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, CONSTANT_ALPHA)
125 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_CONSTANT_ALPHA)
126 DALI_ENUM_TO_STRING_TABLE_END(BLEND_FACTOR)
128 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_WRITE_MODE)
129 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, OFF)
130 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, AUTO)
131 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, ON)
132 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_WRITE_MODE)
134 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_TEST_MODE)
135 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, OFF)
136 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, AUTO)
137 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, ON)
138 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_TEST_MODE)
140 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_FUNCTION)
141 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, NEVER)
142 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, ALWAYS)
143 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, LESS)
144 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, GREATER)
145 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, EQUAL)
146 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, NOT_EQUAL)
147 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, LESS_EQUAL)
148 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, GREATER_EQUAL)
149 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_FUNCTION)
151 DALI_ENUM_TO_STRING_TABLE_BEGIN(STENCIL_FUNCTION)
152 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, NEVER)
153 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, LESS)
154 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, EQUAL)
155 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, LESS_EQUAL)
156 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, GREATER)
157 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, NOT_EQUAL)
158 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, GREATER_EQUAL)
159 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, ALWAYS)
160 DALI_ENUM_TO_STRING_TABLE_END(STENCIL_FUNCTION)
162 DALI_ENUM_TO_STRING_TABLE_BEGIN(RENDER_MODE)
163 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, NONE)
164 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, AUTO)
165 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, COLOR)
166 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, STENCIL)
167 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, COLOR_STENCIL)
168 DALI_ENUM_TO_STRING_TABLE_END(RENDER_MODE)
170 DALI_ENUM_TO_STRING_TABLE_BEGIN(STENCIL_OPERATION)
171 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, ZERO)
172 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, KEEP)
173 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, REPLACE)
174 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INCREMENT)
175 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, DECREMENT)
176 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INVERT)
177 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INCREMENT_WRAP)
178 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, DECREMENT_WRAP)
179 DALI_ENUM_TO_STRING_TABLE_END(STENCIL_OPERATION)
181 DALI_ENUM_TO_STRING_TABLE_BEGIN(RENDERING_BEHAVIOR)
182 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelRenderer::Rendering, IF_REQUIRED)
183 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelRenderer::Rendering, CONTINUOUSLY)
184 DALI_ENUM_TO_STRING_TABLE_END(RENDERING_BEHAVIOR)
188 return Dali::BaseHandle();
191 TypeRegistration mType(typeid(Dali::Renderer), typeid(Dali::Handle), Create, RendererDefaultProperties);
193 } // unnamed namespace
195 RendererPtr Renderer::New()
197 // create scene object first so it's guaranteed to exist for the event side
198 auto sceneObjectKey = SceneGraph::Renderer::NewKey();
200 // pass the pointer to base for message passing
201 RendererPtr rendererPtr(new Renderer(sceneObjectKey.Get()));
203 EventThreadServices& eventThreadServices = rendererPtr->GetEventThreadServices();
204 SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
205 AddRendererMessage(updateManager, sceneObjectKey);
207 eventThreadServices.RegisterObject(rendererPtr.Get());
211 void Renderer::SetGeometry(Geometry& geometry)
213 mGeometry = &geometry;
215 const Render::Geometry* geometrySceneObject = geometry.GetRenderObject();
216 SetGeometryMessage(GetEventThreadServices(), GetRendererSceneObject(), *geometrySceneObject);
219 GeometryPtr Renderer::GetGeometry() const
224 void Renderer::SetTextures(TextureSet& textureSet)
226 mTextureSet = &textureSet;
227 const SceneGraph::TextureSet* textureSetSceneObject = textureSet.GetTextureSetSceneObject();
228 SetTexturesMessage(GetEventThreadServices(), GetRendererSceneObject(), *textureSetSceneObject);
231 TextureSetPtr Renderer::GetTextures() const
236 void Renderer::SetShader(Shader& shader)
239 const SceneGraph::Shader& sceneGraphShader = shader.GetShaderSceneObject();
240 SceneGraph::SetShaderMessage(GetEventThreadServices(), GetRendererSceneObject(), sceneGraphShader);
243 ShaderPtr Renderer::GetShader() const
248 void Renderer::SetDepthIndex(int32_t depthIndex)
250 if(mDepthIndex != depthIndex)
252 mDepthIndex = depthIndex;
253 SetDepthIndexMessage(GetEventThreadServices(), GetRendererSceneObject(), depthIndex);
257 int32_t Renderer::GetDepthIndex() const
262 void Renderer::SetBlendMode(BlendMode::Type mode)
264 if(mBlendMode != mode)
268 SetBlendModeMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendMode);
272 BlendMode::Type Renderer::GetBlendMode() const
277 void Renderer::SetBlendFunc(BlendFactor::Type srcFactorRgba, BlendFactor::Type destFactorRgba)
279 mBlendingOptions.SetBlendFunc(srcFactorRgba, destFactorRgba, srcFactorRgba, destFactorRgba);
280 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
283 void Renderer::SetBlendFunc(BlendFactor::Type srcFactorRgb,
284 BlendFactor::Type destFactorRgb,
285 BlendFactor::Type srcFactorAlpha,
286 BlendFactor::Type destFactorAlpha)
288 mBlendingOptions.SetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
289 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
292 void Renderer::GetBlendFunc(BlendFactor::Type& srcFactorRgb,
293 BlendFactor::Type& destFactorRgb,
294 BlendFactor::Type& srcFactorAlpha,
295 BlendFactor::Type& destFactorAlpha) const
297 srcFactorRgb = mBlendingOptions.GetBlendSrcFactorRgb();
298 destFactorRgb = mBlendingOptions.GetBlendDestFactorRgb();
299 srcFactorAlpha = mBlendingOptions.GetBlendSrcFactorAlpha();
300 destFactorAlpha = mBlendingOptions.GetBlendDestFactorAlpha();
303 void Renderer::SetBlendEquation(DevelBlendEquation::Type equationRgba)
305 mBlendingOptions.SetBlendEquation(equationRgba, equationRgba);
306 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
309 void Renderer::SetBlendEquation(DevelBlendEquation::Type equationRgb,
310 DevelBlendEquation::Type equationAlpha)
312 if(mBlendingOptions.IsAdvancedBlendEquation(equationRgb) || mBlendingOptions.IsAdvancedBlendEquation(equationAlpha))
314 DALI_LOG_ERROR("Advanced blend equation requires to be set by using SetBlendEquation( DevelBlendEquation::Type equationRgba ).");
317 mBlendingOptions.SetBlendEquation(equationRgb, equationAlpha);
318 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
321 void Renderer::GetBlendEquation(DevelBlendEquation::Type& equationRgb,
322 DevelBlendEquation::Type& equationAlpha) const
324 // These are not animatable, the cached values are up-to-date.
325 equationRgb = mBlendingOptions.GetBlendEquationRgb();
326 equationAlpha = mBlendingOptions.GetBlendEquationAlpha();
329 void Renderer::SetIndexedDrawFirstElement(uint32_t firstElement)
331 if(firstElement != mIndexedDrawFirstElement)
333 mIndexedDrawFirstElement = firstElement;
334 SetIndexedDrawFirstElementMessage(GetEventThreadServices(), GetRendererSceneObject(), mIndexedDrawFirstElement);
338 void Renderer::SetIndexedDrawElementsCount(uint32_t elementsCount)
340 if(elementsCount != mIndexedDrawElementCount)
342 mIndexedDrawElementCount = elementsCount;
343 SetIndexedDrawElementsCountMessage(GetEventThreadServices(), GetRendererSceneObject(), mIndexedDrawElementCount);
347 void Renderer::EnablePreMultipliedAlpha(bool preMultipled)
349 if(mPremultipledAlphaEnabled != preMultipled)
353 SetBlendFunc(BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA);
357 SetBlendFunc(BlendFactor::SRC_ALPHA, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA);
359 mPremultipledAlphaEnabled = preMultipled;
360 SetEnablePreMultipliedAlphaMessage(GetEventThreadServices(), GetRendererSceneObject(), mPremultipledAlphaEnabled);
364 bool Renderer::IsPreMultipliedAlphaEnabled() const
366 return mPremultipledAlphaEnabled;
369 bool Renderer::IsAdvancedBlendEquationApplied() const
371 DevelBlendEquation::Type equationRgb, equationAlpha;
372 GetBlendEquation(equationRgb, equationAlpha);
374 if(equationRgb != equationAlpha)
379 return mBlendingOptions.IsAdvancedBlendEquation(equationRgb);
382 const SceneGraph::Renderer& Renderer::GetRendererSceneObject() const
384 return static_cast<const SceneGraph::Renderer&>(GetSceneObject());
387 void Renderer::SetDefaultProperty(Property::Index index,
388 const Property::Value& propertyValue)
392 case Dali::Renderer::Property::DEPTH_INDEX:
394 SetDepthIndex(propertyValue.Get<int32_t>());
397 case Dali::Renderer::Property::FACE_CULLING_MODE:
399 FaceCullingMode::Type convertedValue = mFaceCullingMode;
400 if(Scripting::GetEnumerationProperty<FaceCullingMode::Type>(propertyValue, FACE_CULLING_MODE_TABLE, FACE_CULLING_MODE_TABLE_COUNT, convertedValue))
402 mFaceCullingMode = convertedValue;
403 SetFaceCullingModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
407 case Dali::Renderer::Property::BLEND_MODE:
409 BlendMode::Type convertedValue = mBlendMode;
410 if(Scripting::GetEnumerationProperty<BlendMode::Type>(propertyValue, BLEND_MODE_TABLE, BLEND_MODE_TABLE_COUNT, convertedValue))
412 SetBlendMode(convertedValue);
416 case Dali::DevelRenderer::Property::BLEND_EQUATION:
418 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationRgb();
420 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
422 mBlendingOptions.SetBlendEquation(convertedValue, convertedValue);
423 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
427 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
429 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationRgb();
431 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
433 if(mBlendingOptions.IsAdvancedBlendEquation(convertedValue))
435 DALI_LOG_ERROR("Advanced blend equation requires to be set by using DevelBlendEquation::BLEND_EQUATION.");
438 DevelBlendEquation::Type alphaEquation = mBlendingOptions.GetBlendEquationAlpha();
439 mBlendingOptions.SetBlendEquation(convertedValue, alphaEquation);
440 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
444 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
446 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationAlpha();
448 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
450 if(mBlendingOptions.IsAdvancedBlendEquation(convertedValue))
452 DALI_LOG_ERROR("Advanced blend equation requires to be set by using DevelBlendEquation::BLEND_EQUATION.");
455 DevelBlendEquation::Type rgbEquation = mBlendingOptions.GetBlendEquationRgb();
456 mBlendingOptions.SetBlendEquation(rgbEquation, convertedValue);
457 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
461 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
463 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
464 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
466 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, sourceFactorRgb))
468 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
472 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
474 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
475 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
477 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, destinationFactorRgb))
479 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
483 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
485 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
486 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
488 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, sourceFactorAlpha))
490 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
494 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
496 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
497 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
499 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, destinationFactorAlpha))
501 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
505 case Dali::Renderer::Property::BLEND_COLOR:
508 if(propertyValue.Get(blendColor))
510 SetBlendColor(blendColor);
514 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
517 if(propertyValue.Get(preMultipled))
519 EnablePreMultipliedAlpha(preMultipled);
523 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
525 int32_t firstElement;
526 if(propertyValue.Get(firstElement))
528 SetIndexedDrawFirstElement(firstElement);
532 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
534 int32_t elementsCount;
535 if(propertyValue.Get(elementsCount))
537 SetIndexedDrawElementsCount(elementsCount);
541 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
543 DepthWriteMode::Type convertedValue = mDepthWriteMode;
544 if(Scripting::GetEnumerationProperty<DepthWriteMode::Type>(propertyValue, DEPTH_WRITE_MODE_TABLE, DEPTH_WRITE_MODE_TABLE_COUNT, convertedValue))
546 mDepthWriteMode = convertedValue;
547 SetDepthWriteModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
551 case Dali::Renderer::Property::DEPTH_FUNCTION:
553 DepthFunction::Type convertedValue = mDepthFunction;
554 if(Scripting::GetEnumerationProperty<DepthFunction::Type>(propertyValue, DEPTH_FUNCTION_TABLE, DEPTH_FUNCTION_TABLE_COUNT, convertedValue))
556 mDepthFunction = convertedValue;
557 SetDepthFunctionMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
561 case Dali::Renderer::Property::DEPTH_TEST_MODE:
563 DepthTestMode::Type convertedValue = mDepthTestMode;
564 if(Scripting::GetEnumerationProperty<DepthTestMode::Type>(propertyValue, DEPTH_TEST_MODE_TABLE, DEPTH_TEST_MODE_TABLE_COUNT, convertedValue))
566 mDepthTestMode = convertedValue;
567 SetDepthTestModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
571 case Dali::Renderer::Property::RENDER_MODE:
573 RenderMode::Type convertedValue = mStencilParameters.renderMode;
574 if(Scripting::GetEnumerationProperty<RenderMode::Type>(propertyValue, RENDER_MODE_TABLE, RENDER_MODE_TABLE_COUNT, convertedValue))
576 mStencilParameters.renderMode = convertedValue;
577 SetRenderModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
581 case Dali::Renderer::Property::STENCIL_FUNCTION:
583 StencilFunction::Type convertedValue = mStencilParameters.stencilFunction;
584 if(Scripting::GetEnumerationProperty<StencilFunction::Type>(propertyValue, STENCIL_FUNCTION_TABLE, STENCIL_FUNCTION_TABLE_COUNT, convertedValue))
586 mStencilParameters.stencilFunction = convertedValue;
587 SetStencilFunctionMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
591 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
593 int32_t stencilFunctionMask;
594 if(propertyValue.Get(stencilFunctionMask))
596 if(stencilFunctionMask != mStencilParameters.stencilFunctionMask)
598 mStencilParameters.stencilFunctionMask = stencilFunctionMask;
599 SetStencilFunctionMaskMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilFunctionMask);
604 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
606 int32_t stencilFunctionReference;
607 if(propertyValue.Get(stencilFunctionReference))
609 if(stencilFunctionReference != mStencilParameters.stencilFunctionReference)
611 mStencilParameters.stencilFunctionReference = stencilFunctionReference;
612 SetStencilFunctionReferenceMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilFunctionReference);
617 case Dali::Renderer::Property::STENCIL_MASK:
620 if(propertyValue.Get(stencilMask))
622 if(stencilMask != mStencilParameters.stencilMask)
624 mStencilParameters.stencilMask = stencilMask;
625 SetStencilMaskMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilMask);
630 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
632 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnFail;
633 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
635 mStencilParameters.stencilOperationOnFail = convertedValue;
636 SetStencilOperationOnFailMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
640 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
642 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnZFail;
643 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
645 mStencilParameters.stencilOperationOnZFail = convertedValue;
646 SetStencilOperationOnZFailMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
650 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
652 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnZPass;
653 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
655 mStencilParameters.stencilOperationOnZPass = convertedValue;
656 SetStencilOperationOnZPassMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
660 case Dali::DevelRenderer::Property::OPACITY:
663 if(propertyValue.Get(opacity))
665 if(!Equals(mOpacity, opacity))
668 auto sceneObject = const_cast<SceneGraph::Renderer*>(&GetRendererSceneObject());
669 SceneGraph::BakeOpacityMessage(GetEventThreadServices(), *sceneObject, mOpacity);
674 case DevelRenderer::Property::RENDERING_BEHAVIOR:
676 DevelRenderer::Rendering::Type convertedValue = mRenderingBehavior;
677 if(Scripting::GetEnumerationProperty<DevelRenderer::Rendering::Type>(propertyValue, RENDERING_BEHAVIOR_TABLE, RENDERING_BEHAVIOR_TABLE_COUNT, convertedValue))
679 mRenderingBehavior = convertedValue;
680 SetRenderingBehaviorMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
687 Property::Value Renderer::GetDefaultProperty(Property::Index index) const
689 Property::Value value;
691 if(!GetCachedPropertyValue(index, value))
693 // If property value is not stored in the event-side, then it must be a scene-graph only property
694 GetCurrentPropertyValue(index, value);
700 Property::Value Renderer::GetDefaultPropertyCurrentValue(Property::Index index) const
702 Property::Value value;
704 if(!GetCurrentPropertyValue(index, value))
706 // If unable to retrieve scene-graph property value, then it must be an event-side only property
707 GetCachedPropertyValue(index, value);
713 void Renderer::OnNotifyDefaultPropertyAnimation(Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType)
715 switch(animationType)
718 case Animation::BETWEEN:
722 case Dali::DevelRenderer::Property::OPACITY:
735 case Dali::DevelRenderer::Property::OPACITY:
737 AdjustValue<float>(mOpacity, value);
746 const SceneGraph::PropertyBase* Renderer::GetSceneObjectAnimatableProperty(Property::Index index) const
748 const SceneGraph::PropertyBase* property = nullptr;
750 if(index == DevelRenderer::Property::OPACITY)
752 property = &GetRendererSceneObject().mOpacity;
756 // not our property, ask base
757 property = Object::GetSceneObjectAnimatableProperty(index);
763 const PropertyInputImpl* Renderer::GetSceneObjectInputProperty(Property::Index index) const
765 // reuse animatable property getter, Object::GetSceneObjectInputProperty does the same so no need to call that0
766 return GetSceneObjectAnimatableProperty(index);
769 void Renderer::AddDrawCommand(const Dali::DevelRenderer::DrawCommand& command)
771 if(!mDrawCommands.capacity())
773 mDrawCommands.reserve(8);
776 mDrawCommands.emplace_back(command);
778 Dali::Internal::SceneGraph::SetDrawCommandsMessage(GetEventThreadServices(),
779 GetRendererSceneObject(),
780 mDrawCommands.data(),
781 uint32_t(mDrawCommands.size())
786 Renderer::Renderer(const SceneGraph::Renderer* sceneObject)
787 : Object(sceneObject),
789 mIndexedDrawFirstElement(0),
790 mIndexedDrawElementCount(0),
791 mStencilParameters(RenderMode::AUTO, StencilFunction::ALWAYS, 0xFF, 0x00, 0xFF, StencilOperation::KEEP, StencilOperation::KEEP, StencilOperation::KEEP),
794 mDepthFunction(DepthFunction::LESS),
795 mFaceCullingMode(FaceCullingMode::NONE),
796 mBlendMode(BlendMode::AUTO),
797 mDepthWriteMode(DepthWriteMode::AUTO),
798 mDepthTestMode(DepthTestMode::AUTO),
799 mRenderingBehavior(DevelRenderer::Rendering::IF_REQUIRED),
800 mPremultipledAlphaEnabled(false)
804 Renderer::~Renderer()
806 if(EventThreadServices::IsCoreRunning())
808 EventThreadServices& eventThreadServices = GetEventThreadServices();
809 SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
810 RemoveRendererMessage(updateManager, SceneGraph::Renderer::GetKey(GetRendererSceneObject())); //@todo Use key throughtout
812 eventThreadServices.UnregisterObject(this);
816 bool Renderer::GetCachedPropertyValue(Property::Index index, Property::Value& value) const
818 bool valueSet = true;
822 case Dali::Renderer::Property::DEPTH_INDEX:
824 value = GetDepthIndex();
827 case Dali::Renderer::Property::FACE_CULLING_MODE:
829 value = mFaceCullingMode;
832 case Dali::Renderer::Property::BLEND_MODE:
837 case Dali::DevelRenderer::Property::BLEND_EQUATION:
839 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationRgb());
842 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
844 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationRgb());
847 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
849 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationAlpha());
852 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
854 BlendFactor::Type srcFactorRgb;
855 BlendFactor::Type destFactorRgb;
856 BlendFactor::Type srcFactorAlpha;
857 BlendFactor::Type destFactorAlpha;
858 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
859 value = static_cast<int32_t>(srcFactorRgb);
862 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
864 BlendFactor::Type srcFactorRgb;
865 BlendFactor::Type destFactorRgb;
866 BlendFactor::Type srcFactorAlpha;
867 BlendFactor::Type destFactorAlpha;
868 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
869 value = static_cast<int32_t>(destFactorRgb);
872 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
874 BlendFactor::Type srcFactorRgb;
875 BlendFactor::Type destFactorRgb;
876 BlendFactor::Type srcFactorAlpha;
877 BlendFactor::Type destFactorAlpha;
878 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
879 value = static_cast<int32_t>(srcFactorAlpha);
882 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
884 BlendFactor::Type srcFactorRgb;
885 BlendFactor::Type destFactorRgb;
886 BlendFactor::Type srcFactorAlpha;
887 BlendFactor::Type destFactorAlpha;
888 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
889 value = static_cast<int32_t>(destFactorAlpha);
892 case Dali::Renderer::Property::BLEND_COLOR:
894 value = GetBlendColor();
897 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
899 value = IsPreMultipliedAlphaEnabled();
902 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
904 value = static_cast<int32_t>(mIndexedDrawFirstElement);
907 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
909 value = static_cast<int32_t>(mIndexedDrawElementCount);
912 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
914 value = mDepthWriteMode;
917 case Dali::Renderer::Property::DEPTH_FUNCTION:
919 value = mDepthFunction;
922 case Dali::Renderer::Property::DEPTH_TEST_MODE:
924 value = mDepthTestMode;
927 case Dali::Renderer::Property::STENCIL_FUNCTION:
929 value = mStencilParameters.stencilFunction;
932 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
934 value = mStencilParameters.stencilFunctionMask;
937 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
939 value = mStencilParameters.stencilFunctionReference;
942 case Dali::Renderer::Property::STENCIL_MASK:
944 value = mStencilParameters.stencilMask;
947 case Dali::Renderer::Property::RENDER_MODE:
949 value = mStencilParameters.renderMode;
952 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
954 value = mStencilParameters.stencilOperationOnFail;
957 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
959 value = mStencilParameters.stencilOperationOnZFail;
962 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
964 value = mStencilParameters.stencilOperationOnZPass;
967 case Dali::DevelRenderer::Property::OPACITY:
972 case Dali::DevelRenderer::Property::RENDERING_BEHAVIOR:
974 value = mRenderingBehavior;
979 // Must be a scene-graph only property
988 bool Renderer::GetCurrentPropertyValue(Property::Index index, Property::Value& value) const
990 bool valueSet = true;
991 const SceneGraph::Renderer& sceneObject = GetRendererSceneObject();
995 case Dali::Renderer::Property::DEPTH_INDEX:
997 value = sceneObject.GetDepthIndex();
1000 case Dali::Renderer::Property::FACE_CULLING_MODE:
1002 value = sceneObject.GetFaceCullingMode();
1005 case Dali::Renderer::Property::BLEND_MODE:
1007 value = sceneObject.GetBlendMode();
1010 case Dali::DevelRenderer::Property::BLEND_EQUATION:
1012 uint32_t bitMask = sceneObject.GetBlendingOptions();
1013 BlendingOptions blendingOptions;
1014 blendingOptions.SetBitmask(bitMask);
1015 value = static_cast<int32_t>(blendingOptions.GetBlendEquationRgb());
1018 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
1020 uint32_t bitMask = sceneObject.GetBlendingOptions();
1021 BlendingOptions blendingOptions;
1022 blendingOptions.SetBitmask(bitMask);
1023 value = static_cast<int32_t>(blendingOptions.GetBlendEquationRgb());
1026 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
1028 uint32_t bitMask = sceneObject.GetBlendingOptions();
1029 BlendingOptions blendingOptions;
1030 blendingOptions.SetBitmask(bitMask);
1031 value = static_cast<int32_t>(blendingOptions.GetBlendEquationAlpha());
1034 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
1036 uint32_t bitMask = sceneObject.GetBlendingOptions();
1037 BlendingOptions blendingOptions;
1038 blendingOptions.SetBitmask(bitMask);
1039 value = static_cast<int32_t>(blendingOptions.GetBlendSrcFactorRgb());
1042 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
1044 uint32_t bitMask = sceneObject.GetBlendingOptions();
1045 BlendingOptions blendingOptions;
1046 blendingOptions.SetBitmask(bitMask);
1047 value = static_cast<int32_t>(blendingOptions.GetBlendDestFactorRgb());
1050 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
1052 uint32_t bitMask = sceneObject.GetBlendingOptions();
1053 BlendingOptions blendingOptions;
1054 blendingOptions.SetBitmask(bitMask);
1055 value = static_cast<int32_t>(blendingOptions.GetBlendSrcFactorAlpha());
1058 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
1060 uint32_t bitMask = sceneObject.GetBlendingOptions();
1061 BlendingOptions blendingOptions;
1062 blendingOptions.SetBitmask(bitMask);
1063 value = static_cast<int32_t>(blendingOptions.GetBlendDestFactorAlpha());
1066 case Dali::Renderer::Property::BLEND_COLOR:
1068 value = sceneObject.GetBlendColor();
1071 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
1073 value = sceneObject.IsPreMultipliedAlphaEnabled();
1076 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
1078 value = static_cast<int32_t>(sceneObject.GetIndexedDrawFirstElement());
1081 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
1083 value = static_cast<int32_t>(sceneObject.GetIndexedDrawElementsCount());
1086 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
1088 value = sceneObject.GetDepthWriteMode();
1091 case Dali::Renderer::Property::DEPTH_FUNCTION:
1093 value = sceneObject.GetDepthFunction();
1096 case Dali::Renderer::Property::DEPTH_TEST_MODE:
1098 value = sceneObject.GetDepthTestMode();
1101 case Dali::Renderer::Property::STENCIL_FUNCTION:
1103 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1104 value = stencilParameters.stencilFunction;
1107 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
1109 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1110 value = stencilParameters.stencilFunctionMask;
1113 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
1115 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1116 value = stencilParameters.stencilFunctionReference;
1119 case Dali::Renderer::Property::STENCIL_MASK:
1121 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1122 value = stencilParameters.stencilMask;
1125 case Dali::Renderer::Property::RENDER_MODE:
1127 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1128 value = stencilParameters.renderMode;
1131 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
1133 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1134 value = stencilParameters.stencilOperationOnFail;
1137 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
1139 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1140 value = stencilParameters.stencilOperationOnZFail;
1143 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
1145 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1146 value = stencilParameters.stencilOperationOnZPass;
1149 case Dali::DevelRenderer::Property::OPACITY:
1151 value = sceneObject.GetOpacity(GetEventThreadServices().GetEventBufferIndex());
1154 case Dali::DevelRenderer::Property::RENDERING_BEHAVIOR:
1156 value = sceneObject.GetRenderingBehavior();
1161 // Must be an event-side only property
1170 void Renderer::SetBlendColor(const Vector4& blendColor)
1172 mBlendingOptions.SetBlendColor(blendColor);
1173 SetBlendColorMessage(GetEventThreadServices(), GetRendererSceneObject(), GetBlendColor());
1176 const Vector4& Renderer::GetBlendColor() const
1178 const Vector4* blendColor = mBlendingOptions.GetBlendColor();
1183 return Color::TRANSPARENT; // GL default
1186 void Renderer::SetRenderCallback(RenderCallback* callback)
1188 Dali::Internal::SceneGraph::SetRenderCallbackMessage(GetEventThreadServices(),
1189 GetRendererSceneObject(),
1193 } // namespace Internal