Replace Program_GetFunction with SkSL::Program::getFunction.
This will let the Raster Pipeline code find `main` without relying
on the SkVM code.
This implementation is different from the original code:
- The function is now looked up via symbol table, instead of walking
the ProgramElements array.
- We now return a FunctionDeclaration*, not a FunctionDefinition*.
(We will still return null if the function isn't defined.)
The second point leads to a lot of ripple effects in the callers of
the function, but I think it's a better choice due to the way
function overloads work. This approach guarantees that the entire
overload chain is accessible to the caller (although in practice,
our callers most often want `main`, which isn't overloadable).
Change-Id: Ie459de1d4121c2b8af962ab6f2365756d9dc6633
Bug: skia:13676
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/604376
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
9 files changed