GlyphScratch Class
The working storage of the decoding of a glyph, charged to an allocator. It grows to the largest glyph and is kept by its owner, so that decoding the same glyphs again allocates nothing.
public sealed class GlyphScratch : IDisposableRemarks
A font has no cache and no state of its own: several threads can decode its glyphs, each with its own scratch.
- Implements
Constructors
| Name | Description |
|---|---|
| GlyphScratch(FontAllocator) | Initializes a new instance of the GlyphScratch class. |
GlyphScratch(FontAllocator)
GlyphScratch.csInitializes a new instance of the GlyphScratch class.
public GlyphScratch(FontAllocator scope)Parameters
scopeFontAllocator- The allocator the storage is rented from.
Properties
| Name | Description |
|---|---|
| Count | Gets the number of points. |
| Work | Gets the working numbers that are rented. |
Count
GlyphScratch.csWork
GlyphScratch.csGets the working numbers that are rented.
Property value
Methods
| Name | Description |
|---|---|
| Add(int) | Adds points, whose content is unspecified, and returns the index of the first one. |
| Dispose() | Returns the storage to the allocator. |
| RentWork(long) | Rents working numbers, set to zero, after the ones already rented. The storage can move: a span of GlyphScratch.Work must not be kept across another rental. |
| Reset() | Removes every point and keeps the storage. |
| ReturnWork(int) | Returns the working numbers rented last. |
Add(int)
GlyphScratch.csAdds points, whose content is unspecified, and returns the index of the first one.
Parameters
countint
Returns
Exceptions
FontResourceLimitException- The points exceed the allocation limit.
Dispose()
GlyphScratch.csReturns the storage to the allocator.
public void Dispose()RentWork(long)
GlyphScratch.csRents working numbers, set to zero, after the ones already rented. The storage can move: a span of GlyphScratch.Work must not be kept across another rental.
Reset()
GlyphScratch.csRemoves every point and keeps the storage.
public void Reset()