Fix frame cache operation
Batch renderer's frameCache had some problems to manage
its cache entries. So, LottieAnimation could not be controlled
when the frame jumped.
- m_lastRenderedFrame remembers the last rendered frame number
and prevent from adding the frame already rendered.
- pruneFrameCache should make at least 1 empty cache slot for
the next rendered frame if it is not in the cache. So, if it
could not delete any cache entry, it will delete one far from
currentFrame.
Fixes: QTBUG-97259
Pick-to: 6.5
Change-Id: I215f03a55c1538e4ebf8f75552e2652c9072eca9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>