{
TestApplication application; // Reset all test adapter return codes
- PanGesture gesture(Gesture::Started);
- DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
+ PanGesture gesture;
+ DALI_TEST_EQUALS(Gesture::Clear, gesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Pan, gesture.type, TEST_LOCATION);
- PanGesture gesture2(Gesture::Continuing);
- DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
+ PanGesture gesture2(Gesture::Started);
+ DALI_TEST_EQUALS(Gesture::Started, gesture2.state, TEST_LOCATION);
DALI_TEST_EQUALS(1u, gesture2.numberOfTouches, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Pan, gesture2.type, TEST_LOCATION);
- PanGesture gesture3(Gesture::Finished);
- DALI_TEST_EQUALS(Gesture::Finished, gesture3.state, TEST_LOCATION);
+ PanGesture gesture3(Gesture::Continuing);
+ DALI_TEST_EQUALS(Gesture::Continuing, gesture3.state, TEST_LOCATION);
DALI_TEST_EQUALS(1u, gesture3.numberOfTouches, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Pan, gesture3.type, TEST_LOCATION);
+ PanGesture gesture4(Gesture::Finished);
+ DALI_TEST_EQUALS(Gesture::Finished, gesture4.state, TEST_LOCATION);
+ DALI_TEST_EQUALS(1u, gesture4.numberOfTouches, TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Pan, gesture4.type, TEST_LOCATION);
+
// Test copy constructor
- gesture3.numberOfTouches = 3u;
+ gesture4.numberOfTouches = 3u;
- PanGesture pan(gesture3);
+ PanGesture pan(gesture4);
DALI_TEST_EQUALS(Gesture::Finished, pan.state, TEST_LOCATION);
DALI_TEST_EQUALS(3u, pan.numberOfTouches, TEST_LOCATION);
DALI_TEST_EQUALS(Gesture::Pan, pan.type, TEST_LOCATION);
delete mAnchorPoint;
}
-void Actor::ConnectToStage( Stage& stage, int index )
+void Actor::ConnectToStage( int index )
{
// This container is used instead of walking the Actor hierachy.
// It protects us when the Actor hierachy is modified during OnStageConnectionExternal callbacks.
ActorContainer connectionList;
// This stage is atomic i.e. not interrupted by user callbacks
- RecursiveConnectToStage( stage, connectionList, index );
+ RecursiveConnectToStage( connectionList, index );
// Notify applications about the newly connected actors.
const ActorIter endIter = connectionList.end();
}
}
-void Actor::RecursiveConnectToStage( Stage& stage, ActorContainer& connectionList, int index )
+void Actor::RecursiveConnectToStage( ActorContainer& connectionList, int index )
{
DALI_ASSERT_ALWAYS( !OnStage() );
for( ActorIter iter = mChildren->begin(); iter != endIter; ++iter )
{
Actor& actor = GetImplementation( *iter );
- actor.RecursiveConnectToStage( stage, connectionList );
+ actor.RecursiveConnectToStage( connectionList );
}
}
}
if ( Stage::IsInstalled() && // Don't emit signals or send messages during Core destruction
parent->OnStage() )
{
- StagePtr stage = parent->mStage;
-
// Instruct each actor to create a corresponding node in the scene graph
- ConnectToStage(*stage, index);
+ ConnectToStage( index );
}
}
else // parent being set to NULL
* @param[in] stage The stage.
* @param[in] index If set, it is only used for positioning the actor within the parent's child list.
*/
- void ConnectToStage(Stage& stage, int index = -1);
+ void ConnectToStage( int index = -1 );
/**
* Helper for ConnectToStage, to recursively connect a tree of actors.
* This is atomic i.e. not interrupted by user callbacks.
- * @param[in] stage The stage.
* @param[in] index If set, it is only used for positioning the actor within the parent's child list.
* @param[out] connectionList On return, the list of connected actors which require notification.
*/
- void RecursiveConnectToStage( Stage& stage, ActorContainer& connectionList, int index = -1 );
+ void RecursiveConnectToStage( ActorContainer& connectionList, int index = -1 );
/**
* Connect the Node associated with this Actor to the scene-graph.
const unsigned int CORE_MAJOR_VERSION = 1;
const unsigned int CORE_MINOR_VERSION = 0;
-const unsigned int CORE_MICRO_VERSION = 28;
+const unsigned int CORE_MICRO_VERSION = 29;
const char * const CORE_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
namespace Dali
{
+PanGesture::PanGesture()
+: Gesture(Gesture::Pan, Gesture::Clear),
+ numberOfTouches(1)
+{
+}
+
PanGesture::PanGesture(Gesture::State state)
: Gesture(Gesture::Pan, state),
numberOfTouches(1)
/**
* @brief Default Constructor.
+ */
+ PanGesture();
+
+ /**
+ * @brief Constructor.
*
* @param[in] state The state of the gesture
*/
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
+// EXTERNAL INCLUDES
+#include <stdint.h>
+
namespace Dali
{
void RefObject::Reference()
{
- // gcc > 4.1 builtin atomic add and fetch (++mCount; return mCount)
- __sync_add_and_fetch(&mCount, 1);
+ // The inline assembly below was tested on an ARMv8 64 bit platform on
+ // 2015-02-06 and found to run in 11.8 nanoseconds, whereas
+ // __sync_add_and_fetch( address, 1 ) required 18.8 nanoseconds.
+ // Including the assembly here produced one fewer assembly instruction than if
+ // it was wrapped in a function and inlined here by the compiler.
+#if defined __aarch64__
+
+ asm volatile(
+ "1:\tldxr w1, %[address] \n\t"
+ "add w1, w1, %[one] \n\t"
+ "stxr w2, w1, %[address] \n\t"
+ "cbnz w2, 1b \n\t"
+ // Outputs:
+ : // Q = A memory address with no offset
+ // ( https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints )
+ [address] "+Q" (mCount)
+ // Inputs:
+ : [one] "Ir" (1)
+ // Clobbers: (explicitly clobber w1 register to hold the loaded value and
+ // register w2 to hold success/fail):
+ : "w1", "w2"
+ );
+
+ // 32 bit ARMv7 version of above:
+ // Better than the code emitted by GCC for __sync_add_and_fetch(), as that
+ // includes two dmb memory barrier instructions: one before and one after the
+ // loop.
+#elif defined __arm__
+
+ asm volatile(
+ "1:\tldrex r1, %[address] \n\t"
+ "add r1, r1, %[one] \n\t"
+ "strex r2, r1, %[address] \n\t"
+ "teq r2, %[zero] \n\t"
+ "bne 1b \n\t"
+ // Outputs:
+ : [address] "+Q" (mCount)
+ // Inputs:
+ : [zero] "Ir" (0),
+ [one] "Ir" (1)
+ // Clobbers: (modified registers):
+ : "r1", "r2"
+ );
+
+#else
+
+ // gcc > 4.1 builtin atomic add and fetch:
+ __sync_add_and_fetch( &mCount, 1 );
+
+#endif
}
void RefObject::Unreference()
{
+ // The output register:
+ int32_t newValue;
+
+#if defined __aarch64__
+
+ asm volatile(
+ "1:\ldxr %w[newValue], %[address] \n\t"
+ "sub %w[newValue], %w[newValue], %[one] \n\t"
+ "stxr w2, %w[newValue], %[address] \n\t"
+ "cbnz w2, 1b \n\t"
+ // Outputs:
+ : [newValue] "=&r" (newValue),
+ // Q = A memory address with no offset
+ // ( https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints )
+ [address] "+Q" (mCount)
+ // Inputs:
+ : [one] "Ir" (1)
+ // Clobbered: I.e., stuff that is modified.
+ : "w2"
+ );
+
+#elif defined __arm__
+
+ asm volatile(
+ "1:\tldrex %[newValue], %[address] \n\t"
+ "sub %[newValue], %[newValue], %[one] \n\t"
+ "strex r2, %[newValue], %[address] \n\t"
+ "teq r2, %[zero] \n\t"
+ "bne 1b \n\t"
+ // Outputs:
+ : [newValue] "=&r" (newValue),
+ [address] "+Q" (mCount)
+ // Inputs:
+ : [zero] "Ir" (0),
+ [one] "Ir" (1)
+ // Clobbered:
+ : "r2"
+ );
+
+#else
+
// gcc > 4.1 builtin atomic subtract and fetch (--mCount; return mCount)
- if (__sync_sub_and_fetch(&mCount, 1) == 0)
+ newValue = __sync_sub_and_fetch( &mCount, 1 );
+
+#endif
+
+ if( newValue == 0 )
{
delete this;
}
Name: dali
Summary: The OpenGLES Canvas Core Library
-Version: 1.0.28
+Version: 1.0.29
Release: 1
Group: System/Libraries
License: Apache-2.0