X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbubble-effect%2Fbubble-emitter-impl.h;h=e6879ae947d706d696bfdaec6058a7a0165f41ce;hb=HEAD;hp=cbc1fc37baabff9f512c630afc018876f01b5d06;hpb=3ef357cc431d17b7be772f0f74acb080feab123e;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h index cbc1fc3..df0c0f7 100644 --- a/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h +++ b/dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H__ -#define __DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H__ +#ifndef DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H +#define DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -19,31 +19,27 @@ */ // EXTERNAL INCLUDES +#include #include -#include -#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // INTERNAL INCLUDES -#include #include +#include namespace Dali { - namespace Toolkit { - namespace Internal { - -class BubbleActor; -typedef IntrusivePtr BubbleActorPtr; +class BubbleRenderer; /** * BubbleEmitter implementation class. @@ -51,7 +47,6 @@ typedef IntrusivePtr BubbleActorPtr; class BubbleEmitter : public Control { public: - /** * Destructor */ @@ -60,10 +55,10 @@ public: /** * @copydoc Toolkit::BubbleEmitter::New */ - static Toolkit::BubbleEmitter New( const Vector2& winSize, - Image shapeImage, - unsigned int maximumNumberOfBubble, - const Vector2& bubbleSizeRange ); + static Toolkit::BubbleEmitter New(const Vector2& winSize, + Texture shapeTexture, + unsigned int maximumNumberOfBubble, + const Vector2& bubbleSizeRange); /** * @copydoc Toolkit::BubbleEmitter::GetRootActor @@ -73,27 +68,27 @@ public: /** * @copydoc Toolkit::BubbleEmitter::SetBackground */ - void SetBackground( Image bgImage, const Vector3& hsvDelta ); + void SetBackground(Texture bgTexture, const Vector3& hsvDelta); /** - * @copydoc Toolkit::BubbleEmitter::SetShapeImage + * @copydoc Toolkit::BubbleEmitter::SetShape */ - void SetShapeImage( Image shapeImage ); + void SetBubbleShape(Texture shapeTexture); /** * @copydoc Toolkit::BubbleEmiter::SetBubbleScale */ - void SetBubbleScale( float scale ); + void SetBubbleScale(float scale); /** * @copydoc Toolkit::BubbleEmitter::SetBubbleDensity */ - void SetBubbleDensity( unsigned int density ); + void SetBubbleDensity(unsigned int density); /** * @copydoc Toolkit::BubbleEmitter::EmitBubble */ - void EmitBubble( Animation& animation, const Vector2& emitPosition, const Vector2& direction, const Vector2& displacement ); + void EmitBubble(Animation& animation, const Vector2& emitPosition, const Vector2& direction, const Vector2& displacement); /** * @copydoc Toolkit::BubbleEmitter::Restore @@ -101,18 +96,17 @@ public: void Restore(); private: - /** * Construct a new BubbleEmitter object. * @param[in] movementArea The size of the bubble moving area - * @param[in] shapeImage The alpha channnel of this texture defines the bubble shape. + * @param[in] shapeTexture The alpha channnel of this texture defines the bubble shape. * @param[in] maximumNumberOfBubble The maximum number of bubble needed. * @param[in] bubbleSizeRange The size range of the bubbles; x component is the minimal size, and y component is the maximum size. */ - BubbleEmitter( const Vector2& movementArea, - Image shapeImage, - unsigned int maximumNumberOfBubble, - const Vector2& bubbleSizeRange ); + BubbleEmitter(const Vector2& movementArea, + Texture shapeTexture, + unsigned int maximumNumberOfBubble, + const Vector2& bubbleSizeRange); /** * This method is called after the CubeTransitionEffect has been initialized. @@ -125,11 +119,11 @@ private: * @param[in] numOfPatch The triangle number in the mesh is 2*numOfPatch; two triangles for each bubble. * @return The mesh geometry. */ - Geometry CreateGeometry( unsigned int numOfPatch ); + Geometry CreateGeometry(unsigned int numOfPatch); /** * Callback function of the finished signal of off-screen render task. - * @param[in] source The render task used to create the color adjusted background image. + * @param[in] source The render task used to create the color adjusted background texture. */ void OnRenderFinished(RenderTask& source); @@ -140,40 +134,38 @@ private: /** * Set the uniform values to the shader effect to emit a bubble - * @param[in] bubbleActor The BubbleActor to render the current bubble + * @param[in] bubbleRenderer The BubbleRenderer * @param[in] curUniform The index of the uniform array in the shader * @param[in] emitPosition The start position of the bubble movement. * @param[in] direction The direction used to constrain the bubble to move in an adjacent direction around it. * @param[in] displacement The displacement used to bound the moving distance of the bubble. */ - void SetBubbleParameter( BubbleActorPtr bubbleActor, unsigned int curUniform, - const Vector2& emitPosition, const Vector2& direction, const Vector2& displacement ); + void SetBubbleParameter(BubbleRenderer& bubbleRenderer, unsigned int curUniform, const Vector2& emitPosition, const Vector2& direction, const Vector2& displacement); private: - - Actor mBubbleRoot; /// mBubbleActors; ///< The meshActor vector, its size is mNumShader. - - Vector2 mMovementArea; ///< The size of the bubble moving area, usually the same size as the background. - Vector2 mBubbleSizeRange; ///< The size range of the bubbles; x component is the low bound, and y component is the up bound. - Vector3 mHSVDelta; ///< The HSV difference used to adjust the background image color. - - unsigned int mNumBubblePerActor; ///< How many bubbles for each BubbleActor. - unsigned int mNumActor; ///< How many BubbleActors are used. - unsigned int mDensity; ///< How many bubbles will emit at each time, they are controlled by same uniforms in the shader. - unsigned int mTotalNumOfBubble; ///< mNumBubblePerShader*mNumShader. - unsigned int mCurrentBubble; ///< Keep track of the index for the newly emitted bubble - unsigned int mRandomSeed; ///< Seed to generate random number. - - bool mRenderTaskRunning; ///< If the background render task is currently running - + Actor mBubbleRoot; /// mBubbleRenderers; ///< The BubbleRenderer vector, its size is mNumShader. + + Vector2 mMovementArea; ///< The size of the bubble moving area, usually the same size as the background. + Vector2 mBubbleSizeRange; ///< The size range of the bubbles; x component is the low bound, and y component is the up bound. + Vector3 mHSVDelta; ///< The HSV difference used to adjust the background image color. + + unsigned int mNumBubblePerRenderer; ///< How many bubbles for each BubbleRenderer. + unsigned int mNumRenderer; ///< How many BubbleRenderers are used. + unsigned int mDensity; ///< How many bubbles will emit at each time, they are controlled by same uniforms in the shader. + unsigned int mTotalNumOfBubble; ///< mNumBubblePerShader*mNumShader. + unsigned int mCurrentBubble; ///< Keep track of the index for the newly emitted bubble + unsigned int mRandomSeed; ///< Seed to generate random number. + + bool mRenderTaskRunning; ///< If the background render task is currently running }; } // namespace Internal @@ -197,4 +189,4 @@ inline const Internal::BubbleEmitter& GetImpl(const Dali::Toolkit::BubbleEmitter } // namespace Dali -#endif /* __DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H__ */ +#endif // DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H