scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
- ImageActor image = CreateSolidColorActor( Color::RED );
+ Actor image = Actor::New();
image.SetSize(stageSize);
image.SetParentOrigin(ParentOrigin::TOP_LEFT);
image.SetAnchorPoint(AnchorPoint::TOP_LEFT);
DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
Actor offscreenImage = editor.GetChildAt( 2u );
- ImageActor imageActor = ImageActor::DownCast( offscreenImage );
- DALI_TEST_CHECK( imageActor );
+ DALI_TEST_CHECK( offscreenImage );
// Create a tap event to touch the text editor.
application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
Actor offscreenImage = field.GetChildAt( 2u );
- ImageActor imageActor = ImageActor::DownCast( offscreenImage );
- DALI_TEST_CHECK( imageActor );
+ DALI_TEST_CHECK( offscreenImage );
// Create a tap event to touch the text field.
application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
#include <dali-toolkit/dali-toolkit.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h>
+#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
using namespace Dali;
using namespace Toolkit;
{
gObjectCreatedCallBackCalled = true;
}
+
+Actor CreateColorActor( const Vector4& color )
+{
+ Actor solidColorActor = Actor::New();
+
+ RendererFactory factory = RendererFactory::Get();
+ ControlRenderer colorRenderer = factory.GetControlRenderer( color );
+ colorRenderer.SetOnStage( solidColorActor );
+
+ return solidColorActor;
+}
+
} // namespace
void dali_toolbar_startup(void)
try
{
- ImageActor control1 = CreateSolidColorActor( Color::RED );
+ Actor control1 = CreateColorActor( Color::RED );
control1.SetSize( Vector2( 100.f, 100.f ) );
- ImageActor control2 = CreateSolidColorActor( Color::RED );
+ Actor control2 = CreateColorActor( Color::RED );
control2.SetSize( Vector2( 100.f, 100.f ) );
- ImageActor control3 = CreateSolidColorActor( Color::RED );
+ Actor control3 = CreateColorActor( Color::RED );
control3.SetSize( Vector2( 100.f, 100.f ) );
- ImageActor control4 = CreateSolidColorActor( Color::RED );
+ Actor control4 = CreateColorActor( Color::RED );
control4.SetSize( Vector2( 100.f, 100.f ) );
- ImageActor control5 = CreateSolidColorActor( Color::RED );
+ Actor control5 = CreateColorActor( Color::RED );
control5.SetSize( Vector2( 100.f, 100.f ) );
ToolBar toolbar = ToolBar::New();
toolbar.AddControl( control4, 0.1f, Alignment::HorizontalCenter, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
toolbar.AddControl( control5, 0.1f, Alignment::HorizontalRight, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- ImageActor control6 = CreateSolidColorActor( Color::RED );
+ Actor control6 = CreateColorActor( Color::RED );
control6.SetSize( Vector2( 100.f, 100.f ) );
- ImageActor control7 = CreateSolidColorActor( Color::RED );
+ Actor control7 = CreateColorActor( Color::RED );
control7.SetSize( Vector2( 100.f, 100.f ) );
- ImageActor control8 = CreateSolidColorActor( Color::RED );
+ Actor control8 = CreateColorActor( Color::RED );
control8.SetSize( Vector2( 100.f, 100.f ) );
application.Render();
try
{
- ImageActor control = CreateSolidColorActor( Color::RED );
+ Actor control = CreateColorActor( Color::RED );
ToolBar toolbar = ToolBar::New();
try
{
- ImageActor control = CreateSolidColorActor( Color::RED );
+ Actor control = CreateColorActor( Color::RED );
ToolBar toolbar = ToolBar::New();
toolbar.AddControl( control, 0.1f, Alignment::HorizontalLeft );
try
{
- ImageActor control01 = CreateSolidColorActor( Color::RED );
- ImageActor control02 = CreateSolidColorActor( Color::RED );
+ Actor control01 = CreateColorActor( Color::RED );
+ Actor control02 = CreateColorActor( Color::RED );
ToolBar toolbar01 = ToolBar::New();
ToolBar toolbar02 = ToolBar::New();
try
{
- ImageActor control = CreateSolidColorActor( Color::RED );
+ Actor control = CreateColorActor( Color::RED );
ToolBar toolbar = ToolBar::New();
toolbar.AddControl( control, 0.1f, Alignment::HorizontalLeft );
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/popup/confirmation-popup-impl.h>
-#include <dali/public-api/actors/image-actor.h>
using namespace Dali;
*
*/
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/shader-effects/shader-effect.h>
namespace Dali
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/shader-effects/shader-effect.h>
namespace Dali
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
namespace Dali
{
const char* const ACTOR_FOCUSABLE("focusable");
const char* const IS_FOCUS_GROUP("isFocusGroup");
-const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.png";
-const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f);
+const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.9.png";
const char* FOCUS_SOUND_FILE = DALI_SOUND_DIR "Focus.ogg";
const char* FOCUS_CHAIN_END_SOUND_FILE = DALI_SOUND_DIR "End_of_List.ogg";
void AccessibilityManager::CreateDefaultFocusIndicatorActor()
{
// Create a focus indicator actor shared by all the focusable actors
- Image borderImage = ResourceImage::New(FOCUS_BORDER_IMAGE_PATH);
-
- ImageActor focusIndicator = ImageActor::New(borderImage);
+ Toolkit::ImageView focusIndicator = Toolkit::ImageView::New(FOCUS_BORDER_IMAGE_PATH);
focusIndicator.SetParentOrigin( ParentOrigin::CENTER );
- focusIndicator.SetStyle( ImageActor::STYLE_NINE_PATCH );
- focusIndicator.SetNinePatchBorder(FOCUS_BORDER_IMAGE_BORDER);
focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
// Apply size constraint to the focus indicator
#include <sstream>
#include <cmath>
#include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/render-tasks/render-task.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/bubble-effect/bubble-actor.h>
#include <dali-toolkit/internal/controls/bubble-effect/color-adjuster.h>
#include <dali-toolkit/internal/controls/bubble-effect/bubble-effect.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+
namespace
{
mBackgroundImage = bgImage;
mHSVDelta = hsvDelta;
- ImageActor sourceActor = ImageActor::New( bgImage );
+ Toolkit::ImageView sourceActor = Toolkit::ImageView::New( bgImage );
sourceActor.SetSize( mMovementArea );
sourceActor.SetParentOrigin(ParentOrigin::CENTER);
- Stage::GetCurrent().Add( sourceActor );
- ShaderEffect colorAdjuster = CreateColorAdjuster( hsvDelta, true /*ignore alpha to make bubble color always*/ );
- sourceActor.SetShaderEffect( colorAdjuster );
+ Property::Map colorAdjuster = CreateColorAdjuster();
+ sourceActor.SetProperty( Toolkit::ImageView::Property::IMAGE, colorAdjuster);
+ SetColorAdjusterProperties( sourceActor, hsvDelta, true /*ignore alpha to make bubble color always*/ );
+
+ Stage::GetCurrent().Add( sourceActor );
RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
RenderTask task = taskList.CreateTask();
{
mRenderTaskRunning = false;
Actor sourceActor = source.GetSourceActor();
- if( sourceActor )
- {
- ImageActor renderable = ImageActor::DownCast( sourceActor );
- if( renderable )
- {
- renderable.RemoveShaderEffect();
- }
- }
-
Stage stage = Stage::GetCurrent();
stage.Remove(sourceActor);
stage.GetRenderTaskList().RemoveTask(source);
// EXTERNAL INCLUDES
#include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/images/frame-buffer-image.h>
#include <dali/public-api/render-tasks/render-task.h>
*
*/
#include <dali/public-api/math/vector3.h>
-#include <dali/public-api/shader-effects/shader-effect.h>
+#include <dali/public-api/object/property-map.h>
+
+#define DALI_COMPOSE_SHADER(STR) #STR
namespace Dali
{
namespace Internal
{
+inline void SetColorAdjusterProperties( Actor& actor, const Vector3& hsvDelta, bool ignoreAlpha = false )
+{
+ actor.RegisterProperty( "uHSVDelta", hsvDelta );
+ actor.RegisterProperty( "uIgnoreAlpha", ignoreAlpha ? 1.f : 0.f );
+}
+
/**
* Creates a new ColorAdjuster effect.
* ColorAdjuster is a custom shader effect to adjust the image color in HSV space.
* @param[in] ignoreAlpha If true, the result color will be opaque even though source has alpha value
* @return A handle to a newly allocated Dali resource.
*/
-inline ShaderEffect CreateColorAdjuster( const Vector3& hsvDelta, bool ignoreAlpha = false )
+inline Property::Map CreateColorAdjuster()
{
std::string fragmentShader = DALI_COMPOSE_SHADER(
precision highp float;\n
uniform vec3 uHSVDelta;\n
uniform float uIgnoreAlpha;\n
+ varying mediump vec2 vTexCoord;\n
+ uniform sampler2D sTexture;\n
float rand(vec2 co) \n
{\n
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); \n}
}\n
);
- ShaderEffect shaderEffect = ShaderEffect::New("", fragmentShader);
- shaderEffect.SetUniform( "uHSVDelta", hsvDelta );
- shaderEffect.SetUniform( "uIgnoreAlpha", ignoreAlpha?1.0f:0.0f );
+ Property::Map customShader;
+ customShader[ "fragmentShader" ] = fragmentShader;
+
+ Property::Map map;
+ map[ "shader" ] = customShader;
- return shaderEffect;
+ return map;
}
} // namespace Internal
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/devel-api/object/type-registry-helper.h>
-#include <dali/public-api/actors/image-actor.h>
#include <dali/devel-api/scripting/scripting.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
else
{
// If there is no existing content, create a new actor to use for flat color.
- SetupContent( mUnselectedContent, CreateSolidColorActor( mUnselectedColor ) );
+ Toolkit::Control unselectedContentActor = Toolkit::Control::New();
+ unselectedContentActor.SetBackgroundColor( mUnselectedColor );
+ SetupContent( mUnselectedContent, unselectedContentActor );
mUnselectedContent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
}
}
else
{
// If there is no existing content, create a new actor to use for flat color.
- SetupContent( mSelectedContent, CreateSolidColorActor( mSelectedColor ) );
+ Toolkit::Control selectedContentActor = Toolkit::Control::New();
+ selectedContentActor.SetBackgroundColor( mSelectedColor );
+ SetupContent( mSelectedContent, selectedContentActor );
mSelectedContent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
}
}
#include "push-button-impl.h"
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/devel-api/object/type-registry-helper.h>
#include <dali/public-api/images/resource-image.h>
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
#include <dali/public-api/actors/camera-actor.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/render-tasks/render-task.h>
-#include <dali/public-api/actors/image-actor.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali/devel-api/common/map-wrapper.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/images/frame-buffer-image.h>
#include <dali/public-api/render-tasks/render-task.h>
#include "confirmation-popup-impl.h"
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/devel-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
#include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/animation/animation.h>
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/adaptor-framework/timer.h>
#include <dali/public-api/object/property-array.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h>
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/actors/layer.h>
namespace Dali
#include <dali/devel-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include "tool-bar-impl.h"
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/devel-api/object/type-registry-helper.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/stage.h>
#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/devel-api/rendering/renderer.h>
namespace
{
return mOffscreenRootActor;
}
-ImageActor Clipper::GetImageActor() const
+Actor Clipper::GetImageActor() const
{
return mImageActor;
}
mOffscreenRootActor.SetDepthTestDisabled( true );
mOffscreenRootActor.SetSize( offscreenSize );
- mImageActor = ImageActor::New();
+ mImageActor = ImageView::New();
mImageActor.SetParentOrigin( ParentOrigin::CENTER );
- mImageActor.SetBlendFunc( BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA,
- BlendingFactor::ONE, BlendingFactor::ONE );
mImageActor.SetScale( Vector3( 1.0f, -1.0f, 1.0f ) );
mImageActor.SetSize( offscreenSize );
Pixel::RGBA8888 );
mImageActor.SetImage( frameBufferImage );
mRenderTask.SetTargetFrameBuffer( frameBufferImage );
+ mImageActor.OnStageSignal().Connect(this, &Clipper::OnStageConnect);
// Stores current size to avoid create new Dali resources if text changes.
mCurrentOffscreenSize = offscreenSize;
}
+void Clipper::OnStageConnect( Dali::Actor actor )
+{
+ Renderer renderer = mImageActor.GetRendererAt(0);
+ renderer.SetBlendFunc(BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA,
+ BlendingFactor::ONE, BlendingFactor::ONE);
+}
+
Clipper::Clipper()
{
}
// EXTERNAL INCLUDES
#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/actors/camera-actor.h>
#include <dali/public-api/render-tasks/render-task.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali/public-api/signals/connection-tracker.h>
namespace Dali
{
/**
* @brief A helper class for clipping actors using a FrameBufferImage.
*/
-class Clipper : public RefObject
+class Clipper : public RefObject, public ConnectionTracker
{
public:
*
* @return The image actor.
*/
- ImageActor GetImageActor() const;
+ Actor GetImageActor() const;
/**
* @brief Refresh the contents of the FrameBufferImage.
*/
void Initialize( const Vector2& size );
+ /**
+ * The renderer is not created until the clipper actor is set on stage, only by then the blend function could be set.
+ *
+ * @param[in] actor The actor connected to stage.
+ */
+ void OnStageConnect( Dali::Actor actor );
+
/**
* Construct a new Clipper.
*/
Layer mOffscreenRootActor;
CameraActor mOffscreenCameraActor;
- ImageActor mImageActor;
+ ImageView mImageActor;
RenderTask mRenderTask;
Vector2 mCurrentOffscreenSize;
};
#include <dali/devel-api/rendering/renderer.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/internal/controls/image-view/image-view-impl.h>
{
cursor = Control::New();
cursor.SetBackgroundColor( color );
- cursor.SetParentOrigin( ParentOrigin::TOP_LEFT ); // Need to set the default parent origin as CreateSolidColorActor() sets a different one.
+ cursor.SetParentOrigin( ParentOrigin::TOP_LEFT );
cursor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
}
// EXTERNAL INCLUDES
#include <dali/public-api/actors/actor.h>
-#include <dali/public-api/actors/image-actor.h>
namespace Dali
{
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/buttons/button-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
namespace Dali
{
void Button::SetButtonImage( Image image )
{
- Actor imageActor = ImageActor::New( image );
+ Actor imageActor = Toolkit::ImageView::New( image );
imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor );
}
void Button::SetSelectedImage( Image image )
{
- Actor imageActor = ImageActor::New( image );
+ Actor imageActor = Toolkit::ImageView::New( image );
imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageActor );
}
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/buttons/push-button-impl.h>
-#include <dali/public-api/actors/image-actor.h>
namespace Dali
{
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
-
namespace Dali
{
#include <dali/public-api/math/vector4.h>
#include <dali/public-api/actors/image-actor.h>
+
namespace Dali
{