From: Ferran Sole Date: Wed, 27 Jul 2016 13:21:46 +0000 (+0100) Subject: Changes following dali-core patch "Wrapped ShaderHints enum inside a struct" X-Git-Tag: dali_1.1.45~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce9f965e8f8f51ae0992a85db9fd919519992a65;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Changes following dali-core patch "Wrapped ShaderHints enum inside a struct" Change-Id: I08d3017b3e66ce4741dd32876f52b569874129b3 --- diff --git a/dali-toolkit/internal/text/rendering/vector-based/glyphy-shader/glyphy-shader.cpp b/dali-toolkit/internal/text/rendering/vector-based/glyphy-shader/glyphy-shader.cpp index 556a902..71d3f19 100644 --- a/dali-toolkit/internal/text/rendering/vector-based/glyphy-shader/glyphy-shader.cpp +++ b/dali-toolkit/internal/text/rendering/vector-based/glyphy-shader/glyphy-shader.cpp @@ -221,7 +221,7 @@ GlyphyShader GlyphyShader::New( const Dali::Vector4& atlasInfo ) Shader shaderEffectCustom = Shader::New( vertexShaderStringStream.str(), fragmentShaderStringStream.str(), - Shader::ShaderHints( Shader::HINT_OUTPUT_IS_TRANSPARENT ) ); + Shader::Hint::OUTPUT_IS_TRANSPARENT ); GlyphyShader handle( shaderEffectCustom ); diff --git a/dali-toolkit/internal/text/text-scroller.cpp b/dali-toolkit/internal/text/text-scroller.cpp index d1a5d2f..b3c56de 100644 --- a/dali-toolkit/internal/text/text-scroller.cpp +++ b/dali-toolkit/internal/text/text-scroller.cpp @@ -166,7 +166,7 @@ void CreateGeometry( Geometry& geometry ) */ void CreateRenderer( FrameBufferImage frameBufferImage, Dali::Renderer& renderer ) { - Shader shader = Shader::New( VERTEX_SHADER_SCROLL , FRAGMENT_SHADER, Shader::HINT_NONE ); + Shader shader = Shader::New( VERTEX_SHADER_SCROLL , FRAGMENT_SHADER, Shader::Hint::NONE ); Sampler sampler = Sampler::New(); sampler.SetFilterMode(FilterMode::NEAREST, FilterMode::NEAREST ); diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index 89fc8ea..fa37422 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -324,7 +324,7 @@ Shader NPatchVisual::CreateShader() else { const char* fragmentShader = FRAGMENT_SHADER; - Dali::Shader::ShaderHints hints = Dali::Shader::HINT_NONE; + Dali::Shader::Hint::Value hints = Dali::Shader::Hint::NONE; if( !mImpl->mCustomShader->mFragmentShader.empty() ) { diff --git a/dali-toolkit/internal/visuals/visual-data-impl.cpp b/dali-toolkit/internal/visuals/visual-data-impl.cpp index 23f4242..319c825 100644 --- a/dali-toolkit/internal/visuals/visual-data-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-data-impl.cpp @@ -46,31 +46,31 @@ const char * const CUSTOM_SHADER_HINTS( "hints" ); ///< type STRING for a hint f /** * where hints should be contain strings of the following shader hints: - * "none" | corresponds to HINT_NONE - * "outputIsTransparent" | corresponds to HINT_OUTPUT_IS_TRANSPARENT - * "modifiesGeometry" | corresponds to HINT_MODIFIES_GEOMETRY + * "none" | corresponds to Shader::Hint::NONE + * "outputIsTransparent" | corresponds to Shader::Hint::OUTPUT_IS_TRANSPARENT + * "modifiesGeometry" | corresponds to Shader::Hint::MODIFIES_GEOMETRY */ -Shader::ShaderHints HintFromString( std::string hintString ) +Shader::Hint::Value HintFromString( std::string hintString ) { if( hintString == "none" ) { - return Shader::HINT_NONE; + return Shader::Hint::NONE; } else if( hintString == "outputIsTransparent" ) { - return Shader::HINT_OUTPUT_IS_TRANSPARENT; + return Shader::Hint::OUTPUT_IS_TRANSPARENT; } else if( hintString == "modifiesGeometry" ) { - return Shader::HINT_MODIFIES_GEOMETRY; + return Shader::Hint::MODIFIES_GEOMETRY; } else { DALI_LOG_ERROR( "'%s' hint string is not recognised", hintString.c_str() ); } - return Shader::HINT_NONE; + return Shader::Hint::NONE; } }// unnamed namespace @@ -89,7 +89,7 @@ Internal::Visual::Impl::~Impl() Internal::Visual::Impl::CustomShader::CustomShader( const Property::Map& map ) : mGridSize( 1, 1 ), - mHints( Shader::HINT_NONE ) + mHints( Shader::Hint::NONE ) { SetPropertyMap( map ); } @@ -99,7 +99,7 @@ void Internal::Visual::Impl::CustomShader::SetPropertyMap( const Property::Map& mVertexShader.clear(); mFragmentShader.clear(); mGridSize = ImageDimensions( 1, 1 ); - mHints = Shader::HINT_NONE; + mHints = Shader::Hint::NONE; Property::Value* vertexShaderValue = shaderMap.Find( CUSTOM_VERTEX_SHADER ); if( vertexShaderValue ) @@ -159,7 +159,7 @@ void Internal::Visual::Impl::CustomShader::SetPropertyMap( const Property::Map& } else if( hintsValue->Get( hintsArray ) ) { - int hints = Shader::HINT_NONE; + int hints = Shader::Hint::NONE; for( Property::Array::SizeType i = 0; i < hintsArray.Count(); ++i) { Property::Value hintValue = hintsArray[ i ]; @@ -172,7 +172,7 @@ void Internal::Visual::Impl::CustomShader::SetPropertyMap( const Property::Map& DALI_LOG_ERROR( "'%s' parameter does not correctly specify an hint string at index %d", CUSTOM_SHADER_HINTS, i ); } - mHints = static_cast< Shader::ShaderHints >( hints ); + mHints = static_cast< Shader::Hint::Value >( hints ); } } else @@ -205,7 +205,7 @@ void Internal::Visual::Impl::CustomShader::CreatePropertyMap( Property::Map& map customShader.Insert(CUSTOM_SUBDIVIDE_GRID_Y, mGridSize.GetHeight() ); } - if( mHints != Dali::Shader::HINT_NONE ) + if( mHints != Dali::Shader::Hint::NONE ) { customShader.Insert(CUSTOM_SHADER_HINTS, static_cast< int >(mHints) ); } diff --git a/dali-toolkit/internal/visuals/visual-data-impl.h b/dali-toolkit/internal/visuals/visual-data-impl.h index eabdb37..fa700c5 100644 --- a/dali-toolkit/internal/visuals/visual-data-impl.h +++ b/dali-toolkit/internal/visuals/visual-data-impl.h @@ -49,7 +49,7 @@ struct Internal::Visual::Impl std::string mVertexShader; std::string mFragmentShader; Dali::ImageDimensions mGridSize; - Dali::Shader::ShaderHints mHints; //(bitfield) values from enum Shader::Hints + Dali::Shader::Hint::Value mHints; //(bitfield) values from enum Shader::Hint CustomShader( const Property::Map& map ); void SetPropertyMap( const Property::Map& map ); diff --git a/dali-toolkit/internal/visuals/visual-impl.cpp b/dali-toolkit/internal/visuals/visual-impl.cpp index f0c1f50..46ef92d 100644 --- a/dali-toolkit/internal/visuals/visual-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-impl.cpp @@ -33,7 +33,7 @@ const char * const CUSTOM_VERTEX_SHADER( "vertexShader" ); const char * const CUSTOM_FRAGMENT_SHADER( "fragmentShader" ); const char * const CUSTOM_SUBDIVIDE_GRID_X( "subdivideGridX" ); const char * const CUSTOM_SUBDIVIDE_GRID_Y( "subdivideGridY" ); -const char * const CUSTOM_SHADER_HINTS( "hints" ); ///< type INTEGER; (bitfield) values from enum Shader::Hints +const char * const CUSTOM_SHADER_HINTS( "hints" ); ///< type INTEGER; (bitfield) values from enum Shader::Hint } namespace Dali diff --git a/plugins/dali-script-v8/src/rendering/shader-api.cpp b/plugins/dali-script-v8/src/rendering/shader-api.cpp index 1da9691..38ba059 100644 --- a/plugins/dali-script-v8/src/rendering/shader-api.cpp +++ b/plugins/dali-script-v8/src/rendering/shader-api.cpp @@ -69,13 +69,13 @@ typedef std::vector< std::string > HintsArray; struct ShaderHintPair { const char* name; - Shader::ShaderHints hint; + Shader::Hint::Value hint; }; const ShaderHintPair ShaderHintTable[]= { - {"outputIsTransparent", Shader::HINT_OUTPUT_IS_TRANSPARENT }, - {"modifiesGeometry", Shader::HINT_MODIFIES_GEOMETRY }, + {"outputIsTransparent", Shader::Hint::OUTPUT_IS_TRANSPARENT }, + {"modifiesGeometry", Shader::Hint::MODIFIES_GEOMETRY }, }; const unsigned int ShaderHintTableCount = sizeof(ShaderHintTable)/sizeof(ShaderHintTable[0]); @@ -83,11 +83,11 @@ const unsigned int ShaderHintTableCount = sizeof(ShaderHintTable)/sizeof(ShaderH struct ShaderParameters { ShaderParameters() - : mHints( Shader::HINT_NONE ) + : mHints( Shader::Hint::NONE ) { } - Shader::ShaderHints GetShaderHint( const std::string& hint ) + Shader::Hint::Value GetShaderHint( const std::string& hint ) { for( unsigned int i = 0 ; i < ShaderHintTableCount; ++i ) { @@ -96,14 +96,14 @@ struct ShaderParameters return ShaderHintTable[i].hint; } } - return Shader::HINT_NONE; + return Shader::Hint::NONE; } void ProcessHintsArray( const HintsArray& hintsArray ) { for( HintsArray::const_iterator iter = hintsArray.begin(); iter != hintsArray.end() ; ++iter ) { - mHints= static_cast( mHints | GetShaderHint( *iter ) ); + mHints= static_cast( mHints | GetShaderHint( *iter ) ); } } @@ -116,7 +116,7 @@ struct ShaderParameters std::string mVertex; std::string mFragment; - Shader::ShaderHints mHints; + Shader::Hint::Value mHints; }; } // unnamed space