public class TextureWarmer
extends java.lang.Object
Layout
or Drawable
. Drawing a
Layout
in the background ensures that the glyph caches are warmed up and ready for
drawing the same Layout
on a real Canvas
. This will substantially reduce drawing
times for big chunks of text. On the other hand over-using text warming might rotate the glyphs
cache too quickly and diminish the optimization. Similarly, for Drawable
starting on art
it will be put in a texture cache of RenderNode, which will speed up drawing.Modifier and Type | Class and Description |
---|---|
static class |
TextureWarmer.WarmDrawable |
Modifier and Type | Method and Description |
---|---|
static TextureWarmer |
getInstance() |
void |
warmDrawable(TextureWarmer.WarmDrawable drawable)
Schedules a
Drawable to be drawn in the background. |
void |
warmLayout(Layout layout)
Schedules a
Layout to be drawn in the background. |
public static TextureWarmer getInstance()
TextureWarmer
instance.public void warmLayout(Layout layout)
Layout
to be drawn in the background. This warms up the Glyph cache for
that Layout
.public void warmDrawable(TextureWarmer.WarmDrawable drawable)
Drawable
to be drawn in the background. This warms up the texture cache for
that Drawable
.