2 * Copyright (c) 2020 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/public-api/object/type-registry.h>
24 #include <dali/internal/event/common/property-helper.h> // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
25 #include <dali/internal/event/common/property-input-impl.h>
26 #include <dali/internal/render/renderers/render-geometry.h>
27 #include <dali/internal/update/manager/update-manager.h>
28 #include <dali/internal/update/rendering/scene-graph-renderer.h>
39 * Properties: |name |type |writable|animatable|constraint-input|enum for index-checking|
41 DALI_PROPERTY_TABLE_BEGIN
42 DALI_PROPERTY( "depthIndex", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_INDEX )
43 DALI_PROPERTY( "faceCullingMode", INTEGER, true, false, false, Dali::Renderer::Property::FACE_CULLING_MODE )
44 DALI_PROPERTY( "blendMode", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_MODE )
45 DALI_PROPERTY( "blendEquationRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_EQUATION_RGB )
46 DALI_PROPERTY( "blendEquationAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_EQUATION_ALPHA )
47 DALI_PROPERTY( "blendFactorSrcRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB )
48 DALI_PROPERTY( "blendFactorDestRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB )
49 DALI_PROPERTY( "blendFactorSrcAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA )
50 DALI_PROPERTY( "blendFactorDestAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA )
51 DALI_PROPERTY( "blendColor", VECTOR4, true, false, false, Dali::Renderer::Property::BLEND_COLOR )
52 DALI_PROPERTY( "blendPreMultipliedAlpha", BOOLEAN, true, false, false, Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA )
53 DALI_PROPERTY( "indexRangeFirst", INTEGER, true, false, false, Dali::Renderer::Property::INDEX_RANGE_FIRST )
54 DALI_PROPERTY( "indexRangeCount", INTEGER, true, false, false, Dali::Renderer::Property::INDEX_RANGE_COUNT )
55 DALI_PROPERTY( "depthWriteMode", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_WRITE_MODE )
56 DALI_PROPERTY( "depthFunction", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_FUNCTION )
57 DALI_PROPERTY( "depthTestMode", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_TEST_MODE )
58 DALI_PROPERTY( "renderMode", INTEGER, true, false, false, Dali::Renderer::Property::RENDER_MODE )
59 DALI_PROPERTY( "stencilFunction", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION )
60 DALI_PROPERTY( "stencilFunctionMask", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION_MASK )
61 DALI_PROPERTY( "stencilFunctionReference", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE )
62 DALI_PROPERTY( "stencilMask", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_MASK )
63 DALI_PROPERTY( "stencilOperationOnFail", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL )
64 DALI_PROPERTY( "stencilOperationOnZFail", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL )
65 DALI_PROPERTY( "stencilOperationOnZPass", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS )
66 DALI_PROPERTY( "opacity", FLOAT, true, true, true, Dali::DevelRenderer::Property::OPACITY )
67 DALI_PROPERTY( "renderingBehavior", INTEGER, true, false, false, Dali::DevelRenderer::Property::RENDERING_BEHAVIOR )
68 DALI_PROPERTY( "blendEquation", INTEGER, true, false, false, Dali::DevelRenderer::Property::BLEND_EQUATION )
69 DALI_PROPERTY_TABLE_END( DEFAULT_RENDERER_PROPERTY_START_INDEX, RendererDefaultProperties )
71 // Property string to enumeration tables:
73 DALI_ENUM_TO_STRING_TABLE_BEGIN( FACE_CULLING_MODE )
74 DALI_ENUM_TO_STRING_WITH_SCOPE( FaceCullingMode, NONE )
75 DALI_ENUM_TO_STRING_WITH_SCOPE( FaceCullingMode, FRONT )
76 DALI_ENUM_TO_STRING_WITH_SCOPE( FaceCullingMode, BACK )
77 DALI_ENUM_TO_STRING_WITH_SCOPE( FaceCullingMode, FRONT_AND_BACK )
78 DALI_ENUM_TO_STRING_TABLE_END( FACE_CULLING_MODE )
80 DALI_ENUM_TO_STRING_TABLE_BEGIN( BLEND_MODE )
81 DALI_ENUM_TO_STRING_WITH_SCOPE( BlendMode, OFF )
82 DALI_ENUM_TO_STRING_WITH_SCOPE( BlendMode, AUTO )
83 DALI_ENUM_TO_STRING_WITH_SCOPE( BlendMode, ON )
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 sceneObject = SceneGraph::Renderer::New();
198 OwnerPointer< SceneGraph::Renderer > transferOwnership( sceneObject );
199 // pass the pointer to base for message passing
200 RendererPtr rendererPtr( new Renderer( sceneObject ) );
201 // transfer scene object ownership to update manager
202 EventThreadServices& eventThreadServices = rendererPtr->GetEventThreadServices();
203 SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
204 AddRendererMessage( updateManager, transferOwnership );
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 );
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 BakeOpacityMessage( GetEventThreadServices(), GetRendererSceneObject(), mOpacity );
673 case DevelRenderer::Property::RENDERING_BEHAVIOR:
675 DevelRenderer::Rendering::Type convertedValue = mRenderingBehavior;
676 if( Scripting::GetEnumerationProperty< DevelRenderer::Rendering::Type >( propertyValue, RENDERING_BEHAVIOR_TABLE, RENDERING_BEHAVIOR_TABLE_COUNT, convertedValue ) )
678 mRenderingBehavior = convertedValue;
679 SetRenderingBehaviorMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
686 Property::Value Renderer::GetDefaultProperty( Property::Index index ) const
688 Property::Value value;
690 if( ! GetCachedPropertyValue( index, value ) )
692 // If property value is not stored in the event-side, then it must be a scene-graph only property
693 GetCurrentPropertyValue( index, value );
699 Property::Value Renderer::GetDefaultPropertyCurrentValue( Property::Index index ) const
701 Property::Value value;
703 if( ! GetCurrentPropertyValue( index, value ) )
705 // If unable to retrieve scene-graph property value, then it must be an event-side only property
706 GetCachedPropertyValue( index, value );
712 void Renderer::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType )
714 switch( animationType )
717 case Animation::BETWEEN:
721 case Dali::DevelRenderer::Property::OPACITY:
723 value.Get( mOpacity );
734 case Dali::DevelRenderer::Property::OPACITY:
736 AdjustValue< float >( mOpacity, value );
745 const SceneGraph::PropertyBase* Renderer::GetSceneObjectAnimatableProperty( Property::Index index ) const
747 const SceneGraph::PropertyBase* property = nullptr;
749 if( index == DevelRenderer::Property::OPACITY )
751 property = &GetRendererSceneObject().mOpacity;
755 // not our property, ask base
756 property = Object::GetSceneObjectAnimatableProperty( index );
762 const PropertyInputImpl* Renderer::GetSceneObjectInputProperty( Property::Index index ) const
764 // reuse animatable property getter, Object::GetSceneObjectInputProperty does the same so no need to call that0
765 return GetSceneObjectAnimatableProperty( index );
768 Renderer::Renderer( const SceneGraph::Renderer* sceneObject )
769 : Object( sceneObject ),
771 mIndexedDrawFirstElement( 0 ),
772 mIndexedDrawElementCount( 0 ),
773 mStencilParameters( RenderMode::AUTO, StencilFunction::ALWAYS, 0xFF, 0x00, 0xFF, StencilOperation::KEEP, StencilOperation::KEEP, StencilOperation::KEEP ),
776 mDepthFunction( DepthFunction::LESS ),
777 mFaceCullingMode( FaceCullingMode::NONE ),
778 mBlendMode( BlendMode::AUTO ),
779 mDepthWriteMode( DepthWriteMode::AUTO ),
780 mDepthTestMode( DepthTestMode::AUTO ),
781 mRenderingBehavior( DevelRenderer::Rendering::IF_REQUIRED ),
782 mPremultipledAlphaEnabled( false )
786 void Renderer::SetBlendColor( const Vector4& blendColor )
788 mBlendingOptions.SetBlendColor( blendColor );
789 SetBlendColorMessage( GetEventThreadServices(), GetRendererSceneObject(), GetBlendColor() );
792 const Vector4& Renderer::GetBlendColor() const
794 const Vector4* blendColor = mBlendingOptions.GetBlendColor();
799 return Color::TRANSPARENT; // GL default
802 Renderer::~Renderer()
804 if( EventThreadServices::IsCoreRunning() )
806 EventThreadServices& eventThreadServices = GetEventThreadServices();
807 SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
808 RemoveRendererMessage( updateManager, GetRendererSceneObject() );
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::AddDrawCommand( const Dali::DevelRenderer::DrawCommand& command )
1170 if(!mDrawCommands.capacity())
1172 mDrawCommands.reserve(8);
1175 mDrawCommands.emplace_back( command );
1177 Dali::Internal::SceneGraph::SetDrawCommandsMessage( GetEventThreadServices(),
1178 GetRendererSceneObject(),
1179 mDrawCommands.data(),
1180 uint32_t(mDrawCommands.size())
1186 } // namespace Internal