/*
- * Copyright (c) 2017 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.
#include "super-blur-view-impl.h"
// EXTERNAL INCLUDES
-#include <cmath>
+#include <dali/devel-api/common/stage.h>
+#include <dali/devel-api/scripting/scripting.h>
+#include <dali/integration-api/debug.h>
#include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/property-map.h>
-#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/rendering/renderer.h>
-#include <dali/devel-api/scripting/scripting.h>
-#include <dali/integration-api/debug.h>
+#include <cmath>
// INTERNAL_INCLUDES
-#include <dali-toolkit/public-api/image-loader/sync-image-loader.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
+#include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
+#include <dali-toolkit/public-api/image-loader/sync-image-loader.h>
namespace //Unnamed namespace
{
-
using namespace Dali;
//Todo: make these properties instead of constants
-const unsigned int GAUSSIAN_BLUR_DEFAULT_NUM_SAMPLES = 11;
-const unsigned int GAUSSIAN_BLUR_NUM_SAMPLES_INCREMENTATION = 10;
-const float GAUSSIAN_BLUR_BELL_CURVE_WIDTH = 4.5f;
-const float GAUSSIAN_BLUR_BELL_CURVE_WIDTH_INCREMENTATION = 5.f;
-const Pixel::Format GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT = Pixel::RGBA8888;
-const float GAUSSIAN_BLUR_DOWNSAMPLE_WIDTH_SCALE = 0.5f;
-const float GAUSSIAN_BLUR_DOWNSAMPLE_HEIGHT_SCALE = 0.5f;
-
-const char* ALPHA_UNIFORM_NAME( "uAlpha" );
-const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
- varying mediump vec2 vTexCoord;\n
- uniform sampler2D sTexture;\n
- uniform lowp vec4 uColor;\n
- uniform lowp float uAlpha;\n
- \n
- void main()\n
- {\n
- gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
- gl_FragColor.a *= uAlpha;
- }\n
-);
+const unsigned int GAUSSIAN_BLUR_DEFAULT_NUM_SAMPLES = 11;
+const unsigned int GAUSSIAN_BLUR_NUM_SAMPLES_INCREMENTATION = 10;
+const float GAUSSIAN_BLUR_BELL_CURVE_WIDTH = 4.5f;
+const float GAUSSIAN_BLUR_BELL_CURVE_WIDTH_INCREMENTATION = 5.f;
+const Pixel::Format GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT = Pixel::RGBA8888;
+const float GAUSSIAN_BLUR_DOWNSAMPLE_WIDTH_SCALE = 0.5f;
+const float GAUSSIAN_BLUR_DOWNSAMPLE_HEIGHT_SCALE = 0.5f;
+
+const char* ALPHA_UNIFORM_NAME("uAlpha");
/**
* The constraint is used to blend the group of blurred images continuously with a unified blur strength property value which ranges from zero to one.
{
ActorOpacityConstraint(int totalImageNum, int currentImageIdx)
{
- float rangeLength = 1.f / static_cast<float>( totalImageNum );
- float index = static_cast<float>( currentImageIdx );
- mRange = Vector2( index*rangeLength, (index+1.f)*rangeLength );
+ float rangeLength = 1.f / static_cast<float>(totalImageNum);
+ float index = static_cast<float>(currentImageIdx);
+ mRange = Vector2(index * rangeLength, (index + 1.f) * rangeLength);
}
- void operator()( float& current, const PropertyInputContainer& inputs )
+ void operator()(float& current, const PropertyInputContainer& inputs)
{
float blurStrength = inputs[0]->GetFloat();
if(blurStrength < mRange.x)
}
else
{
- current = ( blurStrength - mRange.x) / ( mRange.y - mRange.x );
+ current = (blurStrength - mRange.x) / (mRange.y - mRange.x);
}
}
Vector2 mRange;
};
-#define DALI_COMPOSE_SHADER(STR) #STR
-
-const char * const BASIC_VERTEX_SOURCE = DALI_COMPOSE_SHADER(
- precision mediump float;\n
- attribute mediump vec2 aPosition;\n
- attribute mediump vec2 aTexture;\n
- varying mediump vec2 vTexCoord;\n
- uniform mediump mat4 uMvpMatrix;\n
- uniform mediump vec3 uSize;\n
- \n
- void main()\n
- {\n
- mediump vec4 vertexPosition = vec4(aPosition * uSize.xy, 0.0, 1.0);\n
- vTexCoord = aTexture;\n
- gl_Position = uMvpMatrix * vertexPosition;\n
- }\n
-);
-
-const char * const BASIC_FRAGMENT_SOURCE = DALI_COMPOSE_SHADER(
- precision mediump float;\n
- varying mediump vec2 vTexCoord;\n
- uniform sampler2D sTexture;\n
- uniform vec4 uColor;\n
- \n
- void main()\n
- {\n
- gl_FragColor = texture2D(sTexture, vTexCoord);\n
- gl_FragColor *= uColor;
- }\n
-);
-
-Renderer CreateRenderer( const char* vertexSrc, const char* fragmentSrc )
-{
- Shader shader = Shader::New( vertexSrc, fragmentSrc );
-
- Geometry texturedQuadGeometry = Geometry::New();
-
- struct VertexPosition { Vector2 position; };
- struct VertexTexture { Vector2 texture; };
-
- VertexPosition positionArray[] =
- {
- { Vector2( -0.5f, -0.5f ) },
- { Vector2( 0.5f, -0.5f ) },
- { Vector2( -0.5f, 0.5f ) },
- { Vector2( 0.5f, 0.5f ) }
- };
- uint32_t numberOfVertices = sizeof(positionArray)/sizeof(VertexPosition);
-
- VertexTexture uvArray[] =
- {
- { Vector2( 0.0f, 0.0f ) },
- { Vector2( 1.0f, 0.0f ) },
- { Vector2( 0.0f, 1.0f ) },
- { Vector2( 1.0f, 1.0f ) }
- };
-
- Property::Map positionVertexFormat;
- positionVertexFormat["aPosition"] = Property::VECTOR2;
- PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat );
- positionVertices.SetData( positionArray, numberOfVertices );
- texturedQuadGeometry.AddVertexBuffer( positionVertices );
-
- Property::Map textureVertexFormat;
- textureVertexFormat["aTexture"] = Property::VECTOR2;
- PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat );
- textureVertices.SetData( uvArray, numberOfVertices );
- texturedQuadGeometry.AddVertexBuffer( textureVertices );
-
- const uint16_t indices[] = { 0, 3, 1, 0, 2, 3 };
- texturedQuadGeometry.SetIndexBuffer ( &indices[0], sizeof( indices )/ sizeof( indices[0] ) );
-
- Renderer renderer = Renderer::New( texturedQuadGeometry, shader );
-
- TextureSet textureSet = TextureSet::New();
- renderer.SetTextures( textureSet );
-
- return renderer;
-}
-
-void SetRendererTexture( Renderer& renderer, Texture& texture )
-{
- if( renderer )
- {
- TextureSet textureSet = renderer.GetTextures();
- textureSet.SetTexture( 0u, texture );
- }
-}
-
-void SetRendererTexture( Renderer& renderer, FrameBuffer& frameBuffer )
-{
- if( frameBuffer )
- {
- Texture texture = frameBuffer.GetColorTexture();
- SetRendererTexture( renderer, texture );
- }
-}
-
} // namespace
namespace Dali
{
-
namespace Toolkit
{
-
namespace Internal
{
-
namespace
{
-
const unsigned int DEFAULT_BLUR_LEVEL(5u); ///< The default blur level when creating SuperBlurView from the type registry
BaseHandle Create()
{
- return Toolkit::SuperBlurView::New( DEFAULT_BLUR_LEVEL );
+ return Toolkit::SuperBlurView::New(DEFAULT_BLUR_LEVEL);
}
// Setup properties, signals and actions using the type-registry.
-DALI_TYPE_REGISTRATION_BEGIN( Toolkit::SuperBlurView, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_BEGIN(Toolkit::SuperBlurView, Toolkit::Control, Create)
-DALI_PROPERTY_REGISTRATION( Toolkit, SuperBlurView, "imageUrl", STRING, IMAGE_URL )
+DALI_PROPERTY_REGISTRATION(Toolkit, SuperBlurView, "imageUrl", STRING, IMAGE_URL)
DALI_TYPE_REGISTRATION_END()
} // unnamed namespace
-SuperBlurView::SuperBlurView( unsigned int blurLevels )
-: Control( ControlBehaviour( DISABLE_SIZE_NEGOTIATION | DISABLE_STYLE_CHANGE_SIGNALS ) ),
- mTargetSize( Vector2::ZERO ),
+SuperBlurView::SuperBlurView(unsigned int blurLevels)
+: Control(ControlBehaviour(DISABLE_SIZE_NEGOTIATION | DISABLE_STYLE_CHANGE_SIGNALS)),
+ mTargetSize(Vector2::ZERO),
mBlurStrengthPropertyIndex(Property::INVALID_INDEX),
- mBlurLevels( blurLevels ),
- mResourcesCleared( true )
+ mBlurLevels(blurLevels),
+ mResourcesCleared(true)
{
- DALI_ASSERT_ALWAYS( mBlurLevels > 0 && " Minimal blur level is one, otherwise no blur is needed" );
- mGaussianBlurView.assign( blurLevels, Toolkit::GaussianBlurView() );
- mBlurredImage.assign( blurLevels, FrameBuffer() );
- mRenderers.assign( blurLevels+1, Dali::Renderer() );
+ DALI_ASSERT_ALWAYS(mBlurLevels > 0 && " Minimal blur level is one, otherwise no blur is needed");
+ mGaussianBlurView.assign(blurLevels, Toolkit::GaussianBlurView());
+ mBlurredImage.assign(blurLevels, FrameBuffer());
+ mRenderers.assign(blurLevels + 1, Dali::Renderer());
}
SuperBlurView::~SuperBlurView()
{
}
-Toolkit::SuperBlurView SuperBlurView::New( unsigned int blurLevels )
+Toolkit::SuperBlurView SuperBlurView::New(unsigned int blurLevels)
{
//Create the implementation
- IntrusivePtr<SuperBlurView> superBlurView( new SuperBlurView( blurLevels ) );
+ IntrusivePtr<SuperBlurView> superBlurView(new SuperBlurView(blurLevels));
//Pass ownership to CustomActor via derived handle
- Toolkit::SuperBlurView handle( *superBlurView );
+ Toolkit::SuperBlurView handle(*superBlurView);
// Second-phase init of the implementation
// This can only be done after the CustomActor connection has been made...
void SuperBlurView::OnInitialize()
{
- Actor self( Self() );
+ Actor self(Self());
- mBlurStrengthPropertyIndex = self.RegisterProperty( "blurStrength", 0.f );
+ mBlurStrengthPropertyIndex = self.RegisterProperty("blurStrength", 0.f);
+
+ DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
+ return std::unique_ptr<Dali::Accessibility::Accessible>(
+ new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+ });
}
-void SuperBlurView::SetTexture( Texture texture )
+void SuperBlurView::SetTexture(Texture texture)
{
mInputTexture = texture;
- if( mTargetSize == Vector2::ZERO )
+ if(mTargetSize == Vector2::ZERO)
{
return;
}
ClearBlurResource();
- Actor self( Self() );
+ Actor self(Self());
- BlurTexture( 0, mInputTexture );
- SetRendererTexture( mRenderers[0], texture );
+ BlurTexture(0, mInputTexture);
+ SetRendererTexture(mRenderers[0], texture);
unsigned int i = 1;
- for(; i<mBlurLevels; i++)
+ for(; i < mBlurLevels; i++)
{
- BlurTexture( i, mBlurredImage[i-1].GetColorTexture() );
- SetRendererTexture( mRenderers[i], mBlurredImage[i-1] );
+ BlurTexture(i, mBlurredImage[i - 1].GetColorTexture());
+ SetRendererTexture(mRenderers[i], mBlurredImage[i - 1]);
}
- SetRendererTexture( mRenderers[i], mBlurredImage[i-1] );
+ SetRendererTexture(mRenderers[i], mBlurredImage[i - 1]);
mResourcesCleared = false;
}
return mBlurStrengthPropertyIndex;
}
-void SuperBlurView::SetBlurStrength( float blurStrength )
+void SuperBlurView::SetBlurStrength(float blurStrength)
{
Self().SetProperty(mBlurStrengthPropertyIndex, blurStrength);
}
float SuperBlurView::GetCurrentBlurStrength() const
{
float blurStrength;
- (Self().GetProperty( mBlurStrengthPropertyIndex )).Get(blurStrength);
+ (Self().GetProperty(mBlurStrengthPropertyIndex)).Get(blurStrength);
return blurStrength;
}
return mBlurFinishedSignal;
}
-Texture SuperBlurView::GetBlurredTexture( unsigned int level )
+Texture SuperBlurView::GetBlurredTexture(unsigned int level)
{
- DALI_ASSERT_ALWAYS( level>0 && level<=mBlurLevels );
+ DALI_ASSERT_ALWAYS(level > 0 && level <= mBlurLevels);
- FrameBuffer frameBuffer = mBlurredImage[level-1];
+ FrameBuffer frameBuffer = mBlurredImage[level - 1];
return frameBuffer.GetColorTexture();
}
-void SuperBlurView::BlurTexture( unsigned int idx, Texture texture )
+void SuperBlurView::BlurTexture(unsigned int idx, Texture texture)
{
- DALI_ASSERT_ALWAYS( mGaussianBlurView.size()>idx );
- mGaussianBlurView[idx] = Toolkit::GaussianBlurView::New( GAUSSIAN_BLUR_DEFAULT_NUM_SAMPLES+GAUSSIAN_BLUR_NUM_SAMPLES_INCREMENTATION*idx,
- GAUSSIAN_BLUR_BELL_CURVE_WIDTH + GAUSSIAN_BLUR_BELL_CURVE_WIDTH_INCREMENTATION*static_cast<float>(idx),
- GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT,
- GAUSSIAN_BLUR_DOWNSAMPLE_WIDTH_SCALE, GAUSSIAN_BLUR_DOWNSAMPLE_HEIGHT_SCALE, true );
- mGaussianBlurView[idx].SetParentOrigin(ParentOrigin::CENTER);
- mGaussianBlurView[idx].SetSize(mTargetSize);
- Stage::GetCurrent().Add( mGaussianBlurView[idx] );
-
- mGaussianBlurView[idx].SetUserImageAndOutputRenderTarget( texture, mBlurredImage[idx] );
+ DALI_ASSERT_ALWAYS(mGaussianBlurView.size() > idx);
+ mGaussianBlurView[idx] = Toolkit::GaussianBlurView::New(GAUSSIAN_BLUR_DEFAULT_NUM_SAMPLES + GAUSSIAN_BLUR_NUM_SAMPLES_INCREMENTATION * idx,
+ GAUSSIAN_BLUR_BELL_CURVE_WIDTH + GAUSSIAN_BLUR_BELL_CURVE_WIDTH_INCREMENTATION * static_cast<float>(idx),
+ GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT,
+ GAUSSIAN_BLUR_DOWNSAMPLE_WIDTH_SCALE,
+ GAUSSIAN_BLUR_DOWNSAMPLE_HEIGHT_SCALE,
+ true);
+ mGaussianBlurView[idx].SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ mGaussianBlurView[idx].SetProperty(Actor::Property::SIZE, mTargetSize);
+ Stage::GetCurrent().Add(mGaussianBlurView[idx]);
+
+ mGaussianBlurView[idx].SetUserImageAndOutputRenderTarget(texture, mBlurredImage[idx]);
mGaussianBlurView[idx].ActivateOnce();
- if( idx == mBlurLevels-1 )
+ if(idx == mBlurLevels - 1)
{
- mGaussianBlurView[idx].FinishedSignal().Connect( this, &SuperBlurView::OnBlurViewFinished );
+ mGaussianBlurView[idx].FinishedSignal().Connect(this, &SuperBlurView::OnBlurViewFinished);
}
}
-void SuperBlurView::OnBlurViewFinished( Toolkit::GaussianBlurView blurView )
+void SuperBlurView::OnBlurViewFinished(Toolkit::GaussianBlurView blurView)
{
ClearBlurResource();
- Toolkit::SuperBlurView handle( GetOwner() );
- mBlurFinishedSignal.Emit( handle );
+ Toolkit::SuperBlurView handle(GetOwner());
+ mBlurFinishedSignal.Emit(handle);
}
void SuperBlurView::ClearBlurResource()
{
- if( !mResourcesCleared )
+ if(!mResourcesCleared)
{
- DALI_ASSERT_ALWAYS( mGaussianBlurView.size() == mBlurLevels && "must synchronize the GaussianBlurView group if blur levels got changed " );
- for(unsigned int i=0; i<mBlurLevels;i++)
+ DALI_ASSERT_ALWAYS(mGaussianBlurView.size() == mBlurLevels && "must synchronize the GaussianBlurView group if blur levels got changed ");
+ for(unsigned int i = 0; i < mBlurLevels; i++)
{
- Stage::GetCurrent().Remove( mGaussianBlurView[i] );
+ Stage::GetCurrent().Remove(mGaussianBlurView[i]);
mGaussianBlurView[i].Deactivate();
}
mResourcesCleared = true;
}
}
-void SuperBlurView::OnSizeSet( const Vector3& targetSize )
+void SuperBlurView::OnSizeSet(const Vector3& targetSize)
{
- if( mTargetSize != Vector2(targetSize) )
+ if(mTargetSize != Vector2(targetSize))
{
mTargetSize = Vector2(targetSize);
Actor self = Self();
- for( unsigned int i = 1; i <= mBlurLevels; i++ )
+ for(unsigned int i = 1; i <= mBlurLevels; i++)
{
float exponent = static_cast<float>(i);
- unsigned int width = mTargetSize.width/std::pow(2.f,exponent);
- unsigned int height = mTargetSize.height/std::pow(2.f,exponent);
+ unsigned int width = mTargetSize.width / std::pow(2.f, exponent);
+ unsigned int height = mTargetSize.height / std::pow(2.f, exponent);
- mBlurredImage[i-1] = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
- Texture texture = Texture::New( TextureType::TEXTURE_2D, GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT, unsigned(width), unsigned(height) );
- mBlurredImage[i-1].AttachColorTexture( texture );
+ mBlurredImage[i - 1] = FrameBuffer::New(width, height, FrameBuffer::Attachment::NONE);
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT, unsigned(width), unsigned(height));
+ mBlurredImage[i - 1].AttachColorTexture(texture);
}
- if( mInputTexture )
+ if(mInputTexture)
{
- SetTexture( mInputTexture );
+ SetTexture(mInputTexture);
}
}
- Control::OnSizeSet( targetSize );
+ Control::OnSizeSet(targetSize);
}
-void SuperBlurView::OnStageConnection( int depth )
+void SuperBlurView::OnSceneConnection(int depth)
{
- if( mTargetSize == Vector2::ZERO )
+ if(mTargetSize == Vector2::ZERO)
{
return;
}
- // Exception to the rule, chaining up first ensures visuals have SetOnStage called to create their renderers
- Control::OnStageConnection( depth );
+ // Exception to the rule, chaining up first ensures visuals have SetOnScene called to create their renderers
+ Control::OnSceneConnection(depth);
Actor self = Self();
- for(unsigned int i=0; i<mBlurLevels+1;i++)
+ for(unsigned int i = 0; i < mBlurLevels + 1; i++)
{
- mRenderers[i] = CreateRenderer( BASIC_VERTEX_SOURCE, FRAGMENT_SHADER );
- mRenderers[i].SetProperty( Dali::Renderer::Property::DEPTH_INDEX, (int)i );
- self.AddRenderer( mRenderers[i] );
+ mRenderers[i] = CreateRenderer(BASIC_VERTEX_SOURCE, SHADER_SUPER_BLUR_VIEW_FRAG);
+ mRenderers[i].SetProperty(Dali::Renderer::Property::DEPTH_INDEX, (int)i);
+ self.AddRenderer(mRenderers[i]);
- if( i > 0 )
+ if(i > 0)
{
- Renderer renderer = mRenderers[i];
- Property::Index index = renderer.RegisterProperty( ALPHA_UNIFORM_NAME, 0.f );
- Constraint constraint = Constraint::New<float>( renderer, index, ActorOpacityConstraint(mBlurLevels, i-1) );
- constraint.AddSource( Source( self, mBlurStrengthPropertyIndex ) );
+ Renderer renderer = mRenderers[i];
+ Property::Index index = renderer.RegisterProperty(ALPHA_UNIFORM_NAME, 0.f);
+ Constraint constraint = Constraint::New<float>(renderer, index, ActorOpacityConstraint(mBlurLevels, i - 1));
+ constraint.AddSource(Source(self, mBlurStrengthPropertyIndex));
constraint.Apply();
}
}
- if( mInputTexture )
+ if(mInputTexture)
{
- SetRendererTexture( mRenderers[0], mInputTexture );
+ SetRendererTexture(mRenderers[0], mInputTexture);
unsigned int i = 1;
- for(; i<mBlurLevels; i++)
+ for(; i < mBlurLevels; i++)
{
- SetRendererTexture( mRenderers[i], mBlurredImage[i-1] );
+ SetRendererTexture(mRenderers[i], mBlurredImage[i - 1]);
}
- SetRendererTexture( mRenderers[i], mBlurredImage[i-1] );
+ SetRendererTexture(mRenderers[i], mBlurredImage[i - 1]);
}
}
-void SuperBlurView::OnStageDisconnection()
+void SuperBlurView::OnSceneDisconnection()
{
- for(unsigned int i=0; i<mBlurLevels+1;i++)
+ for(unsigned int i = 0; i < mBlurLevels + 1; i++)
{
- Self().RemoveRenderer( mRenderers[i] );
+ Self().RemoveRenderer(mRenderers[i]);
mRenderers[i].Reset();
}
- Control::OnStageDisconnection();
+ Control::OnSceneDisconnection();
}
Vector3 SuperBlurView::GetNaturalSize()
{
- if( mInputTexture )
+ if(mInputTexture)
{
- return Vector3( mInputTexture.GetWidth(), mInputTexture.GetHeight(), 0.f );
+ return Vector3(mInputTexture.GetWidth(), mInputTexture.GetHeight(), 0.f);
}
return Vector3::ZERO;
}
-void SuperBlurView::SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value )
+void SuperBlurView::SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value)
{
- Toolkit::SuperBlurView superBlurView = Toolkit::SuperBlurView::DownCast( Dali::BaseHandle( object ) );
+ Toolkit::SuperBlurView superBlurView = Toolkit::SuperBlurView::DownCast(Dali::BaseHandle(object));
- if( superBlurView )
+ if(superBlurView)
{
- SuperBlurView& superBlurViewImpl( GetImpl( superBlurView ) );
+ SuperBlurView& superBlurViewImpl(GetImpl(superBlurView));
- if( propertyIndex == Toolkit::SuperBlurView::Property::IMAGE_URL )
+ if(propertyIndex == Toolkit::SuperBlurView::Property::IMAGE_URL)
{
- value.Get( superBlurViewImpl.mUrl );
+ value.Get(superBlurViewImpl.mUrl);
- PixelData pixels = SyncImageLoader::Load( superBlurViewImpl.mUrl );
+ PixelData pixels = SyncImageLoader::Load(superBlurViewImpl.mUrl);
- if ( pixels )
+ if(pixels)
{
- Texture texture = Texture::New( TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight() );
- texture.Upload( pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight() );
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight());
+ texture.Upload(pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight());
- superBlurViewImpl.SetTexture( texture );
+ superBlurViewImpl.SetTexture(texture);
}
else
{
- DALI_LOG_ERROR( "Cannot create image from property value\n" );
+ DALI_LOG_ERROR("Cannot create image from property value\n");
}
}
}
}
-Property::Value SuperBlurView::GetProperty( BaseObject* object, Property::Index propertyIndex )
+Property::Value SuperBlurView::GetProperty(BaseObject* object, Property::Index propertyIndex)
{
Property::Value value;
- Toolkit::SuperBlurView blurView = Toolkit::SuperBlurView::DownCast( Dali::BaseHandle( object ) );
+ Toolkit::SuperBlurView blurView = Toolkit::SuperBlurView::DownCast(Dali::BaseHandle(object));
- if( blurView )
+ if(blurView)
{
- SuperBlurView& superBlurViewImpl( GetImpl( blurView ) );
+ SuperBlurView& superBlurViewImpl(GetImpl(blurView));
- if( propertyIndex == Toolkit::SuperBlurView::Property::IMAGE_URL )
+ if(propertyIndex == Toolkit::SuperBlurView::Property::IMAGE_URL)
{
value = superBlurViewImpl.mUrl;
}