simpler immediates
That last patch was too ambitious: the existing logic is error-prone,
and to fix it would require implementing a whole side algebra for
immediates. I don't really want to have a second side system, even if
we work out how to make it correct.
If instead we just require a few more splats, we can come up with a
simple sane system that at least can't blow up on you unexpectedly.
- Strip F32/I32 back down to a Builder pointer and Val ID,
but create F32a/I32a for use as method arguments that
can auto-construct from an immediate or the normal type.
- Add method overloads using F32a/I32a.
- Add operators using F32a/I32a and int/float primitive types,
guaranteeing there's at least one F32/I32 to get a Builder from.
- To keep things simple, drop all the operator forward declarations.
They're only needed for inline methods on Builder, and there
are few enough of them that calling methods is fine.
- TODO: some of the inline helpers become simple enough
when written with operators they might not need to exist,
e.g. inv(x) -> (1-x).
Change-Id: I193b0e5bca5617ab564c769b916473434ad6d56d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280276
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
3 files changed