Introduce delegate for Atlas regeneration

I tried a few different things for this (see earlier PS if interested)
and settled on adding another delegate at the recommendation of
herb@, which has ended in a relatively clean way to break things up.

The Ganesh- and Graphite-specific part for GlyphVector (how to
add glyphs to the respective atlas) already live in src/gpu/ganesh
and src/gpu/graphite, so they are only compiled and linked in
when that particular backend is. However, to make either or both
of them available without ifdefs, I needed a way to call them
from SubRuns without forcing both of them to be there during
link-time.

Thus, an additional delegate which the Ganesh TextAtlasOp or
Graphite Device supplies to make the call to the right backend code.

Out of caution, I moved the GPU specific calls to be private
and then added friends to allow the blessed part in Ganesh/Graphite
to make the call. This way we don't have unintentional calls
to that, which could cause link-time errors or other issues
since regenerating the atlas should only be done in a single-threaded
environment due to how it mutates the underlying data.

I also added a way to query the required padding for a given
AtlasSubRun. This was necessary in an earlier version, and continues
to exist to document some otherwise magic numbers.

Next step in the ongoing effort to remove #ifdefs from src/text
would be looking at how the graphite instancing parts work and
how we can decouple that.

Change-Id: I272773ec5bc492994b04171c981f0c079e05961d
Bug: skia:14317
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/711682
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
7 files changed