Merge "Alignment: To use default copy constructor in the constraints" into tizen
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / internal / controls / bubble-effect / bubble-emitter-impl.h
index a7e868d..30ed0a0 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/actors/mesh-actor.h>
+#include <dali/public-api/common/stage.h>
+#include <dali/public-api/images/frame-buffer-image.h>
+#include <dali/public-api/geometry/mesh.h>
+#include <dali/public-api/render-tasks/render-task.h>
+
 // INTERNAL INCLUDES
-#include <dali/dali.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.h>
 #include <dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.h>
@@ -38,7 +46,7 @@ namespace Internal
 /**
  * BubbleEmitter implementation class.
  */
-class BubbleEmitter : public ControlImpl
+class BubbleEmitter : public Control
 {
 public:
 
@@ -127,6 +135,11 @@ private:
   void OnRenderFinished(RenderTask& source);
 
   /**
+   * Callback function from Stage to tell us if the context has been regained.
+   */
+  void OnContextRegained();
+
+  /**
    * Generate the material object which is attached to the meshActor to describe its color, texture, texture mapping mode etc.
    */
   void GenMaterial();
@@ -199,6 +212,8 @@ private:
   unsigned int                mNumBubblePerShader;  ///< How many bubbles for each BubbleEffect shader.
   unsigned int                mNumShader;           ///< How many BubbleEffect shaders are used.
   unsigned int                mTotalNumOfBubble;    ///< mNumBubblePerShader*mNumShader.
+  bool                        mRenderTaskRunning;   ///< If the background render task is currently running
+
   Vector2                     mBubbleSizeRange;     ///< The bubble size range.
 
   std::vector<Mesh>           mMesh;                ///< The mesh vector, each mesh is used to create a meshActor which applies a BubbleEffect.
@@ -211,6 +226,8 @@ private:
 
   unsigned int                mCurrentUniform;      ///< Keep track of the uniform index for the newly emitted bubble
 
+  Vector3                     mHSVDelta;            ///< The HSV difference used to adjust the background image color.
+  Image                       mBackgroundImage;     ///< The original background image
   FrameBufferImage            mEffectImage;         ///< The image stores the adjusted color of the background image.The bubbles pick color from this image.
   CameraActor                 mCameraActor;         ///< The render task views the scene from the perspective of this actor.