/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
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( "batchingEnabled", BOOLEAN, true, false, false, Dali::DevelRenderer::Property::BATCHING_ENABLED )
DALI_PROPERTY_TABLE_END( DEFAULT_RENDERER_PROPERTY_START_INDEX )
// Property string to enumeration tables:
equationAlpha = mBlendingOptions.GetBlendEquationAlpha();
}
-void Renderer::SetBlendColor( const Vector4& color )
-{
- if( !mBlendColor )
- {
- mBlendColor = new Vector4();
- }
- if( *mBlendColor != color )
- {
- *mBlendColor = color;
- SetBlendColorMessage( GetEventThreadServices(), *mSceneObject, *mBlendColor );
- }
-}
-
-Vector4 Renderer::GetBlendColor() const
-{
- if( mBlendColor )
- {
- return *mBlendColor;
- }
- return Color::TRANSPARENT; // GL default
-}
-
void Renderer::SetIndexedDrawFirstElement( size_t firstElement )
{
if( firstElement != mIndexedDrawFirstElement )
return mPremultipledAlphaEnabled;
}
-bool Renderer::IsBatchingEnabled() const
-{
- return mBatchingEnabled;
-}
-
SceneGraph::Renderer* Renderer::GetRendererSceneObject()
{
return mSceneObject;
}
break;
}
- case Dali::DevelRenderer::Property::BATCHING_ENABLED:
- {
- bool enabled;
- if( propertyValue.Get( enabled ) )
- {
- if( mBatchingEnabled != enabled )
- {
- mBatchingEnabled = enabled;
- SetBatchingEnabledMessage( GetEventThreadServices(), *mSceneObject, mBatchingEnabled );
- }
- }
- break;
- }
}
}
}
case Dali::Renderer::Property::BLEND_COLOR:
{
- if( mBlendColor )
- {
- value = *mBlendColor;
- }
- else
- {
- value = Color::TRANSPARENT;
- }
+ value = GetBlendColor();
break;
}
case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
value = mDepthWriteMode;
break;
}
- case Dali::DevelRenderer::Property::BATCHING_ENABLED:
- {
- value = mBatchingEnabled;
- break;
- }
case Dali::Renderer::Property::DEPTH_FUNCTION:
{
value = mDepthFunction;
Renderer::Renderer()
: mSceneObject(NULL ),
- mBlendColor( NULL ),
mDepthIndex( 0 ),
mIndexedDrawFirstElement( 0 ),
mIndexedDrawElementCount( 0 ),
mBlendMode( BlendMode::AUTO ),
mDepthWriteMode( DepthWriteMode::AUTO ),
mDepthTestMode( DepthTestMode::AUTO ),
- mPremultipledAlphaEnabled( false ),
- mBatchingEnabled( false )
+ mPremultipledAlphaEnabled( false )
{
}
eventThreadServices.RegisterObject( this );
}
+void Renderer::SetBlendColor( const Vector4& blendColor )
+{
+ mBlendingOptions.SetBlendColor( blendColor );
+ SetBlendColorMessage( GetEventThreadServices(), *mSceneObject, GetBlendColor() );
+}
+
+const Vector4& Renderer::GetBlendColor() const
+{
+ const Vector4* blendColor = mBlendingOptions.GetBlendColor();
+ if( blendColor )
+ {
+ return *blendColor;
+ }
+ return Color::TRANSPARENT; // GL default
+}
+
Renderer::~Renderer()
{
if( EventThreadServices::IsCoreRunning() )