X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Frendering%2Frenderer-impl.cpp;h=2b80191bbe8e3e6ceeb80b87ea0bf1586707e9d5;hb=b08d7b5d2cf90794ac88e71e667f2e6bbbf85923;hp=9e5567c4d75c79e373358a09d7d2acfabbcff88d;hpb=1ce3d69e13024fe8724b9c7231a3dfa724c154fc;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/rendering/renderer-impl.cpp b/dali/internal/event/rendering/renderer-impl.cpp index 9e5567c..2b80191 100644 --- a/dali/internal/event/rendering/renderer-impl.cpp +++ b/dali/internal/event/rendering/renderer-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,12 +20,12 @@ // INTERNAL INCLUDES #include -#include // Dali::Renderer #include // Dali::Internal::ObjectHelper #include // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END #include #include #include +#include namespace Dali { @@ -41,16 +41,30 @@ namespace DALI_PROPERTY_TABLE_BEGIN DALI_PROPERTY( "depthIndex", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_INDEX ) DALI_PROPERTY( "faceCullingMode", INTEGER, true, false, false, Dali::Renderer::Property::FACE_CULLING_MODE ) -DALI_PROPERTY( "blendingMode", INTEGER, true, false, false, Dali::Renderer::Property::BLENDING_MODE ) +DALI_PROPERTY( "blendMode", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_MODE ) DALI_PROPERTY( "blendEquationRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_EQUATION_RGB ) DALI_PROPERTY( "blendEquationAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_EQUATION_ALPHA ) -DALI_PROPERTY( "sourceBlendFactorRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLENDING_SRC_FACTOR_RGB ) -DALI_PROPERTY( "destinationBlendFactorRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLENDING_DEST_FACTOR_RGB ) -DALI_PROPERTY( "sourceBlendFactorAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLENDING_SRC_FACTOR_ALPHA ) -DALI_PROPERTY( "destinationBlendFactorAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLENDING_DEST_FACTOR_ALPHA ) -DALI_PROPERTY( "blendingColor", VECTOR4, true, false, false, Dali::Renderer::Property::BLENDING_COLOR ) +DALI_PROPERTY( "blendFactorSrcRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB ) +DALI_PROPERTY( "blendFactorDestRgb", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB ) +DALI_PROPERTY( "blendFactorSrcAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA ) +DALI_PROPERTY( "blendFactorDestAlpha", INTEGER, true, false, false, Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA ) +DALI_PROPERTY( "blendColor", VECTOR4, true, false, false, Dali::Renderer::Property::BLEND_COLOR ) DALI_PROPERTY( "blendPreMultipliedAlpha", BOOLEAN, true, false, false, Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA ) -DALI_PROPERTY_TABLE_END( DEFAULT_OBJECT_PROPERTY_START_INDEX ) +DALI_PROPERTY( "indexRangeFirst", INTEGER, true, false, false, Dali::Renderer::Property::INDEX_RANGE_FIRST ) +DALI_PROPERTY( "indexRangeCount", INTEGER, true, false, false, Dali::Renderer::Property::INDEX_RANGE_COUNT ) +DALI_PROPERTY( "depthWriteMode", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_WRITE_MODE ) +DALI_PROPERTY( "depthFunction", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_FUNCTION ) +DALI_PROPERTY( "depthTestMode", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_TEST_MODE ) +DALI_PROPERTY( "stencilFunction", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION ) +DALI_PROPERTY( "stencilFunctionMask", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION_MASK ) +DALI_PROPERTY( "stencilFunctionReference", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE ) +DALI_PROPERTY( "stencilMask", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_MASK ) +DALI_PROPERTY( "stencilMode", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_MODE ) +DALI_PROPERTY( "stencilOperationOnFail", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL ) +DALI_PROPERTY( "stencilOperationOnZFail", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL ) +DALI_PROPERTY( "stencilOperationOnZPass", INTEGER, true, false, false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS ) +DALI_PROPERTY( "writeToColorBuffer", BOOLEAN, true, false, false, Dali::Renderer::Property::WRITE_TO_COLOR_BUFFER ) +DALI_PROPERTY_TABLE_END( DEFAULT_RENDERER_PROPERTY_START_INDEX ) const ObjectImplHelper RENDERER_IMPL = { DEFAULT_PROPERTY_DETAILS }; @@ -72,27 +86,39 @@ RendererPtr Renderer::New() void Renderer::SetGeometry( Geometry& geometry ) { - mGeometryConnector.Set( geometry, OnStage() ); - const SceneGraph::Geometry* geometrySceneObject = geometry.GetGeometrySceneObject(); + mGeometry = &geometry; + const Render::Geometry* geometrySceneObject = geometry.GetRenderObject(); SetGeometryMessage( GetEventThreadServices(), *mSceneObject, *geometrySceneObject ); } Geometry* Renderer::GetGeometry() const { - return mGeometryConnector.Get().Get(); + return mGeometry.Get(); } -void Renderer::SetMaterial( Material& material ) +void Renderer::SetTextures( TextureSet& textureSet ) { - mMaterialConnector.Set( material, OnStage() ); - const SceneGraph::Material* materialSceneObject = material.GetMaterialSceneObject(); - SetMaterialMessage( GetEventThreadServices(), *mSceneObject, *materialSceneObject ); + mTextureSetConnector.Set( textureSet, OnStage() ); + const SceneGraph::TextureSet* textureSetSceneObject = textureSet.GetTextureSetSceneObject(); + SetTexturesMessage( GetEventThreadServices(), *mSceneObject, *textureSetSceneObject ); } -Material* Renderer::GetMaterial() const +TextureSet* Renderer::GetTextures() const { - return mMaterialConnector.Get().Get(); + return mTextureSetConnector.Get().Get(); +} + +void Renderer::SetShader( Shader& shader ) +{ + mShader = &shader; + SceneGraph::Shader& sceneGraphShader = *shader.GetShaderSceneObject(); + SceneGraph::SetShaderMessage( GetEventThreadServices(), *mSceneObject, sceneGraphShader ); +} + +Shader* Renderer::GetShader() const +{ + return mShader.Get(); } void Renderer::SetDepthIndex( int depthIndex ) @@ -109,7 +135,7 @@ int Renderer::GetDepthIndex() const return mDepthIndex; } -void Renderer::SetFaceCullingMode( Dali::Renderer::FaceCullingMode cullingMode ) +void Renderer::SetFaceCullingMode( FaceCullingMode::Type cullingMode ) { if( mFaceCullingMode != cullingMode ) { @@ -119,45 +145,45 @@ void Renderer::SetFaceCullingMode( Dali::Renderer::FaceCullingMode cullingMode ) } } -Dali::Renderer::FaceCullingMode Renderer::GetFaceCullingMode() +FaceCullingMode::Type Renderer::GetFaceCullingMode() { return mFaceCullingMode; } -void Renderer::SetBlendMode( BlendingMode::Type mode ) +void Renderer::SetBlendMode( BlendMode::Type mode ) { - if( mBlendingMode != mode ) + if( mBlendMode != mode ) { - mBlendingMode = mode; + mBlendMode = mode; - SetBlendingModeMessage( GetEventThreadServices(), *mSceneObject, mBlendingMode ); + SetBlendModeMessage( GetEventThreadServices(), *mSceneObject, mBlendMode ); } } -BlendingMode::Type Renderer::GetBlendMode() const +BlendMode::Type Renderer::GetBlendMode() const { - return mBlendingMode; + return mBlendMode; } -void Renderer::SetBlendFunc( BlendingFactor::Type srcFactorRgba, BlendingFactor::Type destFactorRgba ) +void Renderer::SetBlendFunc( BlendFactor::Type srcFactorRgba, BlendFactor::Type destFactorRgba ) { mBlendingOptions.SetBlendFunc( srcFactorRgba, destFactorRgba, srcFactorRgba, destFactorRgba ); SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() ); } -void Renderer::SetBlendFunc( BlendingFactor::Type srcFactorRgb, - BlendingFactor::Type destFactorRgb, - BlendingFactor::Type srcFactorAlpha, - BlendingFactor::Type destFactorAlpha ) +void Renderer::SetBlendFunc( BlendFactor::Type srcFactorRgb, + BlendFactor::Type destFactorRgb, + BlendFactor::Type srcFactorAlpha, + BlendFactor::Type destFactorAlpha ) { mBlendingOptions.SetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha ); SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() ); } -void Renderer::GetBlendFunc( BlendingFactor::Type& srcFactorRgb, - BlendingFactor::Type& destFactorRgb, - BlendingFactor::Type& srcFactorAlpha, - BlendingFactor::Type& destFactorAlpha ) const +void Renderer::GetBlendFunc( BlendFactor::Type& srcFactorRgb, + BlendFactor::Type& destFactorRgb, + BlendFactor::Type& srcFactorAlpha, + BlendFactor::Type& destFactorAlpha ) const { srcFactorRgb = mBlendingOptions.GetBlendSrcFactorRgb(); destFactorRgb = mBlendingOptions.GetBlendDestFactorRgb(); @@ -165,21 +191,21 @@ void Renderer::GetBlendFunc( BlendingFactor::Type& srcFactorRgb, destFactorAlpha = mBlendingOptions.GetBlendDestFactorAlpha(); } -void Renderer::SetBlendEquation( BlendingEquation::Type equationRgba ) +void Renderer::SetBlendEquation( BlendEquation::Type equationRgba ) { mBlendingOptions.SetBlendEquation( equationRgba, equationRgba ); SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() ); } -void Renderer::SetBlendEquation( BlendingEquation::Type equationRgb, - BlendingEquation::Type equationAlpha ) +void Renderer::SetBlendEquation( BlendEquation::Type equationRgb, + BlendEquation::Type equationAlpha ) { mBlendingOptions.SetBlendEquation( equationRgb, equationAlpha ); SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() ); } -void Renderer::GetBlendEquation( BlendingEquation::Type& equationRgb, - BlendingEquation::Type& equationAlpha ) const +void Renderer::GetBlendEquation( BlendEquation::Type& equationRgb, + BlendEquation::Type& equationAlpha ) const { // These are not animatable, the cached values are up-to-date. equationRgb = mBlendingOptions.GetBlendEquationRgb(); @@ -208,13 +234,32 @@ Vector4 Renderer::GetBlendColor() const return Color::TRANSPARENT; // GL default } +void Renderer::SetIndexedDrawFirstElement( size_t firstElement ) +{ + if( firstElement != mIndexedDrawFirstElement ) + { + mIndexedDrawFirstElement = firstElement; + SetIndexedDrawFirstElementMessage( GetEventThreadServices(), *mSceneObject, mIndexedDrawFirstElement ); + } +} + +void Renderer::SetIndexedDrawElementsCount( size_t elementsCount ) +{ + if( elementsCount != mIndexedDrawElementCount ) + { + mIndexedDrawElementCount = elementsCount; + SetIndexedDrawElementsCountMessage( GetEventThreadServices(), *mSceneObject, mIndexedDrawElementCount ); + } +} + + void Renderer::EnablePreMultipliedAlpha( bool preMultipled ) { if( mPremultipledAlphaEnabled != preMultipled ) { if( preMultipled ) { - SetBlendFunc( BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA, BlendingFactor::ONE, BlendingFactor::ONE ); + SetBlendFunc( BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE ); } mPremultipledAlphaEnabled = preMultipled; SetEnablePreMultipliedAlphaMessage( GetEventThreadServices(), *mSceneObject, mPremultipledAlphaEnabled ); @@ -286,16 +331,16 @@ void Renderer::SetDefaultProperty( Property::Index index, int faceCullingMode; if( propertyValue.Get( faceCullingMode ) ) { - SetFaceCullingMode( Dali::Renderer::FaceCullingMode( faceCullingMode ) ); + SetFaceCullingMode( FaceCullingMode::Type( faceCullingMode ) ); } break; } - case Dali::Renderer::Property::BLENDING_MODE: + case Dali::Renderer::Property::BLEND_MODE: { int blendingMode; if( propertyValue.Get( blendingMode ) ) { - SetBlendMode( BlendingMode::Type( blendingMode ) ); + SetBlendMode( BlendMode::Type( blendingMode ) ); } break; } @@ -304,8 +349,8 @@ void Renderer::SetDefaultProperty( Property::Index index, int blendingEquation; if( propertyValue.Get( blendingEquation ) ) { - BlendingEquation::Type alphaEquation = mBlendingOptions.GetBlendEquationAlpha(); - mBlendingOptions.SetBlendEquation( static_cast( blendingEquation ), alphaEquation ); + BlendEquation::Type alphaEquation = mBlendingOptions.GetBlendEquationAlpha(); + mBlendingOptions.SetBlendEquation( static_cast( blendingEquation ), alphaEquation ); SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() ); } break; @@ -315,81 +360,81 @@ void Renderer::SetDefaultProperty( Property::Index index, int blendingEquation; if( propertyValue.Get( blendingEquation ) ) { - BlendingEquation::Type rgbEquation = mBlendingOptions.GetBlendEquationRgb(); - mBlendingOptions.SetBlendEquation( rgbEquation, static_cast( blendingEquation ) ); + BlendEquation::Type rgbEquation = mBlendingOptions.GetBlendEquationRgb(); + mBlendingOptions.SetBlendEquation( rgbEquation, static_cast( blendingEquation ) ); SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() ); } break; } - case Dali::Renderer::Property::BLENDING_SRC_FACTOR_RGB: + case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB: { int blendingFactor; if( propertyValue.Get( blendingFactor ) ) { - BlendingFactor::Type srcFactorRgb; - BlendingFactor::Type destFactorRgb; - BlendingFactor::Type srcFactorAlpha; - BlendingFactor::Type destFactorAlpha; + BlendFactor::Type srcFactorRgb; + BlendFactor::Type destFactorRgb; + BlendFactor::Type srcFactorAlpha; + BlendFactor::Type destFactorAlpha; GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha ); - SetBlendFunc( static_cast( blendingFactor ), + SetBlendFunc( static_cast( blendingFactor ), destFactorRgb, srcFactorAlpha, destFactorAlpha ); } break; } - case Dali::Renderer::Property::BLENDING_DEST_FACTOR_RGB: + case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB: { int blendingFactor; if( propertyValue.Get( blendingFactor ) ) { - BlendingFactor::Type srcFactorRgb; - BlendingFactor::Type destFactorRgb; - BlendingFactor::Type srcFactorAlpha; - BlendingFactor::Type destFactorAlpha; + BlendFactor::Type srcFactorRgb; + BlendFactor::Type destFactorRgb; + BlendFactor::Type srcFactorAlpha; + BlendFactor::Type destFactorAlpha; GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha ); SetBlendFunc( srcFactorRgb, - static_cast( blendingFactor ), + static_cast( blendingFactor ), srcFactorAlpha, destFactorAlpha ); } break; } - case Dali::Renderer::Property::BLENDING_SRC_FACTOR_ALPHA: + case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA: { int blendingFactor; if( propertyValue.Get( blendingFactor ) ) { - BlendingFactor::Type srcFactorRgb; - BlendingFactor::Type destFactorRgb; - BlendingFactor::Type srcFactorAlpha; - BlendingFactor::Type destFactorAlpha; + BlendFactor::Type srcFactorRgb; + BlendFactor::Type destFactorRgb; + BlendFactor::Type srcFactorAlpha; + BlendFactor::Type destFactorAlpha; GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha ); SetBlendFunc( srcFactorRgb, destFactorRgb, - static_cast( blendingFactor ), + static_cast( blendingFactor ), destFactorAlpha ); } break; } - case Dali::Renderer::Property::BLENDING_DEST_FACTOR_ALPHA: + case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA: { int blendingFactor; if( propertyValue.Get( blendingFactor ) ) { - BlendingFactor::Type srcFactorRgb; - BlendingFactor::Type destFactorRgb; - BlendingFactor::Type srcFactorAlpha; - BlendingFactor::Type destFactorAlpha; + BlendFactor::Type srcFactorRgb; + BlendFactor::Type destFactorRgb; + BlendFactor::Type srcFactorAlpha; + BlendFactor::Type destFactorAlpha; GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha ); SetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, - static_cast( blendingFactor ) ); + static_cast( blendingFactor ) ); } break; } - case Dali::Renderer::Property::BLENDING_COLOR: + case Dali::Renderer::Property::BLEND_COLOR: { Vector4 blendColor; if( propertyValue.Get( blendColor ) ) @@ -407,6 +452,64 @@ void Renderer::SetDefaultProperty( Property::Index index, } break; } + case Dali::Renderer::Property::INDEX_RANGE_FIRST: + { + int firstElement; + if( propertyValue.Get( firstElement ) ) + { + SetIndexedDrawFirstElement( firstElement ); + } + break; + } + case Dali::Renderer::Property::INDEX_RANGE_COUNT: + { + int elementsCount; + if( propertyValue.Get( elementsCount ) ) + { + SetIndexedDrawElementsCount( elementsCount ); + } + break; + } + case Dali::Renderer::Property::DEPTH_WRITE_MODE: + { + int value; + propertyValue.Get( value ); + DepthWriteMode::Type mode = static_cast(value); + if( mode != mDepthWriteMode ) + { + mDepthWriteMode = mode; + SetDepthWriteModeMessage( GetEventThreadServices(), *mSceneObject, mode ); + } + break; + } + case Dali::Renderer::Property::DEPTH_FUNCTION: + { + int value; + propertyValue.Get( value ); + DepthFunction::Type depthFunction = static_cast(value); + if( depthFunction != mDepthFunction ) + { + mDepthFunction = depthFunction; + SetDepthFunctionMessage( GetEventThreadServices(), *mSceneObject, depthFunction ); + } + break; + } + case Dali::Renderer::Property::DEPTH_TEST_MODE: + { + int value; + propertyValue.Get( value ); + DepthTestMode::Type mode = static_cast(value); + if( mode != mDepthTestMode ) + { + mDepthTestMode = mode; + SetDepthTestModeMessage( GetEventThreadServices(), *mSceneObject, mode ); + } + break; + } + default: + { + break; + } } } @@ -433,9 +536,9 @@ Property::Value Renderer::GetDefaultProperty( Property::Index index ) const value = mFaceCullingMode; break; } - case Dali::Renderer::Property::BLENDING_MODE: + case Dali::Renderer::Property::BLEND_MODE: { - value = mBlendingMode; + value = mBlendMode; break; } case Dali::Renderer::Property::BLEND_EQUATION_RGB: @@ -448,47 +551,47 @@ Property::Value Renderer::GetDefaultProperty( Property::Index index ) const value = static_cast( mBlendingOptions.GetBlendEquationAlpha() ); break; } - case Dali::Renderer::Property::BLENDING_SRC_FACTOR_RGB: + case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB: { - BlendingFactor::Type srcFactorRgb; - BlendingFactor::Type destFactorRgb; - BlendingFactor::Type srcFactorAlpha; - BlendingFactor::Type destFactorAlpha; + BlendFactor::Type srcFactorRgb; + BlendFactor::Type destFactorRgb; + BlendFactor::Type srcFactorAlpha; + BlendFactor::Type destFactorAlpha; GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha ); value = static_cast( srcFactorRgb ); break; } - case Dali::Renderer::Property::BLENDING_DEST_FACTOR_RGB: + case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB: { - BlendingFactor::Type srcFactorRgb; - BlendingFactor::Type destFactorRgb; - BlendingFactor::Type srcFactorAlpha; - BlendingFactor::Type destFactorAlpha; + BlendFactor::Type srcFactorRgb; + BlendFactor::Type destFactorRgb; + BlendFactor::Type srcFactorAlpha; + BlendFactor::Type destFactorAlpha; GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha ); value = static_cast( destFactorRgb ); break; } - case Dali::Renderer::Property::BLENDING_SRC_FACTOR_ALPHA: + case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA: { - BlendingFactor::Type srcFactorRgb; - BlendingFactor::Type destFactorRgb; - BlendingFactor::Type srcFactorAlpha; - BlendingFactor::Type destFactorAlpha; + BlendFactor::Type srcFactorRgb; + BlendFactor::Type destFactorRgb; + BlendFactor::Type srcFactorAlpha; + BlendFactor::Type destFactorAlpha; GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha ); value = static_cast( srcFactorAlpha ); break; } - case Dali::Renderer::Property::BLENDING_DEST_FACTOR_ALPHA: + case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA: { - BlendingFactor::Type srcFactorRgb; - BlendingFactor::Type destFactorRgb; - BlendingFactor::Type srcFactorAlpha; - BlendingFactor::Type destFactorAlpha; + BlendFactor::Type srcFactorRgb; + BlendFactor::Type destFactorRgb; + BlendFactor::Type srcFactorAlpha; + BlendFactor::Type destFactorAlpha; GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha ); value = static_cast( destFactorAlpha ); break; } - case Dali::Renderer::Property::BLENDING_COLOR: + case Dali::Renderer::Property::BLEND_COLOR: { if( mBlendColor ) { @@ -505,6 +608,31 @@ Property::Value Renderer::GetDefaultProperty( Property::Index index ) const value = IsPreMultipliedAlphaEnabled(); break; } + case Dali::Renderer::Property::INDEX_RANGE_FIRST: + { + value = static_cast( mIndexedDrawFirstElement ); + break; + } + case Dali::Renderer::Property::INDEX_RANGE_COUNT: + { + value = static_cast( mIndexedDrawElementCount ); + break; + } + case Dali::Renderer::Property::DEPTH_WRITE_MODE: + { + value = mDepthWriteMode; + break; + } + case Dali::Renderer::Property::DEPTH_FUNCTION: + { + value = mDepthFunction; + break; + } + case Dali::Renderer::Property::DEPTH_TEST_MODE: + { + value = mDepthTestMode; + break; + } } return value; } @@ -567,9 +695,7 @@ void Renderer::Connect() { if( mOnStageCount == 0 ) { - OnStageConnectMessage( GetEventThreadServices(), *mSceneObject ); - mGeometryConnector.OnStageConnect(); - mMaterialConnector.OnStageConnect(); + mTextureSetConnector.OnStageConnect(); } ++mOnStageCount; } @@ -579,20 +705,23 @@ void Renderer::Disconnect() --mOnStageCount; if( mOnStageCount == 0 ) { - OnStageDisconnectMessage( GetEventThreadServices(), *mSceneObject); - mGeometryConnector.OnStageDisconnect(); - mMaterialConnector.OnStageDisconnect(); + mTextureSetConnector.OnStageDisconnect(); } } Renderer::Renderer() -: mSceneObject(NULL), +: mSceneObject (NULL ), mBlendColor( NULL ), - mDepthIndex(0), - mOnStageCount(0), - mFaceCullingMode(Dali::Renderer::NONE), - mBlendingMode( Dali::BlendingMode::AUTO ), + mDepthIndex( 0 ), + mOnStageCount( 0 ), + mIndexedDrawFirstElement( 0 ), + mIndexedDrawElementCount( 0 ), + mFaceCullingMode( FaceCullingMode::NONE ), + mBlendMode( BlendMode::AUTO ), mBlendingOptions(), + mDepthWriteMode( DepthWriteMode::AUTO ), + mDepthFunction( DepthFunction::LESS ), + mDepthTestMode( DepthTestMode::AUTO ), mPremultipledAlphaEnabled( false ) { }