unify program() and uniforms()

It's clearer and more efficient to emit uniforms
as we use them.  The pattern to look for is something like

    skvm::I32 val = p->uniform32(uniforms, buf->bytes());
    buf->push_back(fVal);

where fVal holds the actual uniform value, and val is its program
counterpart.

Switching to SkTDArray lets us use friendlier methods like bytes() and
append(N) in the effect code.

It's a lot easier to follow this way once you get used to it and much
less error-prone.  No need to split the can-we-do-it logic up from the
uniform emission, and so no chance to write logic twice that
acccidentally disagrees.

Effects now always emit uniforms when you call program(), which means we
occasionally do that twice, once when building the Key to look up cached
programs, and once again when building the program if the cache misses.
That's not that big of a deal... it reuses the same memory exactly, and
I've added some notes around the code and assertions that everything
matches up exactly.  It only happens on cache miss, so it's dwarfed by
the cost of building and JITing the program anwyay.

Change-Id: I55a9252b11b2c0cd5f7ab8ace6df5fef29342c10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252837
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
12 files changed