X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffilters%2Femboss-filter.cpp;h=b27455829734f6e0ea6ba0b05ea6d4d124d94286;hb=refs%2Fchanges%2F49%2F88249%2F1;hp=275292ca77615645efce47a534ec2672d8f9301a;hpb=05d9f7a25bd9f4320a0e1fece8ec0ede819afe7d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/filters/emboss-filter.cpp b/dali-toolkit/internal/filters/emboss-filter.cpp index 275292c..b274558 100644 --- a/dali-toolkit/internal/filters/emboss-filter.cpp +++ b/dali-toolkit/internal/filters/emboss-filter.cpp @@ -24,11 +24,13 @@ #include #include #include +#include #include -#include // INTERNAL INCLUDES -#include +#include +#include +#include namespace Dali { @@ -88,13 +90,13 @@ EmbossFilter::~EmbossFilter() void EmbossFilter::Enable() { - mImageForEmboss1 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::UNUSED ); - mImageForEmboss2 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::UNUSED ); + mImageForEmboss1 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat ); + mImageForEmboss2 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat ); Property::Map customShader; - customShader[ "fragmentShader" ] = EMBOSS_FRAGMENT_SOURCE; - Property::Map rendererMap; - rendererMap.Insert( "shader", customShader ); + customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = EMBOSS_FRAGMENT_SOURCE; + Property::Map visualMap; + visualMap.Insert( Toolkit::Visual::Property::SHADER, customShader ); // create actor to render input with applied emboss effect mActorForInput1 = Toolkit::ImageView::New(mInputImage); @@ -104,7 +106,7 @@ void EmbossFilter::Enable() mActorForInput1.RegisterProperty( TEX_SCALE_UNIFORM_NAME, textureScale ); mActorForInput1.RegisterProperty( COEFFICIENT_UNIFORM_NAME, Vector3( 2.f, -1.f, -1.f ) ); // set EMBOSS custom shader - mActorForInput1.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap ); + mActorForInput1.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap ); mRootActor.Add( mActorForInput1 ); mActorForInput2 = Toolkit::ImageView::New(mInputImage); @@ -113,7 +115,7 @@ void EmbossFilter::Enable() mActorForInput2.RegisterProperty( TEX_SCALE_UNIFORM_NAME, textureScale ); mActorForInput2.RegisterProperty( COEFFICIENT_UNIFORM_NAME, Vector3( -1.f, -1.f, 2.f ) ); // set EMBOSS custom shader - mActorForInput2.SetProperty( Toolkit::ImageView::Property::IMAGE, rendererMap ); + mActorForInput2.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap ); mRootActor.Add( mActorForInput2 ); mActorForComposite = Actor::New(); @@ -121,14 +123,17 @@ void EmbossFilter::Enable() mActorForComposite.SetSize(mTargetSize); mActorForComposite.SetColor( Color::BLACK ); - customShader[ "fragmentShader" ] = COMPOSITE_FRAGMENT_SOURCE; - rendererMap[ "shader"] = customShader; - rendererMap[ "rendererType"] = "image"; + customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = COMPOSITE_FRAGMENT_SOURCE; mRootActor.Add( mActorForComposite ); - InitializeControlRenderer( mActorForComposite, mRendererForEmboss1, rendererMap ); - InitializeControlRenderer( mActorForComposite, mRendererForEmboss2, rendererMap ); + Image dummyImage; // Dummy image, force creation of an image visual + + InitializeVisual( mActorForComposite, mVisualForEmboss1, dummyImage ); + Toolkit::GetImplementation( mVisualForEmboss1 ).SetCustomShader( customShader ); + + InitializeVisual( mActorForComposite, mVisualForEmboss2, dummyImage ); + Toolkit::GetImplementation( mVisualForEmboss2 ).SetCustomShader( customShader ); TextureSet textureSet1 = TextureSet::New(); TextureSetImage( textureSet1, 0, mImageForEmboss1 ); @@ -168,10 +173,10 @@ void EmbossFilter::Disable() if( mActorForComposite ) { - mRendererForEmboss1.SetOffStage( mActorForComposite ); - mRendererForEmboss2.SetOffStage( mActorForComposite ); - mRendererForEmboss1.Reset(); - mRendererForEmboss2.Reset(); + mVisualForEmboss1.SetOffStage( mActorForComposite ); + mVisualForEmboss2.SetOffStage( mActorForComposite ); + mVisualForEmboss1.Reset(); + mVisualForEmboss2.Reset(); mRootActor.Remove( mActorForComposite ); mActorForComposite.Reset(); }