projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Change BuildRequires of dali2-toolkit to Requires" into devel/master
[platform/core/uifw/dali-toolkit.git]
/
automated-tests
/
src
/
dali-toolkit
/
dali-toolkit-test-utils
/
toolkit-timer.cpp
diff --git
a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
index
2259719
..
f9c89da
100644
(file)
--- a/
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
+++ b/
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
6
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
8
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-18,7
+18,7
@@
#include "toolkit-timer.h"
// INTERNAL INCLUDES
#include "toolkit-timer.h"
// INTERNAL INCLUDES
-#include <dali
/public-api/common/dali
-common.h>
+#include <dali
-toolkit/public-api/dali-toolkit
-common.h>
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/signals/dali-signal.h>
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/signals/dali-signal.h>
@@
-36,6
+36,7
@@
typedef IntrusivePtr<Timer> TimerPtr;
Dali::Timer::TimerSignalType gTickSignal;
int gTimerCount = 0;
Dali::Timer::TimerSignalType gTickSignal;
int gTimerCount = 0;
+bool gKeepTimersRunning = false;
/**
* Implementation of the timer
/**
* Implementation of the timer
@@
-70,6
+71,7
@@
private: // Implementation
private: // Data
unsigned int mInterval;
private: // Data
unsigned int mInterval;
+ bool mRunning;
};
inline Timer& GetImplementation(Dali::Timer& timer)
};
inline Timer& GetImplementation(Dali::Timer& timer)
@@
-97,7
+99,8
@@
TimerPtr Timer::New( unsigned int milliSec )
}
Timer::Timer( unsigned int milliSec )
}
Timer::Timer( unsigned int milliSec )
-: mInterval( milliSec )
+: mInterval( milliSec ),
+ mRunning( false )
{
++gTimerCount;
}
{
++gTimerCount;
}
@@
-109,10
+112,12
@@
Timer::~Timer()
void Timer::Start()
{
void Timer::Start()
{
+ mRunning = true;
}
void Timer::Stop()
{
}
void Timer::Stop()
{
+ mRunning = false;
}
void Timer::SetInterval( unsigned int interval )
}
void Timer::SetInterval( unsigned int interval )
@@
-127,7
+132,7
@@
unsigned int Timer::GetInterval() const
bool Timer::IsRunning() const
{
bool Timer::IsRunning() const
{
- return
true
;
+ return
mRunning
;
}
bool Timer::Tick()
}
bool Timer::Tick()
@@
-151,7
+156,6
@@
void Timer::MockEmitSignal()
}
}
}
}
-
} // namespace Adaptor
} // namespace Internal
} // namespace Adaptor
} // namespace Internal
@@
-193,6
+197,7
@@
Timer::~Timer()
void Timer::Start()
{
Internal::Adaptor::GetImplementation( *this ).Start();
void Timer::Start()
{
Internal::Adaptor::GetImplementation( *this ).Start();
+ Dali::Internal::Adaptor::gKeepTimersRunning = true;
}
void Timer::Stop()
}
void Timer::Stop()
@@
-245,7
+250,13
@@
int GetTimerCount()
void EmitGlobalTimerSignal()
{
void EmitGlobalTimerSignal()
{
- Dali::Internal::Adaptor::gTickSignal.Emit();
+ // @todo Multiplex timers properly.
+ Dali::Internal::Adaptor::gKeepTimersRunning = Dali::Internal::Adaptor::gTickSignal.Emit();
+}
+
+bool AreTimersRunning()
+{
+ return Dali::Internal::Adaptor::gKeepTimersRunning;
}
}
}
}