PDFium Delphi Component Docs

TTileKey record and TPdfTileCache class

Unit: PDFium

TTileKey

TTileKey.Create combines DocumentRevision, PageNumber, Zoom, Rotation, RenderOptions, TileLeft, TileTop, TileWidth and TileHeight into a stable render-tile key

Equals compares every key field and tolerates sub-micro zoom differences

TPdfTileCache methods

MethodDescription
Create(Capacity: Integer = 64)Creates a bounded cache with a minimum capacity of one tile
Create(Capacity: Integer; Governor: TPdfCacheGovernor)Creates a cache that also competes in a shared byte budget
DestroyClears the cache and releases every owned bitmap
Get(const Key: TTileKey): TBitmapReturns the cached bitmap without transferring ownership and updates local and shared recency
Put(const Key: TTileKey; Bitmap: TBitmap)Transfers bitmap ownership to the cache and retains it only when both the entry capacity and shared byte budget permit it
InvalidatePage(PageNumber: Integer)Removes all tiles for one page
InvalidateRevision(DocumentRevision: Int64)Retains only tiles belonging to the supplied document revision
ClearReleases all cached bitmaps and governor tokens

Properties

PropertyTypeDescription
CapacityIntegerMaximum tile count
CountIntegerCurrent tile count
StoredBytesInt64Current bitmap charge using width times height times four bytes
CacheGovernorTPdfCacheGovernorOptional shared governor; assigning one first clears existing entries

Governor lifetime

The cache never owns CacheGovernor

The governor must outlive the cache, or the property must be set to nil before the governor is freed

See Also

FPdfCache, TPdf cache governor, RenderTile