X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fsuper-blur-view%2Fsuper-blur-view-impl.h;h=585703abe01a782517f45fd71674f3cd66629049;hb=124aa28a0cd62b61142779066432cd29195c42ce;hp=846451ae4468e1ede202fe9aab8661279e0bd46c;hpb=e2eda444afbe82e9591fe198eef339227f90a616;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h index 846451a..585703a 100644 --- a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h +++ b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h @@ -1,27 +1,32 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_SUPER_BLUR_VIEW_H__ -#define __DALI_TOOLKIT_INTERNAL_SUPER_BLUR_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_SUPER_BLUR_VIEW_H +#define DALI_TOOLKIT_INTERNAL_SUPER_BLUR_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 +#include // INTERNAL INCLUDES -#include #include -#include -#include +#include +#include +#include namespace Dali { @@ -37,8 +42,9 @@ namespace Internal /** * SuperBlurView implementation class */ -class SuperBlurView : public ControlImpl +class SuperBlurView : public Control { + public: /** @@ -49,7 +55,7 @@ public: /** * @copydoc Dali::Toolkit::SuperBlurView::SetImage */ - void SetImage(Image inputImage); + void SetTexture( Texture texture ); /** * @copydoc Dali::Toolkit::SuperBlurView::GetBlurStrengthPropertyIndex @@ -72,9 +78,27 @@ public: Dali::Toolkit::SuperBlurView::SuperBlurViewSignal& BlurFinishedSignal(); /** - * @copydoc Dali::Toolkit::SuperBlurView::GetBlurredImage + * @copydoc Dali::Toolkit::SuperBlurView::GetBlurredTexture + */ + Texture GetBlurredTexture( unsigned int level ); + + // Properties + + /** + * Called when a property of an object of this type is set. + * @param[in] object The object whose property is set. + * @param[in] index The property index. + * @param[in] value The new property value. */ - Image GetBlurredImage( unsigned int level ); + static void SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value ); + + /** + * Called to retrieve a property of an object of this type. + * @param[in] object The object whose property is to be retrieved. + * @param[in] index The property index. + * @return The current value of the property. + */ + static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex ); protected: @@ -88,7 +112,7 @@ protected: */ virtual ~SuperBlurView(); -private: // from ControlImpl +private: // from Control /** * @copydoc Toolkit::Control::OnInitialize @@ -96,23 +120,33 @@ private: // from ControlImpl virtual void OnInitialize(); /** - * @copydoc Toolkit::Control::OnControlSizeSet + * @copydoc CustomActorImpl::OnSizeSet() + */ + virtual void OnSizeSet(const Vector3& targetSize); + + /** + * @copydoc CustomActorImpl::OnStageConnection() */ - virtual void OnControlSizeSet(const Vector3& targetSize); + virtual void OnStageConnection( int depth ); /** - * @copydoc Toolkit::ControlImpl::OnRelaidOut() + * @copydoc CustomActorImpl::OnStageDisconnection() */ - virtual void OnRelaidOut( Vector2 size, ActorSizeContainer& container ); + virtual void OnStageDisconnection(); + + /** + * @copydoc CustomActorImpl::GetNaturalSize() + */ + virtual Vector3 GetNaturalSize(); private: /** * Carry out the idx-th pass of blurring * @param[in] idx The blur pass index - * @param[in] image The input image for the current blurring, it is either the original image or the blurred image from the previous pass + * @param[in] texture The input texture for the current blurring, it is either the original image or the blurred texture from the previous pass */ - void BlurImage( unsigned int idx, Image image ); + void BlurTexture( unsigned int idx, Texture texture ); /** * Signal handler to tell when the last blur view completes @@ -126,18 +160,18 @@ private: void ClearBlurResource(); private: + std::vector mGaussianBlurView; + std::vector mBlurredImage; + std::vector mRenderers; + Texture mInputTexture; + Vector2 mTargetSize; - unsigned int mBlurLevels; + Toolkit::SuperBlurView::SuperBlurViewSignal mBlurFinishedSignal; ///< Signal emitted when blur has completed. + std::string mUrl; Property::Index mBlurStrengthPropertyIndex; - - std::vector mGaussianBlurView; - std::vector mBlurredImage; - std::vector mImageActors; + unsigned int mBlurLevels; bool mResourcesCleared; - - Vector2 mTargetSize; - Toolkit::SuperBlurView::SuperBlurViewSignal mBlurFinishedSignal; ///< Signal emitted when blur has completed. }; } @@ -161,4 +195,4 @@ inline const Toolkit::Internal::SuperBlurView& GetImpl( const Toolkit::SuperBlur } -#endif /* __DALI_TOOLKIT_INTERNALSUPER_BLUR_VIEW_H__ */ +#endif // DALI_TOOLKIT_INTERNAL_SUPER_BLUR_VIEW_H