Package icyllis.arc3d.granite

# Class TextBlobCache

java.lang.Object
icyllis.arc3d.granite.TextBlobCache

public final class TextBlobCache extends Object
TextBlobCache reuses data from previous drawing operations using multiple criteria to pick the best data for the draw. In addition, it provides a central service for managing resource usage through a weak reference.

The draw data is stored in a three-tiered system. The first tier is keyed by the TextBlob's identity. The second tier uses the `TextBlobCache.FeatureKey` to get a general match for the draw. The last tier queries each sub run using canReuse to determine if each sub run can handle the drawing parameters.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `TextBlobCache.FeatureKey`
  Secondary cache key.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TextBlobCache()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `BakedTextBlob`
  `find(TextBlob blob, TextBlobCache.FeatureKey key)`
  `BakedTextBlob`
  `insert(TextBlob blob, TextBlobCache.FeatureKey key, BakedTextBlob entry)`
  `void`
  `purgeStaleEntries()`
  `void`
  `remove(BakedTextBlob entry)`

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

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

- ## Constructor Details

  - ### TextBlobCache

    public TextBlobCache()

- ## Method Details

  - ### find

    @Nullable public BakedTextBlob find(@Nonnull TextBlob blob, @Nonnull TextBlobCache.FeatureKey key)

  - ### insert

    @Nonnull public BakedTextBlob insert(@Nonnull TextBlob blob, @Nonnull TextBlobCache.FeatureKey key, @Nonnull BakedTextBlob entry)

  - ### remove

    public void remove(@Nonnull BakedTextBlob entry)

  - ### purgeStaleEntries

    public void purgeStaleEntries()