X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffilters%2Femboss-filter.cpp;h=4bb7c3036c3441e23c5522b858cf32de32a550d4;hb=1de507cb9f77667b67b269abfe25769205c9817e;hp=c96d1bc15eccc92a51e9aa0fb4885055521a45fa;hpb=8ddb15f9e047abe0f51f803f5418bcb9d22a821d;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 c96d1bc..4bb7c30 100644 --- a/dali-toolkit/internal/filters/emboss-filter.cpp +++ b/dali-toolkit/internal/filters/emboss-filter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 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. @@ -24,8 +24,13 @@ #include #include #include -#include -#include +#include +#include + +// INTERNAL INCLUDES +#include +#include +#include namespace Dali { @@ -89,9 +94,9 @@ void EmbossFilter::Enable() mImageForEmboss2 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Image::UNUSED ); 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); @@ -101,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); @@ -110,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(); @@ -118,22 +123,25 @@ 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(); - textureSet1.SetImage( 0, mImageForEmboss1 ); + TextureSetImage( textureSet1, 0, mImageForEmboss1 ); mActorForComposite.GetRendererAt(0).SetTextures( textureSet1 ); mActorForComposite.GetRendererAt(0).RegisterProperty( COLOR_UNIFORM_NAME, Color::BLACK ); TextureSet textureSet2 = TextureSet::New(); - textureSet2.SetImage( 0, mImageForEmboss2 ); + TextureSetImage( textureSet2, 0, mImageForEmboss2 ); mActorForComposite.GetRendererAt(1).SetTextures( textureSet2 ); mActorForComposite.GetRendererAt(1).RegisterProperty( COLOR_UNIFORM_NAME, Color::WHITE ); @@ -165,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(); }