|
Krita Source Code Documentation
|
#include <kis_swapped_data_store.h>
Public Member Functions | |
| void | debugStatistics () |
| void | forgetTileData (KisTileData *td) |
| KisSwappedDataStore () | |
| quint64 | numTiles () const |
| void | swapInTileData (KisTileData *td) |
| qint64 | totalSwapMemoryUsed () const |
| bool | trySwapOutTileData (KisTileData *td) |
| ~KisSwappedDataStore () | |
Private Attributes | |
| KisChunkAllocator * | m_allocator |
| QByteArray | m_buffer |
| KisAbstractTileCompressor * | m_compressor |
| QMutex | m_lock |
| KisMemoryWindow * | m_swapSpace |
| qint64 | m_totalSwapMemoryUsed |
Definition at line 22 of file kis_swapped_data_store.h.
| KisSwappedDataStore::KisSwappedDataStore | ( | ) |
Definition at line 17 of file kis_swapped_data_store.cpp.
References m_allocator, m_compressor, m_swapSpace, KisImageConfig::maxSwapSize(), MiB, KisImageConfig::swapDir(), KisImageConfig::swapSlabSize(), and KisImageConfig::swapWindowSize().
| KisSwappedDataStore::~KisSwappedDataStore | ( | ) |
Definition at line 32 of file kis_swapped_data_store.cpp.
References m_allocator, m_compressor, and m_swapSpace.
| void KisSwappedDataStore::debugStatistics | ( | ) |
Some debugging output
Definition at line 115 of file kis_swapped_data_store.cpp.
References KisChunkAllocator::debugFragmentation(), m_allocator, and KisChunkAllocator::sanityCheck().
| void KisSwappedDataStore::forgetTileData | ( | KisTileData * | td | ) |
Forget all the information linked with the tile data. This should be done before deleting of the tile data, whose actual data is swapped-out
Definition at line 100 of file kis_swapped_data_store.cpp.
References KisChunkAllocator::freeChunk(), m_allocator, m_lock, m_totalSwapMemoryUsed, KisTileData::setSwapChunk(), KisChunk::size(), and KisTileData::swapChunk().
| quint64 KisSwappedDataStore::numTiles | ( | ) | const |
Returns number of swapped out tile data objects
Definition at line 39 of file kis_swapped_data_store.cpp.
References m_allocator, and KisChunkAllocator::numChunks().
| void KisSwappedDataStore::swapInTileData | ( | KisTileData * | td | ) |
Restore the data of a td basing on information stored in the swap file. LOCKING: the lock on the tile data should be taken by the caller before making a call.
Definition at line 81 of file kis_swapped_data_store.cpp.
References KisTileData::allocateMemory(), KisTileData::data(), KisAbstractTileCompressor::decompressTileData(), KisChunkAllocator::freeChunk(), KisMemoryWindow::getReadChunkPtr(), m_allocator, m_compressor, m_lock, m_swapSpace, m_totalSwapMemoryUsed, KisTileData::setSwapChunk(), KisChunk::size(), and KisTileData::swapChunk().
| qint64 KisSwappedDataStore::totalSwapMemoryUsed | ( | ) | const |
Returns the metric of the total memory stored in the swap in uncompressed form!
Definition at line 110 of file kis_swapped_data_store.cpp.
References m_totalSwapMemoryUsed.
| bool KisSwappedDataStore::trySwapOutTileData | ( | KisTileData * | td | ) |
Swap out the data stored in the td to the swap file and free memory occupied by td->data(). LOCKING: the lock on the tile data should be taken by the caller before making a call.
We are expecting that the lock of KisTileData has already been taken by the caller for us. So we can modify the tile data freely.
Definition at line 47 of file kis_swapped_data_store.cpp.
References KisAbstractTileCompressor::compressTileData(), KisTileData::data(), KisChunkAllocator::getChunk(), KisMemoryWindow::getWriteChunkPtr(), m_allocator, m_buffer, m_compressor, m_lock, m_swapSpace, m_totalSwapMemoryUsed, KisTileData::releaseMemory(), KisTileData::setSwapChunk(), KisChunk::size(), and KisAbstractTileCompressor::tileDataBufferSize().
|
private |
Definition at line 71 of file kis_swapped_data_store.h.
|
private |
Definition at line 68 of file kis_swapped_data_store.h.
|
private |
Definition at line 69 of file kis_swapped_data_store.h.
|
private |
Definition at line 74 of file kis_swapped_data_store.h.
|
private |
Definition at line 72 of file kis_swapped_data_store.h.
|
private |
Definition at line 76 of file kis_swapped_data_store.h.