Fix flutter and g3 build

Replace deprecated function call and reduce stack usage in g3

Bug: skia:
Change-Id: Ib49ccecef4711c92ea2e62e772d98c0f5097e30d
TBR: reed@google.com, caryclark@google.com
Reviewed-on: https://skia-review.googlesource.com/26565
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2 files changed