Fix compile error. Non initialized variable.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / shadow-view / shadow-view-impl.h
index aa10428..1cc97ca 100644 (file)
@@ -1,29 +1,34 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SHADOW_VIEW_H__
-#define __DALI_TOOLKIT_INTERNAL_SHADOW_VIEW_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_SHADOW_VIEW_H
+#define DALI_TOOLKIT_INTERNAL_SHADOW_VIEW_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 <sstream>
 #include <cmath>
+#include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/animation/constraints.h>
+#include <dali/public-api/render-tasks/render-task.h>
+#include <dali/public-api/object/property-map.h>
 
 // INTERNAL INCLUDES
-#include <dali/dali.h>
-#include <dali-toolkit/public-api/controls/shadow-view/shadow-view.h>
+#include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/internal/filters/blur-two-pass-filter.h>
 
@@ -41,7 +46,7 @@ namespace Internal
 /**
  * ShadowView implementation class
  */
-class ShadowView : public ControlImpl
+class ShadowView : public Control
 {
 public:
 
@@ -66,19 +71,9 @@ public:
   static Dali::Toolkit::ShadowView New(float downsampleWidthScale, float downsampleHeightScale);
 
   /**
-   * @copydoc Dali::Toolkit::ShadowView::Add(Actor child)
-   */
-  void Add(Actor child);
-
-  /**
-   * @copydoc Dali::Toolkit::ShadowView::Remove(Actor child)
-   */
-  void Remove(Actor child);
-
-  /**
-   * @copydoc Dali::Toolkit::ShadowView::SetShadowPlane(Actor shadowPlane)
+   * @copydoc Dali::Toolkit::ShadowView::SetShadowPlaneBackground(Actor shadowPlaneBackground)
    */
-  void SetShadowPlane(Actor shadowPlane);
+  void SetShadowPlaneBackground(Actor shadowPlaneBackground);
 
   /**
    * @copydoc Dali::Toolkit::ShadowView::SetPointLight(Actor pointLight)
@@ -120,9 +115,16 @@ public:
 private:
 
   virtual void OnInitialize();
-  virtual void OnSizeSet(const Vector3& targetSize);
-  virtual void OnStageConnection();
-  virtual void OnStageDisconnection();
+
+  /**
+   * @copydoc Control::OnChildAdd()
+   */
+  virtual void OnChildAdd( Actor& child );
+
+  /**
+   * @copydoc Control::OnChildRemove()
+   */
+  virtual void OnChildRemove( Actor& child );
 
   /**
    * Constrain the camera actor to the position of the point light, pointing
@@ -135,23 +137,22 @@ private:
   void CreateBlurFilter();
 
 private:
-  ImageActor mShadowPlane; // Shadow renders into this actor
+  Actor mShadowPlane; // Shadow renders into this actor
   Actor mShadowPlaneBg; // mShadowPlane renders directly in front of this actor
   Actor mPointLight;  // Shadow is cast from this point light
 
   /////////////////////////////////////////////////////////////
-  FrameBufferImage mSceneFromLightRenderTarget;  // for rendering normal scene seen from light to texture instead of the screen
+  FrameBuffer mSceneFromLightRenderTarget;  // for rendering normal scene seen from light to texture instead of the screen
 
-  FrameBufferImage mOutputImage;
+  FrameBuffer mOutputFrameBuffer;
 
   Actor mChildrenRoot; // Subtree for all user added child actors that should be rendered normally
   Actor mBlurRootActor; // Root actor for blur filter processing
-  ImageActor mShadowPlaneDrawable; // Positioned on top of mShadowPlane for drawing shadow image
   RenderTask mRenderSceneTask;
 
   CameraActor mCameraActor; // Constrained to same position as mPointLight and pointing at mShadowPlane
 
-  ShaderEffect mShadowRenderShader;
+  Property::Map mShadowVisualMap;
   BlurTwoPassFilter mBlurFilter;
 
   Vector4 mCachedShadowColor;                               ///< Cached Shadow color.
@@ -196,4 +197,4 @@ inline const Toolkit::Internal::ShadowView& GetImpl( const Toolkit::ShadowView&
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_SHADOW_VIEW_H__
+#endif // DALI_TOOLKIT_INTERNAL_SHADOW_VIEW_H