/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
// INTERNAL INCLUDES
#include <dali/internal/event/actors/image-actor-impl.h>
#include <dali/internal/event/images/image-impl.h>
+#include <dali/internal/event/effects/shader-effect-impl.h>
#include <dali/public-api/common/dali-common.h>
namespace Dali
{
+const BlendingMode::Type ImageActor::DEFAULT_BLENDING_MODE = BlendingMode::AUTO;
+
ImageActor::ImageActor()
{
}
}
ImageActor::ImageActor(const ImageActor& copy)
-: RenderableActor(copy)
+: Actor(copy)
{
}
return *this;
}
-ImageActor& ImageActor::operator=(BaseHandle::NullType* rhs)
-{
- DALI_ASSERT_ALWAYS( (rhs == NULL) && "Can only assign NULL pointer to handle");
- Reset();
- return *this;
-}
-
void ImageActor::SetImage(Image image)
{
Internal::ImagePtr imagePtr;
return Dali::Image( imagePtr.Get() );
}
-void ImageActor::SetToNaturalSize()
-{
- GetImplementation(*this).SetToNaturalSize();
-}
-
void ImageActor::SetPixelArea(const PixelArea& pixelArea)
{
GetImplementation(*this).SetPixelArea(pixelArea);
return GetImplementation(*this).GetPixelArea();
}
-bool ImageActor::IsPixelAreaSet() const
-{
- return GetImplementation(*this).IsPixelAreaSet();
-}
-
-void ImageActor::ClearPixelArea()
-{
- GetImplementation(*this).ClearPixelArea();
-}
-
void ImageActor::SetStyle(Style style)
{
GetImplementation(*this).SetStyle(style);
return GetImplementation(*this).GetNinePatchBorder();
}
+void ImageActor::SetSortModifier(float modifier)
+{
+ GetImplementation(*this).SetSortModifier(modifier);
+}
+
+float ImageActor::GetSortModifier() const
+{
+ return GetImplementation(*this).GetSortModifier();
+}
+
+void ImageActor::SetBlendMode( BlendingMode::Type mode )
+{
+ GetImplementation(*this).SetBlendMode( mode );
+}
+
+BlendingMode::Type ImageActor::GetBlendMode() const
+{
+ return GetImplementation(*this).GetBlendMode();
+}
+
+void ImageActor::SetBlendFunc( BlendingFactor::Type srcFactorRgba, BlendingFactor::Type destFactorRgba )
+{
+ GetImplementation(*this).SetBlendFunc( srcFactorRgba, destFactorRgba );
+}
+
+void ImageActor::SetBlendFunc( BlendingFactor::Type srcFactorRgb, BlendingFactor::Type destFactorRgb,
+ BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha )
+{
+ GetImplementation(*this).SetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
+}
+
+void ImageActor::GetBlendFunc( BlendingFactor::Type& srcFactorRgb, BlendingFactor::Type& destFactorRgb,
+ BlendingFactor::Type& srcFactorAlpha, BlendingFactor::Type& destFactorAlpha ) const
+{
+ GetImplementation(*this).GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
+}
+
+void ImageActor::SetBlendEquation( BlendingEquation::Type equationRgba )
+{
+ GetImplementation(*this).SetBlendEquation( equationRgba );
+}
+
+void ImageActor::SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha )
+{
+ GetImplementation(*this).SetBlendEquation( equationRgb, equationAlpha );
+}
+
+void ImageActor::GetBlendEquation( BlendingEquation::Type& equationRgb, BlendingEquation::Type& equationAlpha ) const
+{
+ GetImplementation(*this).GetBlendEquation( equationRgb, equationAlpha );
+}
+
+void ImageActor::SetBlendColor( const Vector4& color )
+{
+ GetImplementation(*this).SetBlendColor( color );
+}
+
+const Vector4& ImageActor::GetBlendColor() const
+{
+ return GetImplementation(*this).GetBlendColor();
+}
+
+void ImageActor::SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter )
+{
+ GetImplementation(*this).SetFilterMode( minFilter, magFilter );
+}
+
+void ImageActor::GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const
+{
+ GetImplementation(*this).GetFilterMode( minFilter, magFilter );
+}
+
+void ImageActor::SetShaderEffect(ShaderEffect effect)
+{
+ GetImplementation(*this).SetShaderEffect(GetImplementation(effect));
+}
+
+ShaderEffect ImageActor::GetShaderEffect() const
+{
+ Internal::ShaderEffectPtr internal = GetImplementation(*this).GetShaderEffect();
+
+ return ShaderEffect(internal.Get());
+}
+
+void ImageActor::RemoveShaderEffect()
+{
+ GetImplementation(*this).RemoveShaderEffect();
+}
+
+
ImageActor::ImageActor(Internal::ImageActor* internal)
-: RenderableActor(internal)
+: Actor(internal)
{
}
+void SetShaderEffectRecursively( Actor actor, ShaderEffect effect )
+{
+ // only do something if the actor and effect are valid
+ if( actor && effect )
+ {
+ // first remove from this actor
+ ImageActor imageActor = ImageActor::DownCast( actor );
+ if( imageActor )
+ {
+ imageActor.SetShaderEffect( effect );
+ }
+ // then all children recursively
+ const unsigned int count = actor.GetChildCount();
+ for( unsigned int index = 0; index < count; ++index )
+ {
+ Actor child( actor.GetChildAt( index ) );
+ SetShaderEffectRecursively( child, effect );
+ }
+ }
+}
+
+void RemoveShaderEffectRecursively( Actor actor )
+{
+ // only do something if the actor is valid
+ if( actor )
+ {
+ // first remove from this actor
+ ImageActor imageActor = ImageActor::DownCast( actor );
+ if( imageActor )
+ {
+ imageActor.RemoveShaderEffect();
+ }
+ // then all children recursively
+ const unsigned int count = actor.GetChildCount();
+ for( unsigned int index = 0; index < count; ++index )
+ {
+ Actor child( actor.GetChildAt( index ) );
+ RemoveShaderEffectRecursively( child );
+ }
+ }
+}
+
} // namespace Dali