Kaydet (Commit) 62b0eaf3 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: fdo#50697 reset the cache timeout on GetGraphic

so the graphic gets swapped out Xms after the last use and not Xms after
initial creation regardless of if it got used a moment earlier.

Change-Id: I1458f307d090ecd8d8d031b545f23e78bf1bcb67
üst b25871da
...@@ -299,6 +299,8 @@ private: ...@@ -299,6 +299,8 @@ private:
DECL_LINK( ImplAutoSwapOutHdl, void* ); DECL_LINK( ImplAutoSwapOutHdl, void* );
void SVT_DLLPRIVATE ResetCacheTimeOut();
protected: protected:
virtual void GraphicManagerDestroyed(); virtual void GraphicManagerDestroyed();
......
...@@ -744,10 +744,26 @@ void GraphicObject::StopAnimation( OutputDevice* pOut, long nExtraData ) ...@@ -744,10 +744,26 @@ void GraphicObject::StopAnimation( OutputDevice* pOut, long nExtraData )
mpSimpleCache->maGraphic.StopAnimation( pOut, nExtraData ); mpSimpleCache->maGraphic.StopAnimation( pOut, nExtraData );
} }
void GraphicObject::ResetCacheTimeOut()
{
if (mpSwapOutTimer)
{
mpSwapOutTimer->Stop();
mpSwapOutTimer->Start();
}
}
const Graphic& GraphicObject::GetGraphic() const const Graphic& GraphicObject::GetGraphic() const
{ {
if( mbAutoSwapped ) GraphicObject *pThis = const_cast<GraphicObject*>(this);
( (GraphicObject*) this )->ImplAutoSwapIn();
if (mbAutoSwapped)
pThis->ImplAutoSwapIn();
//fdo#50697 If we've been asked to provide the graphic, then reset
//the cache timeout to start from now and not remain at the
//time of creation
pThis->ResetCacheTimeOut();
return maGraphic; return maGraphic;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment