|
Krita Source Code Documentation
|
#include <kis_tile.h>
Inheritance diagram for KisTile:Public Member Functions | |
| qint32 | col () const |
| quint8 * | data () const |
| void | debugDumpTile () |
| void | debugPrintInfo () |
| QRect | extent () const |
| KisTile (const KisTile &rhs) | |
| KisTile (const KisTile &rhs, KisMementoManager *mm) | |
| KisTile (const KisTile &rhs, qint32 col, qint32 row, KisMementoManager *mm) | |
| KisTile (qint32 col, qint32 row, KisTileData *defaultTileData, KisMementoManager *mm) | |
| void | lockForRead () const |
| void | lockForWrite () |
| KisTileSP | next () const |
| void | notifyAttachedToDataManager (KisMementoManager *mm) |
| void | notifyDeadWithoutDetaching () |
| void | notifyDetachedFromDataManager () |
| qint32 | pixelSize () const |
| qint32 | row () const |
| void | setData (const quint8 *data) |
| void | setNext (KisTileSP next) |
| KisTileData * | tileData () const |
| void | unlockForRead () const |
| void | unlockForWrite () |
| ~KisTile () | |
Public Member Functions inherited from KisShared | |
| bool | deref () |
| bool | ref () |
| int | refCount () |
| QAtomicInt * | sharedWeakReference () |
Private Member Functions | |
| void | blockSwapping () const |
| void | init (qint32 col, qint32 row, KisTileData *defaultTileData, KisMementoManager *mm) |
| void | safeReleaseOldTileData (KisTileData *td) |
| void | unblockSwapping () const |
Private Attributes | |
| qint32 | m_col |
| QMutex | m_COWMutex |
| QRect | m_extent |
| volatile int | m_lockCounter |
| QAtomicPointer< KisMementoManager > | m_mementoManager |
| KisTileSP | m_nextTile |
| QStack< KisTileData * > | m_oldTileData |
| qint32 | m_row |
| QMutex | m_swapBarrierLock |
| KisTileData * | m_tileData |
Additional Inherited Members | |
Protected Member Functions inherited from KisShared | |
| KisShared () | |
| ~KisShared () | |
Provides abstraction to a tile.
Definition at line 40 of file kis_tile.h.
| KisTile::KisTile | ( | qint32 | col, |
| qint32 | row, | ||
| KisTileData * | defaultTileData, | ||
| KisMementoManager * | mm ) |
Definition at line 36 of file kis_tile.cc.
| KisTile::KisTile | ( | const KisTile & | rhs, |
| qint32 | col, | ||
| qint32 | row, | ||
| KisMementoManager * | mm ) |
Definition at line 42 of file kis_tile.cc.
References col(), init(), row(), and tileData().
| KisTile::KisTile | ( | const KisTile & | rhs, |
| KisMementoManager * | mm ) |
| KisTile::KisTile | ( | const KisTile & | rhs | ) |
Definition at line 54 of file kis_tile.cc.
References col(), init(), m_mementoManager, row(), and tileData().
| KisTile::~KisTile | ( | ) |
Definition at line 60 of file kis_tile.cc.
References KIS_ASSERT, m_lockCounter, m_mementoManager, m_tileData, ppVar, and KisTileData::release().
|
inlineprivate |
We need to hold a special barrier lock here to ensure m_tileData->blockSwapping() has finished executing before anyone started reading the tile data. That is why we can not use atomic operations here.
Definition at line 158 of file kis_tile.cc.
References KisTileData::blockSwapping(), data(), m_lockCounter, m_swapBarrierLock, and m_tileData.
|
inline |
Definition at line 95 of file kis_tile.h.
|
inline |
Definition at line 85 of file kis_tile.h.
| void KisTile::debugDumpTile | ( | ) |
Definition at line 297 of file kis_tile.cc.
References data(), dbgTiles, KisTileData::HEIGHT, lockForRead(), pixelSize(), unlockForRead(), and KisTileData::WIDTH.
| void KisTile::debugPrintInfo | ( | ) |
Definition at line 288 of file kis_tile.cc.
References KisSharedPtr< T >::data(), dbgTiles, m_nextTile, and m_tileData.
|
inline |
Definition at line 99 of file kis_tile.h.
|
private |
Definition at line 17 of file kis_tile.cc.
References KisTileData::acquire(), col(), KisTileData::HEIGHT, m_col, m_extent, m_lockCounter, m_mementoManager, m_row, m_tileData, KisMementoManager::registerTileChange(), row(), and KisTileData::WIDTH.
| void KisTile::lockForRead | ( | ) | const |
Definition at line 208 of file kis_tile.cc.
References blockSwapping(), and DEBUG_LOG_ACTION.
| void KisTile::lockForWrite | ( | ) |
Everything could have happened before we took the mutex, so let's check again...
Definition at line 221 of file kis_tile.cc.
References KisTileData::acquire(), KisTileData::blockSwapping(), blockSwapping(), KisTileData::clone(), DEBUG_COWING, DEBUG_LOG_ACTION, lazyCopying, m_COWMutex, m_mementoManager, m_tileData, KisMementoManager::registerTileChange(), safeReleaseOldTileData(), and tileData().
|
inline |
Definition at line 105 of file kis_tile.h.
| void KisTile::notifyAttachedToDataManager | ( | KisMementoManager * | mm | ) |
Called by the hash table to notify that the tile has been attached to the data manager.
Definition at line 113 of file kis_tile.cc.
References m_COWMutex, m_mementoManager, and KisMementoManager::registerTileChange().
| void KisTile::notifyDeadWithoutDetaching | ( | ) |
Sometimes the tile gets replaced with another tile. In this case we shouldn't notify memento manager that the tile has died. Just forget the link to the manager and bury it in peace.
Definition at line 100 of file kis_tile.cc.
References m_mementoManager.
| void KisTile::notifyDetachedFromDataManager | ( | ) |
This method is called by the hash table when the tile is disconnected from it. It means that from now on the tile is not associated with any particular datamanager. All the users of the tile (via shared pointers) may silently finish they work on this tile and leave it. No result will be saved. Used for threading purposes
Definition at line 83 of file kis_tile.cc.
References m_mementoManager, and KisMementoManager::registerTileDeleted().
|
inline |
Definition at line 113 of file kis_tile.h.
|
inline |
Definition at line 92 of file kis_tile.h.
|
inlineprivate |
Definition at line 194 of file kis_tile.cc.
References m_lockCounter, m_oldTileData, m_swapBarrierLock, KisTileData::release(), and KisTileData::unblockSwapping().
|
inline |
Definition at line 88 of file kis_tile.h.
Definition at line 109 of file kis_tile.h.
|
inline |
Definition at line 118 of file kis_tile.h.
|
inlineprivate |
Definition at line 176 of file kis_tile.cc.
References m_lockCounter, m_oldTileData, m_swapBarrierLock, m_tileData, KisTileData::release(), and KisTileData::unblockSwapping().
| void KisTile::unlockForRead | ( | ) | const |
Definition at line 275 of file kis_tile.cc.
References DEBUG_LOG_ACTION, KIS_ASSERT, and unblockSwapping().
| void KisTile::unlockForWrite | ( | ) |
Definition at line 264 of file kis_tile.cc.
References DEBUG_LOG_ACTION, KIS_ASSERT, and unblockSwapping().
|
private |
Definition at line 136 of file kis_tile.h.
|
private |
This is a special mutex for guarding copy-on-write operations. We do not use lockless way here as it'll create too much overhead for the most common operations like "read the pointer of m_tileData".
Definition at line 157 of file kis_tile.h.
|
private |
Added for faster retrieving by processors
Definition at line 142 of file kis_tile.h.
|
mutableprivate |
Definition at line 134 of file kis_tile.h.
|
private |
Definition at line 149 of file kis_tile.h.
|
private |
For KisTiledDataManager's hash table
Definition at line 147 of file kis_tile.h.
|
mutableprivate |
Definition at line 133 of file kis_tile.h.
|
private |
Definition at line 137 of file kis_tile.h.
|
mutableprivate |
This lock is used to ensure no one will read the tile data before it has been loaded from to the memory.
Definition at line 163 of file kis_tile.h.
|
private |
Definition at line 132 of file kis_tile.h.