A property not to render again when the visual is scaled down.
Change-Id: I53d1e78d1376a24318055fa787ea8ee16e4fa0f2
.Add( "loopCount", 3 )
.Add( "playRange", playRange )
.Add( "stopBehavior", DevelImageVisual::StopBehavior::FIRST_FRAME )
- .Add( "loopingMode", DevelImageVisual::LoopingMode::AUTO_REVERSE );
+ .Add( "loopingMode", DevelImageVisual::LoopingMode::AUTO_REVERSE )
+ .Add( "redrawInScalingDown", false );
Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
DALI_TEST_CHECK( visual );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::LoopingMode::AUTO_REVERSE );
+ value = resultMap.Find( DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, Property::BOOLEAN );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get< bool >() == false );
+
actor.Unparent( );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
value = resultMap.Find( DevelImageVisual::Property::CONTENT_INFO, Property::MAP );
DALI_TEST_CHECK( value );
+ value = resultMap.Find( DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, Property::BOOLEAN );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get< bool >() == true ); // Check default value
+
// request AnimatedVectorImageVisual with an URL
Visual::Base visual2 = factory.CreateVisual( TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions() );
* And the array contains 2 integer values which are the frame numbers, the start frame number and the end frame number of the layer.
* @note This property is read-only.
*/
- CONTENT_INFO = ORIENTATION_CORRECTION + 10
+ CONTENT_INFO = ORIENTATION_CORRECTION + 10,
+
+ /**
+ * @brief Whether to redraw the image when the visual is scaled down.
+ * @details Name "redrawInScalingDown", type Property::BOOLEAN.
+ * @note It is used in the AnimatedVectorImageVisual. The default is true.
+ */
+ REDRAW_IN_SCALING_DOWN
};
} //namespace Property
mPlayState( DevelImageVisual::PlayState::STOPPED ),
mEventCallback( nullptr ),
mRendererAdded( false ),
- mCoreShutdown(false)
+ mCoreShutdown(false),
+ mRedrawInScalingDown(true)
{
// the rasterized image is with pre-multiplied alpha format
mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
map.Insert( Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR, mAnimationData.stopBehavior );
map.Insert( Toolkit::DevelImageVisual::Property::LOOPING_MODE, mAnimationData.loopingMode );
+ map.Insert( Toolkit::DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, mRedrawInScalingDown );
Property::Map layerInfo;
mVectorAnimationTask->GetLayerInfo( layerInfo );
{
DoSetProperty( Toolkit::DevelImageVisual::Property::LOOPING_MODE, keyValue.second );
}
+ else if( keyValue.first == REDRAW_IN_SCALING_DOWN_NAME )
+ {
+ DoSetProperty( Toolkit::DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, keyValue.second );
+ }
}
}
}
break;
}
+ case Toolkit::DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN:
+ {
+ bool redraw;
+ if( value.Get( redraw ) )
+ {
+ mRedrawInScalingDown = redraw;
+ }
+ break;
+ }
}
}
if( actor )
{
Vector3 scale = actor.GetProperty< Vector3 >( Actor::Property::WORLD_SCALE );
- mVisualScale.width = scale.width;
- mVisualScale.height = scale.height;
- DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnScaleNotification: scale = %f, %f [%p]\n", mVisualScale.width, mVisualScale.height, this );
+ if(mRedrawInScalingDown || scale.width >= 1.0f || scale.height >= 1.0f)
+ {
+ mVisualScale.width = scale.width;
+ mVisualScale.height = scale.height;
- SetVectorImageSize();
- SendAnimationData();
+ DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnScaleNotification: scale = %f, %f [%p]\n", mVisualScale.width, mVisualScale.height, this );
- Stage::GetCurrent().KeepRendering( 0.0f ); // Trigger event processing
+ SetVectorImageSize();
+ SendAnimationData();
+
+ Stage::GetCurrent().KeepRendering( 0.0f ); // Trigger event processing
+ }
}
}
CallbackBase* mEventCallback; // Not owned
bool mRendererAdded;
bool mCoreShutdown;
+ bool mRedrawInScalingDown;
};
} // namespace Internal
const char * const IMAGE_DESIRED_WIDTH( "desiredWidth" );
const char * const IMAGE_DESIRED_HEIGHT( "desiredHeight" );
const char * const ALPHA_MASK_URL("alphaMaskUrl");
+const char * const REDRAW_IN_SCALING_DOWN_NAME("redrawInScalingDown");
// Text visual
const char * const TEXT_PROPERTY( "text" );
extern const char * const IMAGE_DESIRED_WIDTH;
extern const char * const IMAGE_DESIRED_HEIGHT;
extern const char * const ALPHA_MASK_URL;
+extern const char * const REDRAW_IN_SCALING_DOWN_NAME;
// Text visual
extern const char * const TEXT_PROPERTY;