Package icyllis.arc3d.granite

# Class GlyphAtlasManager

java.lang.Object
icyllis.arc3d.granite.DrawAtlas.AtlasGenerationCounter
icyllis.arc3d.granite.GlyphAtlasManager

All Implemented Interfaces:
  `AutoCloseable`

public class GlyphAtlasManager extends DrawAtlas.AtlasGenerationCounter implements AutoCloseable
Manages all baked glyphs and their texture atlases for raster text rendering.

- ## Field Summary

  ### Fields inherited from class icyllis.arc3d.granite.DrawAtlas.AtlasGenerationCounter

  `INVALID_GENERATION, MAX_GENERATION`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GlyphAtlasManager(RecordingContext rc)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addGlyphAndSetLastUseToken(DrawAtlas.PlotBulkUseUpdater updater, BakedGlyph glyph, int maskFormat, long token)`
  `int`
  `addGlyphToAtlas(Glyph glyph, BakedGlyph bakedGlyph)`
  `void`
  `close()`
  `void`
  `compact()`
  `void`
  `evictAtlases()`
  `long`
  `getAtlasGeneration(int maskFormat)`
  `@RawPtr ImageViewProxy`
  `getCurrentTexture(int maskFormat)`
  `boolean`
  `hasGlyph(int maskFormat, BakedGlyph glyph)`
  `boolean`
  `initAtlas(int maskFormat)`
  Initialize atlas if not.
  `void`
  `purge()`
  `boolean`
  `recordUploads(SurfaceDrawContext sdc)`
  `void`
  `setLastUseTokenBulk(int maskFormat, DrawAtlas.PlotBulkUseUpdater updater, long token)`

  ### Methods inherited from class icyllis.arc3d.granite.DrawAtlas.AtlasGenerationCounter

  `next`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GlyphAtlasManager

    public GlyphAtlasManager(RecordingContext rc)

- ## Method Details

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`

  - ### initAtlas

    public boolean initAtlas(int maskFormat)
    Initialize atlas if not. This function *must* be called first, before other functions which use the atlas.

  - ### getCurrentTexture

    @RawPtr public @RawPtr ImageViewProxy getCurrentTexture(int maskFormat)

  - ### hasGlyph

    public boolean hasGlyph(int maskFormat, @Nonnull BakedGlyph glyph)

  - ### addGlyphToAtlas

    public int addGlyphToAtlas(@Nonnull Glyph glyph, @Nonnull BakedGlyph bakedGlyph)

  - ### addGlyphAndSetLastUseToken

    public void addGlyphAndSetLastUseToken(@Nonnull DrawAtlas.PlotBulkUseUpdater updater, @Nonnull BakedGlyph glyph, int maskFormat, long token)

  - ### getAtlasGeneration

    public long getAtlasGeneration(int maskFormat)

  - ### setLastUseTokenBulk

    public void setLastUseTokenBulk(int maskFormat, DrawAtlas.PlotBulkUseUpdater updater, long token)

  - ### recordUploads

    public boolean recordUploads(SurfaceDrawContext sdc)

  - ### evictAtlases

    public void evictAtlases()

  - ### compact

    public void compact()

  - ### purge

    public void purge()