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_WITH_SCOPE(BlendMode, USE_ACTOR_OPACITY)
84 DALI_ENUM_TO_STRING_TABLE_END(BLEND_MODE)
86 DALI_ENUM_TO_STRING_TABLE_BEGIN(BLEND_EQUATION)
87 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, ADD)
88 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, SUBTRACT)
89 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendEquation, REVERSE_SUBTRACT)
90 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MIN)
91 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MAX)
92 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, MULTIPLY)
93 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SCREEN)
94 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, OVERLAY)
95 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, DARKEN)
96 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, LIGHTEN)
97 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR_DODGE)
98 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR_BURN)
99 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, HARD_LIGHT)
100 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SOFT_LIGHT)
101 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, DIFFERENCE)
102 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, EXCLUSION)
103 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, HUE)
104 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, SATURATION)
105 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, COLOR)
106 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelBlendEquation, LUMINOSITY)
107 DALI_ENUM_TO_STRING_TABLE_END(BLEND_EQUATION)
109 DALI_ENUM_TO_STRING_TABLE_BEGIN(BLEND_FACTOR)
110 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ZERO)
111 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE)
112 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_COLOR)
113 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_SRC_COLOR)
114 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_ALPHA)
115 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_SRC_ALPHA)
116 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, DST_ALPHA)
117 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_DST_ALPHA)
118 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, DST_COLOR)
119 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_DST_COLOR)
120 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, SRC_ALPHA_SATURATE)
121 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, CONSTANT_COLOR)
122 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_CONSTANT_COLOR)
123 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, CONSTANT_ALPHA)
124 DALI_ENUM_TO_STRING_WITH_SCOPE(BlendFactor, ONE_MINUS_CONSTANT_ALPHA)
125 DALI_ENUM_TO_STRING_TABLE_END(BLEND_FACTOR)
127 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_WRITE_MODE)
128 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, OFF)
129 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, AUTO)
130 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthWriteMode, ON)
131 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_WRITE_MODE)
133 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_TEST_MODE)
134 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, OFF)
135 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, AUTO)
136 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthTestMode, ON)
137 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_TEST_MODE)
139 DALI_ENUM_TO_STRING_TABLE_BEGIN(DEPTH_FUNCTION)
140 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, NEVER)
141 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, ALWAYS)
142 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, LESS)
143 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, GREATER)
144 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, EQUAL)
145 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, NOT_EQUAL)
146 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, LESS_EQUAL)
147 DALI_ENUM_TO_STRING_WITH_SCOPE(DepthFunction, GREATER_EQUAL)
148 DALI_ENUM_TO_STRING_TABLE_END(DEPTH_FUNCTION)
150 DALI_ENUM_TO_STRING_TABLE_BEGIN(STENCIL_FUNCTION)
151 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, NEVER)
152 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, LESS)
153 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, EQUAL)
154 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, LESS_EQUAL)
155 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, GREATER)
156 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, NOT_EQUAL)
157 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, GREATER_EQUAL)
158 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilFunction, ALWAYS)
159 DALI_ENUM_TO_STRING_TABLE_END(STENCIL_FUNCTION)
161 DALI_ENUM_TO_STRING_TABLE_BEGIN(RENDER_MODE)
162 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, NONE)
163 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, AUTO)
164 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, COLOR)
165 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, STENCIL)
166 DALI_ENUM_TO_STRING_WITH_SCOPE(RenderMode, COLOR_STENCIL)
167 DALI_ENUM_TO_STRING_TABLE_END(RENDER_MODE)
169 DALI_ENUM_TO_STRING_TABLE_BEGIN(STENCIL_OPERATION)
170 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, ZERO)
171 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, KEEP)
172 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, REPLACE)
173 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INCREMENT)
174 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, DECREMENT)
175 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INVERT)
176 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, INCREMENT_WRAP)
177 DALI_ENUM_TO_STRING_WITH_SCOPE(StencilOperation, DECREMENT_WRAP)
178 DALI_ENUM_TO_STRING_TABLE_END(STENCIL_OPERATION)
180 DALI_ENUM_TO_STRING_TABLE_BEGIN(RENDERING_BEHAVIOR)
181 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelRenderer::Rendering, IF_REQUIRED)
182 DALI_ENUM_TO_STRING_WITH_SCOPE(DevelRenderer::Rendering, CONTINUOUSLY)
183 DALI_ENUM_TO_STRING_TABLE_END(RENDERING_BEHAVIOR)
187 return Dali::BaseHandle();
190 TypeRegistration mType(typeid(Dali::Renderer), typeid(Dali::Handle), Create, RendererDefaultProperties);
192 } // unnamed namespace
194 RendererPtr Renderer::New()
196 // create scene object first so it's guaranteed to exist for the event side
197 auto sceneObjectKey = SceneGraph::Renderer::NewKey();
199 // pass the pointer to base for message passing
200 RendererPtr rendererPtr(new Renderer(sceneObjectKey.Get()));
202 EventThreadServices& eventThreadServices = rendererPtr->GetEventThreadServices();
203 SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
204 AddRendererMessage(updateManager, sceneObjectKey);
206 eventThreadServices.RegisterObject(rendererPtr.Get());
210 void Renderer::SetGeometry(Geometry& geometry)
212 mGeometry = &geometry;
214 const Render::Geometry* geometrySceneObject = geometry.GetRenderObject();
215 SetGeometryMessage(GetEventThreadServices(), GetRendererSceneObject(), *geometrySceneObject);
218 GeometryPtr Renderer::GetGeometry() const
223 void Renderer::SetTextures(TextureSet& textureSet)
225 mTextureSet = &textureSet;
226 const SceneGraph::TextureSet* textureSetSceneObject = textureSet.GetTextureSetSceneObject();
227 SetTexturesMessage(GetEventThreadServices(), GetRendererSceneObject(), *textureSetSceneObject);
230 TextureSetPtr Renderer::GetTextures() const
235 void Renderer::SetShader(Shader& shader)
238 const SceneGraph::Shader& sceneGraphShader = shader.GetShaderSceneObject();
239 SceneGraph::SetShaderMessage(GetEventThreadServices(), GetRendererSceneObject(), sceneGraphShader);
242 ShaderPtr Renderer::GetShader() const
247 void Renderer::SetDepthIndex(int32_t depthIndex)
249 if(mDepthIndex != depthIndex)
251 mDepthIndex = depthIndex;
252 SetDepthIndexMessage(GetEventThreadServices(), GetRendererSceneObject(), depthIndex);
256 int32_t Renderer::GetDepthIndex() const
261 void Renderer::SetBlendMode(BlendMode::Type mode)
263 if(mBlendMode != mode)
267 SetBlendModeMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendMode);
271 BlendMode::Type Renderer::GetBlendMode() const
276 void Renderer::SetBlendFunc(BlendFactor::Type srcFactorRgba, BlendFactor::Type destFactorRgba)
278 mBlendingOptions.SetBlendFunc(srcFactorRgba, destFactorRgba, srcFactorRgba, destFactorRgba);
279 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
282 void Renderer::SetBlendFunc(BlendFactor::Type srcFactorRgb,
283 BlendFactor::Type destFactorRgb,
284 BlendFactor::Type srcFactorAlpha,
285 BlendFactor::Type destFactorAlpha)
287 mBlendingOptions.SetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
288 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
291 void Renderer::GetBlendFunc(BlendFactor::Type& srcFactorRgb,
292 BlendFactor::Type& destFactorRgb,
293 BlendFactor::Type& srcFactorAlpha,
294 BlendFactor::Type& destFactorAlpha) const
296 srcFactorRgb = mBlendingOptions.GetBlendSrcFactorRgb();
297 destFactorRgb = mBlendingOptions.GetBlendDestFactorRgb();
298 srcFactorAlpha = mBlendingOptions.GetBlendSrcFactorAlpha();
299 destFactorAlpha = mBlendingOptions.GetBlendDestFactorAlpha();
302 void Renderer::SetBlendEquation(DevelBlendEquation::Type equationRgba)
304 mBlendingOptions.SetBlendEquation(equationRgba, equationRgba);
305 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
308 void Renderer::SetBlendEquation(DevelBlendEquation::Type equationRgb,
309 DevelBlendEquation::Type equationAlpha)
311 if(mBlendingOptions.IsAdvancedBlendEquation(equationRgb) || mBlendingOptions.IsAdvancedBlendEquation(equationAlpha))
313 DALI_LOG_ERROR("Advanced blend equation requires to be set by using SetBlendEquation( DevelBlendEquation::Type equationRgba ).");
316 mBlendingOptions.SetBlendEquation(equationRgb, equationAlpha);
317 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
320 void Renderer::GetBlendEquation(DevelBlendEquation::Type& equationRgb,
321 DevelBlendEquation::Type& equationAlpha) const
323 // These are not animatable, the cached values are up-to-date.
324 equationRgb = mBlendingOptions.GetBlendEquationRgb();
325 equationAlpha = mBlendingOptions.GetBlendEquationAlpha();
328 void Renderer::SetIndexedDrawFirstElement(uint32_t firstElement)
330 if(firstElement != mIndexedDrawFirstElement)
332 mIndexedDrawFirstElement = firstElement;
333 SetIndexedDrawFirstElementMessage(GetEventThreadServices(), GetRendererSceneObject(), mIndexedDrawFirstElement);
337 void Renderer::SetIndexedDrawElementsCount(uint32_t elementsCount)
339 if(elementsCount != mIndexedDrawElementCount)
341 mIndexedDrawElementCount = elementsCount;
342 SetIndexedDrawElementsCountMessage(GetEventThreadServices(), GetRendererSceneObject(), mIndexedDrawElementCount);
346 void Renderer::EnablePreMultipliedAlpha(bool preMultipled)
348 if(mPremultipledAlphaEnabled != preMultipled)
352 SetBlendFunc(BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA);
356 SetBlendFunc(BlendFactor::SRC_ALPHA, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA);
358 mPremultipledAlphaEnabled = preMultipled;
359 SetEnablePreMultipliedAlphaMessage(GetEventThreadServices(), GetRendererSceneObject(), mPremultipledAlphaEnabled);
363 bool Renderer::IsPreMultipliedAlphaEnabled() const
365 return mPremultipledAlphaEnabled;
368 bool Renderer::IsAdvancedBlendEquationApplied() const
370 DevelBlendEquation::Type equationRgb, equationAlpha;
371 GetBlendEquation(equationRgb, equationAlpha);
373 if(equationRgb != equationAlpha)
378 return mBlendingOptions.IsAdvancedBlendEquation(equationRgb);
381 const SceneGraph::Renderer& Renderer::GetRendererSceneObject() const
383 return static_cast<const SceneGraph::Renderer&>(GetSceneObject());
386 void Renderer::SetDefaultProperty(Property::Index index,
387 const Property::Value& propertyValue)
391 case Dali::Renderer::Property::DEPTH_INDEX:
393 SetDepthIndex(propertyValue.Get<int32_t>());
396 case Dali::Renderer::Property::FACE_CULLING_MODE:
398 FaceCullingMode::Type convertedValue = mFaceCullingMode;
399 if(Scripting::GetEnumerationProperty<FaceCullingMode::Type>(propertyValue, FACE_CULLING_MODE_TABLE, FACE_CULLING_MODE_TABLE_COUNT, convertedValue))
401 mFaceCullingMode = convertedValue;
402 SetFaceCullingModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
406 case Dali::Renderer::Property::BLEND_MODE:
408 BlendMode::Type convertedValue = mBlendMode;
409 if(Scripting::GetEnumerationProperty<BlendMode::Type>(propertyValue, BLEND_MODE_TABLE, BLEND_MODE_TABLE_COUNT, convertedValue))
411 SetBlendMode(convertedValue);
415 case Dali::DevelRenderer::Property::BLEND_EQUATION:
417 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationRgb();
419 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
421 mBlendingOptions.SetBlendEquation(convertedValue, convertedValue);
422 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
426 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
428 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationRgb();
430 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
432 if(mBlendingOptions.IsAdvancedBlendEquation(convertedValue))
434 DALI_LOG_ERROR("Advanced blend equation requires to be set by using DevelBlendEquation::BLEND_EQUATION.");
437 DevelBlendEquation::Type alphaEquation = mBlendingOptions.GetBlendEquationAlpha();
438 mBlendingOptions.SetBlendEquation(convertedValue, alphaEquation);
439 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
443 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
445 DevelBlendEquation::Type convertedValue = mBlendingOptions.GetBlendEquationAlpha();
447 if(Scripting::GetEnumerationProperty<DevelBlendEquation::Type>(propertyValue, BLEND_EQUATION_TABLE, BLEND_EQUATION_TABLE_COUNT, convertedValue))
449 if(mBlendingOptions.IsAdvancedBlendEquation(convertedValue))
451 DALI_LOG_ERROR("Advanced blend equation requires to be set by using DevelBlendEquation::BLEND_EQUATION.");
454 DevelBlendEquation::Type rgbEquation = mBlendingOptions.GetBlendEquationRgb();
455 mBlendingOptions.SetBlendEquation(rgbEquation, convertedValue);
456 SetBlendingOptionsMessage(GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask());
460 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
462 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
463 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
465 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, sourceFactorRgb))
467 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
471 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
473 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
474 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
476 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, destinationFactorRgb))
478 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
482 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
484 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
485 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
487 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, sourceFactorAlpha))
489 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
493 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
495 BlendFactor::Type sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha;
496 GetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
498 if(Scripting::GetEnumerationProperty<BlendFactor::Type>(propertyValue, BLEND_FACTOR_TABLE, BLEND_FACTOR_TABLE_COUNT, destinationFactorAlpha))
500 SetBlendFunc(sourceFactorRgb, destinationFactorRgb, sourceFactorAlpha, destinationFactorAlpha);
504 case Dali::Renderer::Property::BLEND_COLOR:
507 if(propertyValue.Get(blendColor))
509 SetBlendColor(blendColor);
513 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
516 if(propertyValue.Get(preMultipled))
518 EnablePreMultipliedAlpha(preMultipled);
522 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
524 int32_t firstElement;
525 if(propertyValue.Get(firstElement))
527 SetIndexedDrawFirstElement(firstElement);
531 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
533 int32_t elementsCount;
534 if(propertyValue.Get(elementsCount))
536 SetIndexedDrawElementsCount(elementsCount);
540 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
542 DepthWriteMode::Type convertedValue = mDepthWriteMode;
543 if(Scripting::GetEnumerationProperty<DepthWriteMode::Type>(propertyValue, DEPTH_WRITE_MODE_TABLE, DEPTH_WRITE_MODE_TABLE_COUNT, convertedValue))
545 mDepthWriteMode = convertedValue;
546 SetDepthWriteModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
550 case Dali::Renderer::Property::DEPTH_FUNCTION:
552 DepthFunction::Type convertedValue = mDepthFunction;
553 if(Scripting::GetEnumerationProperty<DepthFunction::Type>(propertyValue, DEPTH_FUNCTION_TABLE, DEPTH_FUNCTION_TABLE_COUNT, convertedValue))
555 mDepthFunction = convertedValue;
556 SetDepthFunctionMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
560 case Dali::Renderer::Property::DEPTH_TEST_MODE:
562 DepthTestMode::Type convertedValue = mDepthTestMode;
563 if(Scripting::GetEnumerationProperty<DepthTestMode::Type>(propertyValue, DEPTH_TEST_MODE_TABLE, DEPTH_TEST_MODE_TABLE_COUNT, convertedValue))
565 mDepthTestMode = convertedValue;
566 SetDepthTestModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
570 case Dali::Renderer::Property::RENDER_MODE:
572 RenderMode::Type convertedValue = mStencilParameters.renderMode;
573 if(Scripting::GetEnumerationProperty<RenderMode::Type>(propertyValue, RENDER_MODE_TABLE, RENDER_MODE_TABLE_COUNT, convertedValue))
575 mStencilParameters.renderMode = convertedValue;
576 SetRenderModeMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
580 case Dali::Renderer::Property::STENCIL_FUNCTION:
582 StencilFunction::Type convertedValue = mStencilParameters.stencilFunction;
583 if(Scripting::GetEnumerationProperty<StencilFunction::Type>(propertyValue, STENCIL_FUNCTION_TABLE, STENCIL_FUNCTION_TABLE_COUNT, convertedValue))
585 mStencilParameters.stencilFunction = convertedValue;
586 SetStencilFunctionMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
590 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
592 int32_t stencilFunctionMask;
593 if(propertyValue.Get(stencilFunctionMask))
595 if(stencilFunctionMask != mStencilParameters.stencilFunctionMask)
597 mStencilParameters.stencilFunctionMask = stencilFunctionMask;
598 SetStencilFunctionMaskMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilFunctionMask);
603 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
605 int32_t stencilFunctionReference;
606 if(propertyValue.Get(stencilFunctionReference))
608 if(stencilFunctionReference != mStencilParameters.stencilFunctionReference)
610 mStencilParameters.stencilFunctionReference = stencilFunctionReference;
611 SetStencilFunctionReferenceMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilFunctionReference);
616 case Dali::Renderer::Property::STENCIL_MASK:
619 if(propertyValue.Get(stencilMask))
621 if(stencilMask != mStencilParameters.stencilMask)
623 mStencilParameters.stencilMask = stencilMask;
624 SetStencilMaskMessage(GetEventThreadServices(), GetRendererSceneObject(), stencilMask);
629 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
631 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnFail;
632 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
634 mStencilParameters.stencilOperationOnFail = convertedValue;
635 SetStencilOperationOnFailMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
639 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
641 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnZFail;
642 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
644 mStencilParameters.stencilOperationOnZFail = convertedValue;
645 SetStencilOperationOnZFailMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
649 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
651 StencilOperation::Type convertedValue = mStencilParameters.stencilOperationOnZPass;
652 if(Scripting::GetEnumerationProperty<StencilOperation::Type>(propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue))
654 mStencilParameters.stencilOperationOnZPass = convertedValue;
655 SetStencilOperationOnZPassMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
659 case Dali::DevelRenderer::Property::OPACITY:
662 if(propertyValue.Get(opacity))
664 if(!Equals(mOpacity, opacity))
667 BakeOpacityMessage(GetEventThreadServices(), GetRendererSceneObject(), mOpacity);
672 case DevelRenderer::Property::RENDERING_BEHAVIOR:
674 DevelRenderer::Rendering::Type convertedValue = mRenderingBehavior;
675 if(Scripting::GetEnumerationProperty<DevelRenderer::Rendering::Type>(propertyValue, RENDERING_BEHAVIOR_TABLE, RENDERING_BEHAVIOR_TABLE_COUNT, convertedValue))
677 mRenderingBehavior = convertedValue;
678 SetRenderingBehaviorMessage(GetEventThreadServices(), GetRendererSceneObject(), convertedValue);
685 Property::Value Renderer::GetDefaultProperty(Property::Index index) const
687 Property::Value value;
689 if(!GetCachedPropertyValue(index, value))
691 // If property value is not stored in the event-side, then it must be a scene-graph only property
692 GetCurrentPropertyValue(index, value);
698 Property::Value Renderer::GetDefaultPropertyCurrentValue(Property::Index index) const
700 Property::Value value;
702 if(!GetCurrentPropertyValue(index, value))
704 // If unable to retrieve scene-graph property value, then it must be an event-side only property
705 GetCachedPropertyValue(index, value);
711 void Renderer::OnNotifyDefaultPropertyAnimation(Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType)
713 switch(animationType)
716 case Animation::BETWEEN:
720 case Dali::DevelRenderer::Property::OPACITY:
733 case Dali::DevelRenderer::Property::OPACITY:
735 AdjustValue<float>(mOpacity, value);
744 const SceneGraph::PropertyBase* Renderer::GetSceneObjectAnimatableProperty(Property::Index index) const
746 const SceneGraph::PropertyBase* property = nullptr;
748 if(index == DevelRenderer::Property::OPACITY)
750 property = &GetRendererSceneObject().mOpacity;
754 // not our property, ask base
755 property = Object::GetSceneObjectAnimatableProperty(index);
761 const PropertyInputImpl* Renderer::GetSceneObjectInputProperty(Property::Index index) const
763 // reuse animatable property getter, Object::GetSceneObjectInputProperty does the same so no need to call that0
764 return GetSceneObjectAnimatableProperty(index);
767 void Renderer::AddDrawCommand(const Dali::DevelRenderer::DrawCommand& command)
769 if(!mDrawCommands.capacity())
771 mDrawCommands.reserve(8);
774 mDrawCommands.emplace_back(command);
776 Dali::Internal::SceneGraph::SetDrawCommandsMessage(GetEventThreadServices(),
777 GetRendererSceneObject(),
778 mDrawCommands.data(),
779 uint32_t(mDrawCommands.size())
784 Renderer::Renderer(const SceneGraph::Renderer* sceneObject)
785 : Object(sceneObject),
787 mIndexedDrawFirstElement(0),
788 mIndexedDrawElementCount(0),
789 mStencilParameters(RenderMode::AUTO, StencilFunction::ALWAYS, 0xFF, 0x00, 0xFF, StencilOperation::KEEP, StencilOperation::KEEP, StencilOperation::KEEP),
792 mDepthFunction(DepthFunction::LESS),
793 mFaceCullingMode(FaceCullingMode::NONE),
794 mBlendMode(BlendMode::AUTO),
795 mDepthWriteMode(DepthWriteMode::AUTO),
796 mDepthTestMode(DepthTestMode::AUTO),
797 mRenderingBehavior(DevelRenderer::Rendering::IF_REQUIRED),
798 mPremultipledAlphaEnabled(false)
802 Renderer::~Renderer()
804 if(EventThreadServices::IsCoreRunning())
806 EventThreadServices& eventThreadServices = GetEventThreadServices();
807 SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
808 RemoveRendererMessage(updateManager, SceneGraph::Renderer::GetKey(GetRendererSceneObject())); //@todo Use key throughtout
810 eventThreadServices.UnregisterObject(this);
814 bool Renderer::GetCachedPropertyValue(Property::Index index, Property::Value& value) const
816 bool valueSet = true;
820 case Dali::Renderer::Property::DEPTH_INDEX:
822 value = GetDepthIndex();
825 case Dali::Renderer::Property::FACE_CULLING_MODE:
827 value = mFaceCullingMode;
830 case Dali::Renderer::Property::BLEND_MODE:
835 case Dali::DevelRenderer::Property::BLEND_EQUATION:
837 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationRgb());
840 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
842 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationRgb());
845 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
847 value = static_cast<int32_t>(mBlendingOptions.GetBlendEquationAlpha());
850 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
852 BlendFactor::Type srcFactorRgb;
853 BlendFactor::Type destFactorRgb;
854 BlendFactor::Type srcFactorAlpha;
855 BlendFactor::Type destFactorAlpha;
856 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
857 value = static_cast<int32_t>(srcFactorRgb);
860 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
862 BlendFactor::Type srcFactorRgb;
863 BlendFactor::Type destFactorRgb;
864 BlendFactor::Type srcFactorAlpha;
865 BlendFactor::Type destFactorAlpha;
866 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
867 value = static_cast<int32_t>(destFactorRgb);
870 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
872 BlendFactor::Type srcFactorRgb;
873 BlendFactor::Type destFactorRgb;
874 BlendFactor::Type srcFactorAlpha;
875 BlendFactor::Type destFactorAlpha;
876 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
877 value = static_cast<int32_t>(srcFactorAlpha);
880 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
882 BlendFactor::Type srcFactorRgb;
883 BlendFactor::Type destFactorRgb;
884 BlendFactor::Type srcFactorAlpha;
885 BlendFactor::Type destFactorAlpha;
886 GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
887 value = static_cast<int32_t>(destFactorAlpha);
890 case Dali::Renderer::Property::BLEND_COLOR:
892 value = GetBlendColor();
895 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
897 value = IsPreMultipliedAlphaEnabled();
900 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
902 value = static_cast<int32_t>(mIndexedDrawFirstElement);
905 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
907 value = static_cast<int32_t>(mIndexedDrawElementCount);
910 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
912 value = mDepthWriteMode;
915 case Dali::Renderer::Property::DEPTH_FUNCTION:
917 value = mDepthFunction;
920 case Dali::Renderer::Property::DEPTH_TEST_MODE:
922 value = mDepthTestMode;
925 case Dali::Renderer::Property::STENCIL_FUNCTION:
927 value = mStencilParameters.stencilFunction;
930 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
932 value = mStencilParameters.stencilFunctionMask;
935 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
937 value = mStencilParameters.stencilFunctionReference;
940 case Dali::Renderer::Property::STENCIL_MASK:
942 value = mStencilParameters.stencilMask;
945 case Dali::Renderer::Property::RENDER_MODE:
947 value = mStencilParameters.renderMode;
950 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
952 value = mStencilParameters.stencilOperationOnFail;
955 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
957 value = mStencilParameters.stencilOperationOnZFail;
960 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
962 value = mStencilParameters.stencilOperationOnZPass;
965 case Dali::DevelRenderer::Property::OPACITY:
970 case Dali::DevelRenderer::Property::RENDERING_BEHAVIOR:
972 value = mRenderingBehavior;
977 // Must be a scene-graph only property
986 bool Renderer::GetCurrentPropertyValue(Property::Index index, Property::Value& value) const
988 bool valueSet = true;
989 const SceneGraph::Renderer& sceneObject = GetRendererSceneObject();
993 case Dali::Renderer::Property::DEPTH_INDEX:
995 value = sceneObject.GetDepthIndex();
998 case Dali::Renderer::Property::FACE_CULLING_MODE:
1000 value = sceneObject.GetFaceCullingMode();
1003 case Dali::Renderer::Property::BLEND_MODE:
1005 value = sceneObject.GetBlendMode();
1008 case Dali::DevelRenderer::Property::BLEND_EQUATION:
1010 uint32_t bitMask = sceneObject.GetBlendingOptions();
1011 BlendingOptions blendingOptions;
1012 blendingOptions.SetBitmask(bitMask);
1013 value = static_cast<int32_t>(blendingOptions.GetBlendEquationRgb());
1016 case Dali::Renderer::Property::BLEND_EQUATION_RGB:
1018 uint32_t bitMask = sceneObject.GetBlendingOptions();
1019 BlendingOptions blendingOptions;
1020 blendingOptions.SetBitmask(bitMask);
1021 value = static_cast<int32_t>(blendingOptions.GetBlendEquationRgb());
1024 case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
1026 uint32_t bitMask = sceneObject.GetBlendingOptions();
1027 BlendingOptions blendingOptions;
1028 blendingOptions.SetBitmask(bitMask);
1029 value = static_cast<int32_t>(blendingOptions.GetBlendEquationAlpha());
1032 case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
1034 uint32_t bitMask = sceneObject.GetBlendingOptions();
1035 BlendingOptions blendingOptions;
1036 blendingOptions.SetBitmask(bitMask);
1037 value = static_cast<int32_t>(blendingOptions.GetBlendSrcFactorRgb());
1040 case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
1042 uint32_t bitMask = sceneObject.GetBlendingOptions();
1043 BlendingOptions blendingOptions;
1044 blendingOptions.SetBitmask(bitMask);
1045 value = static_cast<int32_t>(blendingOptions.GetBlendDestFactorRgb());
1048 case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
1050 uint32_t bitMask = sceneObject.GetBlendingOptions();
1051 BlendingOptions blendingOptions;
1052 blendingOptions.SetBitmask(bitMask);
1053 value = static_cast<int32_t>(blendingOptions.GetBlendSrcFactorAlpha());
1056 case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
1058 uint32_t bitMask = sceneObject.GetBlendingOptions();
1059 BlendingOptions blendingOptions;
1060 blendingOptions.SetBitmask(bitMask);
1061 value = static_cast<int32_t>(blendingOptions.GetBlendDestFactorAlpha());
1064 case Dali::Renderer::Property::BLEND_COLOR:
1066 value = sceneObject.GetBlendColor();
1069 case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
1071 value = sceneObject.IsPreMultipliedAlphaEnabled();
1074 case Dali::Renderer::Property::INDEX_RANGE_FIRST:
1076 value = static_cast<int32_t>(sceneObject.GetIndexedDrawFirstElement());
1079 case Dali::Renderer::Property::INDEX_RANGE_COUNT:
1081 value = static_cast<int32_t>(sceneObject.GetIndexedDrawElementsCount());
1084 case Dali::Renderer::Property::DEPTH_WRITE_MODE:
1086 value = sceneObject.GetDepthWriteMode();
1089 case Dali::Renderer::Property::DEPTH_FUNCTION:
1091 value = sceneObject.GetDepthFunction();
1094 case Dali::Renderer::Property::DEPTH_TEST_MODE:
1096 value = sceneObject.GetDepthTestMode();
1099 case Dali::Renderer::Property::STENCIL_FUNCTION:
1101 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1102 value = stencilParameters.stencilFunction;
1105 case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
1107 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1108 value = stencilParameters.stencilFunctionMask;
1111 case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
1113 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1114 value = stencilParameters.stencilFunctionReference;
1117 case Dali::Renderer::Property::STENCIL_MASK:
1119 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1120 value = stencilParameters.stencilMask;
1123 case Dali::Renderer::Property::RENDER_MODE:
1125 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1126 value = stencilParameters.renderMode;
1129 case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
1131 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1132 value = stencilParameters.stencilOperationOnFail;
1135 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
1137 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1138 value = stencilParameters.stencilOperationOnZFail;
1141 case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
1143 Render::Renderer::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
1144 value = stencilParameters.stencilOperationOnZPass;
1147 case Dali::DevelRenderer::Property::OPACITY:
1149 value = sceneObject.GetOpacity(GetEventThreadServices().GetEventBufferIndex());
1152 case Dali::DevelRenderer::Property::RENDERING_BEHAVIOR:
1154 value = sceneObject.GetRenderingBehavior();
1159 // Must be an event-side only property
1168 void Renderer::SetBlendColor(const Vector4& blendColor)
1170 mBlendingOptions.SetBlendColor(blendColor);
1171 SetBlendColorMessage(GetEventThreadServices(), GetRendererSceneObject(), GetBlendColor());
1174 const Vector4& Renderer::GetBlendColor() const
1176 const Vector4* blendColor = mBlendingOptions.GetBlendColor();
1181 return Color::TRANSPARENT; // GL default
1184 void Renderer::SetRenderCallback(RenderCallback* callback)
1186 Dali::Internal::SceneGraph::SetRenderCallbackMessage(GetEventThreadServices(),
1187 GetRendererSceneObject(),
1191 } // namespace Internal