Add null check for mTextureSet.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / filters / blur-two-pass-filter.h
index 8c6f53b..8ff681a 100644 (file)
@@ -1,26 +1,27 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H__
-#define __DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H__
-
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+#ifndef DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H
+#define DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H
+
+/*
+ * Copyright (c) 2019 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/render-tasks/render-task.h>
 
 // INTERNAL INCLUDES
-#include <dali/dali.h>
 #include "image-filter.h"
 
 namespace Dali
@@ -51,13 +52,16 @@ public:
 
 public: // From ImageFilter
   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Enable
-  virtual void Enable();
+  void Enable() override;
 
   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Disable
-  virtual void Disable();
+  void Disable() override;
 
   /// @copydoc Dali::Toolkit::Internal::ImageFilter::Refresh
-  virtual void Refresh();
+  void Refresh() override;
+
+  /// @copydoc Dali::Toolkit::Internal::ImageFilter::SetSize
+  void SetSize( const Vector2& size ) override;
 
   /**
    * Get the property index that controls the strength of the blur applied to the image. Useful for animating this property.
@@ -66,16 +70,12 @@ public: // From ImageFilter
   Property::Index GetBlurStrengthPropertyIndex() const {return mBlurStrengthPropertyIndex;}
 
   /**
-   * Retrieve the constrainable object to animate or constrain the blur strength property
-   * @return the constrainable object which blend the output image according to the blur strength
+   * Retrieve the handle to the object in order to animate or constrain the blur strength property
+   * @return The hadnle to the object which blends the output image according to the blur strength
    */
-  Constrainable GetHandleForAnimateBlurStrength();
+  Handle GetHandleForAnimateBlurStrength();
 
 private:
-  /**
-   * Setup position and parameters for camera
-   */
-  void SetupCamera();
 
   /**
    * Setup render tasks for blur
@@ -88,26 +88,21 @@ private:
 
 private: // Attributes
 
-  CameraActor      mCameraForBlur;
-
-  // To perform horizontal blur from mInputImage to mImageForHorz
-  RenderTask       mRenderTaskForHorz;
-  ImageActor       mActorForInput;
-  FrameBufferImage mImageForHorz;
-  ShaderEffect     mShaderForHorz;
+  // To perform horizontal blur from mInputTexture to mFrameBufferForHorz
+  RenderTask         mRenderTaskForHorz;
+  Actor              mActorForInput;
+  FrameBuffer        mFrameBufferForHorz;
 
-  // To perform vertical blur from mImageForHorz to mOutputImage
-  RenderTask       mRenderTaskForVert;
-  ImageActor       mActorForHorz;
-  ShaderEffect     mShaderForVert;
-  FrameBufferImage mBlurredImage;
+  // To perform vertical blur from mFrameBufferForHorz to mOutputFrameBuffer
+  RenderTask         mRenderTaskForVert;
+  Actor              mActorForHorz;
+  FrameBuffer        mBlurredFrameBuffer;
 
   // To blend the blurred image and input image according to the blur strength
-  RenderTask       mRenderTaskForBlending;
-  ImageActor       mActorForBlending;
-  Actor            mRootActorForBlending;
-  ShaderEffect     mShaderForBlending;
-  Property::Index  mBlurStrengthPropertyIndex;
+  RenderTask         mRenderTaskForBlending;
+  Actor              mActorForBlending;
+  Actor              mRootActorForBlending;
+  Property::Index    mBlurStrengthPropertyIndex;
 
 }; // class BlurTwoPassFilter
 
@@ -117,5 +112,5 @@ private: // Attributes
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H__
+#endif // DALI_TOOLKIT_INTERNAL_BLUR_TWO_PASS_FILTER_H