Add null check for mTextureSet.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / filters / blur-two-pass-filter.cpp
index 5dabfb7..e870650 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <sstream>
 #include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/rendering/renderer.h>
@@ -140,8 +140,8 @@ void BlurTwoPassFilter::Enable()
 
   // create actor to render input with applied emboss effect
   mActorForInput = Actor::New();
-  mActorForInput.SetParentOrigin( ParentOrigin::CENTER );
-  mActorForInput.SetSize( mTargetSize );
+  mActorForInput.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  mActorForInput.SetProperty( Actor::Property::SIZE, mTargetSize );
   Renderer rendererForInput = CreateRenderer( BASIC_VERTEX_SOURCE, fragmentSource.c_str() );
   SetRendererTexture( rendererForInput, mInputTexture );
   mActorForInput.AddRenderer( rendererForInput );
@@ -153,8 +153,8 @@ void BlurTwoPassFilter::Enable()
 
   // create an actor to render mImageForHorz for vertical blur pass
   mActorForHorz = Actor::New();
-  mActorForHorz.SetParentOrigin( ParentOrigin::CENTER );
-  mActorForHorz.SetSize( mTargetSize );
+  mActorForHorz.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  mActorForHorz.SetProperty( Actor::Property::SIZE, mTargetSize );
   Renderer rendererForHorz = CreateRenderer( BASIC_VERTEX_SOURCE, fragmentSource.c_str() );
   SetRendererTexture( rendererForHorz, textureForHorz );
   mActorForHorz.AddRenderer( rendererForHorz );
@@ -170,8 +170,8 @@ void BlurTwoPassFilter::Enable()
   textureSetForBlending.SetTexture( 0u, blurredTexture );
   textureSetForBlending.SetTexture( 1u, mInputTexture );
   mActorForBlending.AddRenderer( rendererForBlending );
-  mActorForBlending.SetParentOrigin( ParentOrigin::CENTER );
-  mActorForBlending.SetSize( mTargetSize );
+  mActorForBlending.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  mActorForBlending.SetProperty( Actor::Property::SIZE, mTargetSize );
 
   for( int i = 0; i < kernelSize; ++i )
   {
@@ -257,15 +257,15 @@ void BlurTwoPassFilter::SetSize( const Vector2& size )
   mTargetSize = size;
   if( mActorForInput )
   {
-    mActorForInput.SetSize(mTargetSize);
+    mActorForInput.SetProperty( Actor::Property::SIZE, mTargetSize);
   }
   if( mActorForHorz )
   {
-    mActorForHorz.SetSize(mTargetSize);
+    mActorForHorz.SetProperty( Actor::Property::SIZE, mTargetSize);
   }
   if( mActorForBlending )
   {
-    mActorForBlending.SetSize(mTargetSize);
+    mActorForBlending.SetProperty( Actor::Property::SIZE, mTargetSize);
   }
 }