Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
3f64e7c1
Kaydet (Commit)
3f64e7c1
authored
Ock 19, 2015
tarafından
Tobias Madl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Optimized Timer/Idle code
Change-Id: I285bd632faba5a29a770404d6967f4faf7667b16
üst
4c3cea26
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
42 deletions
+20
-42
timer.hxx
include/vcl/timer.hxx
+1
-0
svdata.hxx
vcl/inc/svdata.hxx
+0
-1
idle.cxx
vcl/source/app/idle.cxx
+1
-9
svapp.cxx
vcl/source/app/svapp.cxx
+3
-6
timer.cxx
vcl/source/app/timer.cxx
+15
-26
No files found.
include/vcl/timer.hxx
Dosyayı görüntüle @
3f64e7c1
...
@@ -64,6 +64,7 @@ public:
...
@@ -64,6 +64,7 @@ public:
static
void
ImplDeInitTimer
();
static
void
ImplDeInitTimer
();
static
void
ImplTimerCallbackProc
();
static
void
ImplTimerCallbackProc
();
static
bool
TimerReady
();
static
bool
TimerReady
();
static
bool
CheckExpiredTimer
(
const
bool
bDoInvoke
);
};
};
/// An auto-timer is a multi-shot timer re-emitting itself at
/// An auto-timer is a multi-shot timer re-emitting itself at
...
...
vcl/inc/svdata.hxx
Dosyayı görüntüle @
3f64e7c1
...
@@ -320,7 +320,6 @@ struct ImplSVData
...
@@ -320,7 +320,6 @@ struct ImplSVData
sal_uLong
mnTimerPeriod
;
// current timer period
sal_uLong
mnTimerPeriod
;
// current timer period
sal_uLong
mnTimerUpdate
;
// TimerCallbackProcs on stack
sal_uLong
mnTimerUpdate
;
// TimerCallbackProcs on stack
bool
mbNotAllTimerCalled
;
// true: Timer must still be processed
bool
mbNotAllTimerCalled
;
// true: Timer must still be processed
bool
mbNoCallTimer
;
// true: No Timeout calls
ImplSVAppData
maAppData
;
// indepen data for class Application
ImplSVAppData
maAppData
;
// indepen data for class Application
ImplSVGDIData
maGDIData
;
// indepen data for Output classes
ImplSVGDIData
maGDIData
;
// indepen data for Output classes
ImplSVWinData
maWinData
;
// indepen data for Windows classes
ImplSVWinData
maWinData
;
// indepen data for Windows classes
...
...
vcl/source/app/idle.cxx
Dosyayı görüntüle @
3f64e7c1
...
@@ -185,7 +185,6 @@ void Idle::Start()
...
@@ -185,7 +185,6 @@ void Idle::Start()
// insert timer and start
// insert timer and start
mpIdleData
=
new
ImplIdleData
;
mpIdleData
=
new
ImplIdleData
;
mpIdleData
->
mpIdle
=
this
;
mpIdleData
->
mpIdle
=
this
;
mpIdleData
->
mbDelete
=
false
;
mpIdleData
->
mbInIdle
=
false
;
mpIdleData
->
mbInIdle
=
false
;
// insert last due to SFX!
// insert last due to SFX!
...
@@ -202,14 +201,7 @@ void Idle::Start()
...
@@ -202,14 +201,7 @@ void Idle::Start()
else
else
pSVData
->
mpFirstIdleData
=
mpIdleData
;
pSVData
->
mpFirstIdleData
=
mpIdleData
;
}
}
else
if
(
!
mpIdleData
->
mpIdle
)
// TODO: remove when guilty found
mpIdleData
->
mbDelete
=
false
;
{
OSL_FAIL
(
"Idle::Start() on a destroyed Idle!"
);
}
else
{
mpIdleData
->
mbDelete
=
false
;
}
}
}
void
Idle
::
Stop
()
void
Idle
::
Stop
()
...
...
vcl/source/app/svapp.cxx
Dosyayı görüntüle @
3f64e7c1
...
@@ -343,11 +343,8 @@ inline void ImplYield( bool i_bWait, bool i_bAllEvents )
...
@@ -343,11 +343,8 @@ inline void ImplYield( bool i_bWait, bool i_bAllEvents )
ImplSVData
*
pSVData
=
ImplGetSVData
();
ImplSVData
*
pSVData
=
ImplGetSVData
();
// run timers that have timed out
// run timers that have timed out
if
(
!
pSVData
->
mbNoCallTimer
)
while
(
pSVData
->
mbNotAllTimerCalled
)
{
Timer
::
ImplTimerCallbackProc
();
while
(
pSVData
->
mbNotAllTimerCalled
)
Timer
::
ImplTimerCallbackProc
();
}
//Process all idles
//Process all idles
Idle
::
Idle
::
ProcessAllIdleHandlers
();
Idle
::
Idle
::
ProcessAllIdleHandlers
();
...
@@ -368,7 +365,7 @@ inline void ImplYield( bool i_bWait, bool i_bAllEvents )
...
@@ -368,7 +365,7 @@ inline void ImplYield( bool i_bWait, bool i_bAllEvents )
// the system timer events will not necessarily come in non waiting mode
// the system timer events will not necessarily come in non waiting mode
// e.g. on OS X; need to trigger timer checks manually
// e.g. on OS X; need to trigger timer checks manually
if
(
pSVData
->
maAppData
.
mbNoYield
&&
!
pSVData
->
mbNoCallTimer
)
if
(
pSVData
->
maAppData
.
mbNoYield
)
{
{
do
do
{
{
...
...
vcl/source/app/timer.cxx
Dosyayı görüntüle @
3f64e7c1
...
@@ -117,33 +117,10 @@ void Timer::ImplTimerCallbackProc( bool idle )
...
@@ -117,33 +117,10 @@ void Timer::ImplTimerCallbackProc( bool idle )
sal_uLong
nDeltaTime
;
sal_uLong
nDeltaTime
;
sal_uLong
nTime
=
tools
::
Time
::
GetSystemTicks
();
sal_uLong
nTime
=
tools
::
Time
::
GetSystemTicks
();
if
(
pSVData
->
mbNoCallTimer
)
return
;
pSVData
->
mnTimerUpdate
++
;
pSVData
->
mnTimerUpdate
++
;
pSVData
->
mbNotAllTimerCalled
=
true
;
pSVData
->
mbNotAllTimerCalled
=
true
;
// find timer where the timer handler needs to be called
Timer
::
CheckExpiredTimer
(
true
);
pTimerData
=
pSVData
->
mpFirstTimerData
;
while
(
pTimerData
)
{
// If the timer is not new, was not deleted, and if it is not in the timeout handler, then
// call the handler as soon as the time is up.
if
(
(
pTimerData
->
mnTimerUpdate
<
pSVData
->
mnTimerUpdate
)
&&
!
pTimerData
->
mbDelete
&&
!
pTimerData
->
mbInTimeout
)
{
// time has expired
if
(
pTimerData
->
GetDeadline
()
<=
nTime
)
{
// set new update time
pTimerData
->
mnUpdateTime
=
nTime
;
pTimerData
->
Invoke
();
}
}
pTimerData
=
pTimerData
->
mpNext
;
}
// determine new time
// determine new time
sal_uLong
nNewTime
=
tools
::
Time
::
GetSystemTicks
();
sal_uLong
nNewTime
=
tools
::
Time
::
GetSystemTicks
();
...
@@ -211,11 +188,17 @@ void Timer::ImplTimerCallbackProc( bool idle )
...
@@ -211,11 +188,17 @@ void Timer::ImplTimerCallbackProc( bool idle )
}
}
bool
Timer
::
TimerReady
()
bool
Timer
::
TimerReady
()
{
return
Timer
::
CheckExpiredTimer
(
false
);
}
bool
Timer
::
CheckExpiredTimer
(
bool
bDoInvoke
)
{
{
// find timer where the timer handler needs to be called
// find timer where the timer handler needs to be called
ImplSVData
*
pSVData
=
ImplGetSVData
();
ImplSVData
*
pSVData
=
ImplGetSVData
();
ImplTimerData
*
pTimerData
=
pSVData
->
mpFirstTimerData
;
ImplTimerData
*
pTimerData
=
pSVData
->
mpFirstTimerData
;
sal_uLong
nTime
=
tools
::
Time
::
GetSystemTicks
();
sal_uLong
nTime
=
tools
::
Time
::
GetSystemTicks
();
bool
timerExpired
=
false
;
while
(
pTimerData
)
while
(
pTimerData
)
{
{
// If the timer is not new, was not deleted, and if it is not in the timeout handler, then
// If the timer is not new, was not deleted, and if it is not in the timeout handler, then
...
@@ -226,13 +209,19 @@ bool Timer::TimerReady()
...
@@ -226,13 +209,19 @@ bool Timer::TimerReady()
// time has expired
// time has expired
if
(
pTimerData
->
GetDeadline
()
<=
nTime
)
if
(
pTimerData
->
GetDeadline
()
<=
nTime
)
{
{
return
true
;
if
(
bDoInvoke
)
{
//Set new update Timer
pTimerData
->
mnUpdateTime
=
nTime
;
pTimerData
->
Invoke
();
}
timerExpired
=
true
;
}
}
}
}
pTimerData
=
pTimerData
->
mpNext
;
pTimerData
=
pTimerData
->
mpNext
;
}
}
return
false
;
return
timerExpired
;
}
}
Timer
::
Timer
()
:
Timer
::
Timer
()
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment