#!/usr/bin/perl
#
-# Copyright (c) 2016 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.
if(index( $source_file, $file ) > 0 )
{
$gcovfile = $coverage_file;
+ # Some header files do not produce an equivalent gcov file so we shouldn't parse them
+ if(($source_file =~ /\.h$/) && (! -e $gcovfile))
+ {
+ print "Omitting Header: $source_file\n" if $debug;
+ $gcovfile = ""
+ }
last;
}
}
/*
- * 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.
uint32_t surfaceHeight,
uint32_t horizontalDpi,
uint32_t verticalDpi,
- ResourcePolicy::DataRetention policy,
bool initialize )
: mRenderSurface( NULL ),
mCore( NULL ),
mSurfaceHeight( surfaceHeight ),
mFrame( 0u ),
mDpi{ horizontalDpi, verticalDpi },
- mLastVSyncTime(0u),
- mDataRetentionPolicy( policy )
+ mLastVSyncTime(0u)
{
if( initialize )
{
mGlAbstraction,
mGlSyncAbstraction,
mGlContextHelperAbstraction,
- mDataRetentionPolicy,
Integration::RenderToFrameBuffer::FALSE,
Integration::DepthBufferAvailable::TRUE,
Integration::StencilBufferAvailable::TRUE );
#define DALI_TEST_APPLICATION_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.
uint32_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
uint32_t horizontalDpi = DEFAULT_HORIZONTAL_DPI,
uint32_t verticalDpi = DEFAULT_VERTICAL_DPI,
- ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA,
bool initialize = true );
void Initialize();
struct { uint32_t x; uint32_t y; } mDpi;
uint32_t mLastVSyncTime;
- ResourcePolicy::DataRetention mDataRetentionPolicy;
static bool mLoggingEnabled;
};
int UtcDaliFramebufferContextLoss(void)
{
tet_infoline("UtcDaliFramebufferContextLoss\n");
- TestApplication application; // Default config: DALI_DISCARDS_ALL_DATA
+ TestApplication application;
//Create the texture
unsigned int width(64);
Actor actor = Actor::New();
PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::POSITION_X, GreaterThanCondition(100.0f));
+ PropertyNotification notification2 = actor.AddPropertyNotification(Actor::Property::SIZE, StepCondition( 1.0f, 1.0f ));
DALI_TEST_CHECK( notification );
+ DALI_TEST_CHECK( notification2 );
END_TEST;
}
END_TEST;
}
+int UtcDaliAddPropertyNotificationSize(void)
+{
+ TestApplication application;
+ tet_infoline(" UtcDaliAddPropertyNotificationSize");
+
+ Actor actor = Actor::New();
+
+ PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::SIZE, StepCondition( 1.0f, 1.0f ));
+ DALI_TEST_CHECK( notification );
+ END_TEST;
+}
+
int UtcDaliPropertyNotificationGetCondition(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliPropertyNotificationSetSizeResultP(void)
+{
+ TestApplication application;
+ bool notifyResult;
+ tet_infoline(" UtcDaliPropertyNotificationSetSizeResultP");
+
+ Actor actor = Actor::New();
+
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::SIZE, StepCondition( 1.0f, 1.0f ) );
+ notification.SetNotifyMode(PropertyNotification::NotifyOnChanged);
+ gCallBackCalled = false;
+ notification.NotifySignal().Connect( &TestCallback );
+
+ actor.SetSize(100.0f, 100.0f);
+
+ application.Render(RENDER_FRAME_INTERVAL);
+ application.SendNotification();
+ application.Render(RENDER_FRAME_INTERVAL);
+ application.SendNotification();
+
+ notifyResult = notification.GetNotifyResult();
+
+ DALI_TEST_EQUALS( notifyResult, true, TEST_LOCATION );
+
+ gCallBackCalled = false;
+
+ actor.SetSize(200.0f, 200.0f);
+
+ application.Render(RENDER_FRAME_INTERVAL);
+ application.SendNotification();
+ application.Render(RENDER_FRAME_INTERVAL);
+ application.SendNotification();
+
+ notifyResult = notification.GetNotifyResult();
+
+ DALI_TEST_EQUALS( notifyResult, true, TEST_LOCATION );
+
+ END_TEST;
+}
+
int UtcDaliPropertyConditionGetArguments(void)
{
TestApplication application;
/*
- * Copyright (c) 2017 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.
int UtcDaliTextureContextLoss(void)
{
tet_infoline("UtcDaliTextureContextLoss\n");
- TestApplication application; // Default config: DALI_DISCARDS_ALL_DATA
+ TestApplication application;
//Create the texture
unsigned int width(64);
/*
- * 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.
GlAbstraction& glAbstraction,
GlSyncAbstraction& glSyncAbstraction,
GlContextHelperAbstraction& glContextHelperAbstraction,
- ResourcePolicy::DataRetention policy,
RenderToFrameBuffer renderToFboEnabled,
DepthBufferAvailable depthBufferAvailable,
StencilBufferAvailable stencilBufferAvailable )
glAbstraction,
glSyncAbstraction,
glContextHelperAbstraction,
- policy,
renderToFboEnabled,
depthBufferAvailable,
stencilBufferAvailable );
#define DALI_INTEGRATION_CORE_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.
#include <dali/public-api/common/dali-common.h>
#include <dali/integration-api/context-notifier.h>
#include <dali/integration-api/core-enumerations.h>
-#include <dali/integration-api/resource-policies.h>
namespace Dali
{
* @param[in] glAbstraction The interface providing OpenGL services.
* @param[in] glSyncAbstraction The interface providing OpenGL sync objects.
* @param[in] glContextHelperAbstraction The interface providing OpenGL context helper objects.
- * @param[in] policy The data retention policy. This depends on application setting
- * and platform support. Dali should honour this policy when deciding to discard
- * intermediate resource data.
* @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
* @param[in] depthBufferAvailable Whether the depth buffer is available
* @param[in] stencilBufferAvailable Whether the stencil buffer is available
GlAbstraction& glAbstraction,
GlSyncAbstraction& glSyncAbstraction,
GlContextHelperAbstraction& glContextHelperAbstraction,
- ResourcePolicy::DataRetention policy,
RenderToFrameBuffer renderToFboEnabled,
DepthBufferAvailable depthBufferAvailable,
StencilBufferAvailable stencilBufferAvailable );
#define DALI_INTEGRATION_RESOURCE_POLICIES_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.
{
/**
- * The data retention policy describes how dali should retain resource data.
- */
-enum DataRetention
-{
- DALI_RETAINS_ALL_DATA, // retains all data e.g. bitmaps
- DALI_DISCARDS_ALL_DATA, // discards all data (expects application to regenerate UI on context loss)
-};
-
-/**
* The discardable policy determines if a resource can be discarded.
* Discarded means that it can be released after uploading to GPU.
*/
/*
- * 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.
GlAbstraction& glAbstraction,
GlSyncAbstraction& glSyncAbstraction,
GlContextHelperAbstraction& glContextHelperAbstraction,
- ResourcePolicy::DataRetention dataRetentionPolicy,
Integration::RenderToFrameBuffer renderToFboEnabled,
Integration::DepthBufferAvailable depthBufferAvailable,
Integration::StencilBufferAvailable stencilBufferAvailable )
#define DALI_INTERNAL_CORE_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.
Integration::GlAbstraction& glAbstraction,
Integration::GlSyncAbstraction& glSyncAbstraction,
Integration::GlContextHelperAbstraction& glContextHelperAbstraction,
- ResourcePolicy::DataRetention dataRetentionPolicy,
Integration::RenderToFrameBuffer renderToFboEnabled,
Integration::DepthBufferAvailable depthBufferAvailable,
Integration::StencilBufferAvailable stencilBufferAvailable );
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/math/radian.h>
+#include <dali/public-api/actors/actor.h>
#include <dali/internal/event/actors/actor-impl.h>
#include <dali/internal/event/common/property-notification-manager.h>
#include <dali/internal/event/common/object-impl.h>
mComponentIndex( componentIndex ),
mCondition( condition ),
mNotifyMode( Dali::PropertyNotification::NotifyOnTrue ),
- mNotifyResult( false )
+ mNotifyResult( false ),
+ mCompare( false )
{
const Internal::PropertyCondition& conditionImpl = GetImplementation( condition );
}
}
+ // In Size Property case, swapping components occurs sometimes.
+ // To cover swapping components, previous and current components should be compared.
+ if( mObjectPropertyIndex == Dali::Actor::Property::SIZE
+ && mObject->GetPropertyType(mObjectPropertyIndex) == Property::VECTOR3 )
+ {
+ mCompare = true;
+ for( int i = 0; i < 3; ++i )
+ {
+ mRawConditionArgs.PushBack( 0.0f );
+ }
+ }
+
// all objects always have scene object
CreateSceneObject();
}
mComponentIndex,
GetImplementation( mCondition ).type,
mRawConditionArgs,
- mNotifyMode );
+ mNotifyMode,
+ mCompare );
OwnerPointer< SceneGraph::PropertyNotification > transferOwnership( const_cast<SceneGraph::PropertyNotification*>( mPropertyNotification ) );
AddPropertyNotificationMessage( mUpdateManager, transferOwnership );
}
RawArgumentContainer mRawConditionArgs; ///< The Raw Condition args. (float type)
NotifyMode mNotifyMode; ///< The current notification mode.
bool mNotifyResult; ///< The result of the last condition check that caused a signal emit
+ bool mCompare; ///< The flag of comparing previous property's raw value and current.
};
} // namespace Internal
namespace Integration
{
-class Event;
+struct Event;
}
namespace Internal
{
-class GestureRequest;
+struct GestureRequest;
class Scene;
template< typename T>
namespace Dali
{
-class RotationGesture;
+struct RotationGesture;
namespace Internal
{
const int32_t ARGINDEX_REF_VALUE = 0;
const int32_t ARGINDEX_STEP_SIZE = 1;
const int32_t ARGINDEX_CURRENT_STEP = 2;
+const int32_t ARGINDEX_FIRST_VALUE = 3;
+const int32_t ARGINDEX_SECOND_VALUE = 4;
+const int32_t ARGINDEX_THIRD_VALUE = 5;
} // namespace
return function;
}
+ConditionFunction Step::GetCompareFunction( Property::Type valueType )
+{
+ ConditionFunction function = NULL;
+ if( valueType == Property::VECTOR3 )
+ {
+ function = EvalAndCompareVector3;
+ }
+ else
+ {
+ function = GetFunction( valueType );
+ }
+
+ return function;
+}
+
bool Step::Evaluate( const float propertyValue, PropertyNotification::RawArgumentContainer& arg )
{
const float refValue = arg[ARGINDEX_REF_VALUE];
const float propertyValue = value.GetFloat();
return Evaluate( propertyValue, arg );
}
+
bool Step::EvalVector2( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float propertyValue = value.GetVector2().LengthSquared();
return Evaluate( propertyValue, arg );
}
-bool Step::EvalVector4( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+bool Step::EvalAndCompareVector3( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+ float propertyValue = value.GetVector3().LengthSquared();
+ bool result = Evaluate( propertyValue, arg );
+ if( result == false )
+ {
+ if( ( fabsf( arg[ARGINDEX_FIRST_VALUE] - value.GetVector3().x ) > Math::MACHINE_EPSILON_1 )
+ || ( fabsf( arg[ARGINDEX_SECOND_VALUE] - value.GetVector3().y ) > Math::MACHINE_EPSILON_1 )
+ || ( fabsf( arg[ARGINDEX_THIRD_VALUE] - value.GetVector3().z ) > Math::MACHINE_EPSILON_1 ) )
+ {
+ result = true;
+ }
+ }
+ arg[ARGINDEX_FIRST_VALUE] = value.GetVector3().x;
+ arg[ARGINDEX_SECOND_VALUE] = value.GetVector3().y;
+ arg[ARGINDEX_THIRD_VALUE] = value.GetVector3().z;
+ return result;
+}
+
+bool Step::EvalVector4( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float propertyValue = value.GetVector4().LengthSquared();
return Evaluate( propertyValue, arg );
*/
static ConditionFunction GetFunction( Property::Type valueType );
+ /**
+ * @return function pointer to the correct condition function, based on
+ * the type of value being examined.
+ *
+ * This function pointer is to compare previous and current components for the swapping case.
+ */
+ static ConditionFunction GetCompareFunction( Property::Type valueType );
+
private:
static bool Evaluate( const float propertyValue, PropertyNotification::RawArgumentContainer& arg );
static bool EvalVector3( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
+ * Checks if Vector3.Length() is Outside
+ *
+ * If previous Vector3.Lenght() and current are same, the raw datas are checked with comparing these values.
+ *
+ * @param[in] value The value being examined.
+ * @param[in] arg The supplied arguments for the condition.
+ * @return Condition result (true if condition met, false if not)
+ */
+ static bool EvalAndCompareVector3( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+
+ /**
* Checks if Vector4.Length() is Outside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
static bool EvalDefault( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
-
};
} // namespace SceneGraph
int componentIndex,
ConditionType condition,
RawArgumentContainer& arguments,
- NotifyMode notifyMode)
+ NotifyMode notifyMode,
+ bool compare)
{
- return new PropertyNotification( object, propertyIndex, propertyType, componentIndex, condition, arguments, notifyMode );
+ return new PropertyNotification( object, propertyIndex, propertyType, componentIndex, condition, arguments, notifyMode, compare );
}
int componentIndex,
ConditionType condition,
RawArgumentContainer& arguments,
- NotifyMode notifyMode)
+ NotifyMode notifyMode,
+ bool compare)
: mObject(&object),
mPropertyIndex(propertyIndex),
mPropertyType(propertyType),
}
case PropertyCondition::Step:
{
- mConditionFunction = Step::GetFunction(mPropertyType);
+ if( compare == true )
+ {
+ mConditionFunction = Step::GetCompareFunction(mPropertyType);
+ }
+ else
+ {
+ mConditionFunction = Step::GetFunction(mPropertyType);
+ }
break;
}
case PropertyCondition::VariableStep:
}
if( mValid != currentValid
- || (currentValid && ((mConditionType == PropertyCondition::Step)
- || (mConditionType == PropertyCondition::VariableStep))) )
+ || ( currentValid && ( ( mConditionType == PropertyCondition::Step )
+ || ( mConditionType == PropertyCondition::VariableStep ) ) ) )
{
mValid = currentValid;
// means don't notify so notifyRequired stays false
* @param[in] condition The condition type (e.g. LessThan, GreaterThan...)
* @param[in] arguments The arguments which accompany the condition.
* @param[in] notifyMode The notification mode setting
+ * @param[in] compare The flag of comparing the previous and current data.
* @return A new PropertyNotification object.
*/
static PropertyNotification* New(Object& object,
int componentIndex,
ConditionType condition,
RawArgumentContainer& arguments,
- NotifyMode notifyMode);
+ NotifyMode notifyMode,
+ bool compare);
/**
* Virtual destructor
int componentIndex,
ConditionType condition,
RawArgumentContainer& arguments,
- NotifyMode notifyMode);
+ NotifyMode notifyMode,
+ bool compare);
private:
#endif
/// Use DALI_FALLTHROUGH in switch statements where one case is supposed to fall through into another case
+#define DALI_FALLTHROUGH
+#if __GNUC__
#if __has_cpp_attribute(fallthrough)
+#undef DALI_FALLTHROUGH
#define DALI_FALLTHROUGH [[fallthrough]]
-#else
-#define DALI_FALLTHROUGH
+#endif
#endif
#endif // DALI_COMMON_H
{
const uint32_t CORE_MAJOR_VERSION = 1;
-const uint32_t CORE_MINOR_VERSION = 4;
-const uint32_t CORE_MICRO_VERSION = 57;
+const uint32_t CORE_MINOR_VERSION = 5;
+const uint32_t CORE_MICRO_VERSION = 0;
const char * const CORE_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
* @param[in] value the value to compare
* @return true if the value is equal to zero
*/
+#if __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
inline bool EqualsZero( float value )
{
return value == 0.0f;
}
+#if __GNUC__
#pragma GCC diagnostic pop
+#endif
/**
* @brief Helper function to compare equality of two floating point values.
{
class TypeRegistry;
}
-class DefaultPropertyMetadata;
+struct DefaultPropertyMetadata;
/**
* @brief The TypeRegistry allows registration of type instance creation functions.
Name: dali
Summary: DALi 3D Engine
-Version: 1.4.57
+Version: 1.5.0
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT