END_TEST;
}
-int UtcDaliGaussianBlurViewActivateOnce(void)
+int UtcDaliGaussianBlurViewActivateOnce1(void)
{
ToolkitTestApplication application;
- tet_infoline("UtcDaliGaussianBlurActivateOnce");
+ tet_infoline("UtcDaliGaussianBlurActivateOnce1");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New(5, 1.5f, Pixel::RGB888, 0.5f, 0.5f, true);
DALI_TEST_CHECK( view );
END_TEST;
}
+// Positive test case for a method
+int UtcDaliGaussianBlurActivateOnce2(void)
+{
+ ToolkitTestApplication application;
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+ tet_infoline("UtcDaliGaussianBlurActivateOnce2");
+
+ Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
+ DALI_TEST_CHECK( view );
+
+ view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ view.SetSize(Stage::GetCurrent().GetSize());
+ view.Add(Actor::New());
+ Stage::GetCurrent().Add(view);
+ view.ActivateOnce();
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_CHECK( gl.GetLastGenTextureId() == 3 );
+
+ view.ActivateOnce();
+
+ application.SendNotification();
+ application.Render(20);
+
+ DALI_TEST_CHECK( gl.GetLastGenTextureId() == 6 );
+
+ END_TEST;
+}
+
int UtcDaliGaussianBlurViewFinishedSignalN(void)
{
ToolkitTestApplication application;
#define DALI_TOOLKIT_GAUSSIAN_BLUR_EFFECT_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
* @brief Render the GaussianBlurView once.
*
* Must be called after you Add() it to the stage.
- * Only works with a gaussian blur view created with blurUserImage = true.
* Listen to the Finished signal to determine when the rendering has completed.
* @SINCE_1_0.0
*/
mRenderChildrenTask.SetCameraActor(mRenderFullSizeCamera);
mRenderChildrenTask.SetFrameBuffer( mRenderTargetForRenderingChildren );
+
+ if( mRenderOnce )
+ {
+ mRenderChildrenTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
+ }
}
// perform a horizontal blur targeting the second buffer
mHorizBlurTask.SetClearColor( mBackgroundColor );
mHorizBlurTask.SetCameraActor(mRenderDownsampledCamera);
mHorizBlurTask.SetFrameBuffer( mRenderTarget2 );
- if( mRenderOnce && mBlurUserImage )
+ if( mRenderOnce || ( mRenderOnce && mBlurUserImage ) )
{
mHorizBlurTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
}
{
mVertBlurTask.SetFrameBuffer( mRenderTarget1 );
}
- if( mRenderOnce && mBlurUserImage )
+ if( mRenderOnce || ( mRenderOnce && mBlurUserImage ) )
{
mVertBlurTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
mVertBlurTask.FinishedSignal().Connect( this, &GaussianBlurView::OnRenderTaskFinished );
mCompositeTask.SetCameraActor(mRenderFullSizeCamera);
mCompositeTask.SetFrameBuffer( mRenderTargetForRenderingChildren );
+
+ if( mRenderOnce )
+ {
+ mCompositeTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
+ }
}
}
void GaussianBlurView::ActivateOnce()
{
- DALI_ASSERT_ALWAYS(mBlurUserImage); // Only works with blurring image mode.
+ Deactivate();
mRenderOnce = true;
Activate();
}