diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-06-03 16:57:37 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-06-08 08:48:59 +0000 |
commit | 6de290a188fc8fbdb9b39ae0fbc1e95e058314fb (patch) | |
tree | 58223c49eb1502192d335f42c338554fe6dd27f7 /src/plugins/qmlprofiler/pixmapcachemodel.cpp | |
parent | a0f956f0509a68d7eaec718bed294661bca49996 (diff) |
QmlProfiler: Add tests for pixmap cache model
Change-Id: Ic3114f6cd205434e2a489112d070300a3c842352
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/pixmapcachemodel.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/pixmapcachemodel.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/qmlprofiler/pixmapcachemodel.cpp b/src/plugins/qmlprofiler/pixmapcachemodel.cpp index b5e6e68abef..5a040e5926d 100644 --- a/src/plugins/qmlprofiler/pixmapcachemodel.cpp +++ b/src/plugins/qmlprofiler/pixmapcachemodel.cpp @@ -400,6 +400,26 @@ void PixmapCacheModel::clear() QmlProfilerTimelineModel::clear(); } +#ifdef WITH_TESTS +PixmapCacheModel::LoadState PixmapCacheModel::loadState(int index) const +{ + const PixmapCacheItem &item = m_data[index]; + if (item.urlIndex == -1 || item.sizeIndex == -1) + return MaximumLoadState; + + return m_pixmaps[item.urlIndex].sizes[item.sizeIndex].loadState; +} + +PixmapCacheModel::CacheState PixmapCacheModel::cacheState(int index) const +{ + const PixmapCacheItem &item = m_data[index]; + if (item.urlIndex == -1 || item.sizeIndex == -1) + return MaximumCacheState; + + return m_pixmaps[item.urlIndex].sizes[item.sizeIndex].cacheState; +} +#endif // WITH_TESTS + void PixmapCacheModel::computeMaxCacheSize() { foreach (const PixmapCacheModel::PixmapCacheItem &event, m_data) { |