Refactor SkVMGenerator construction.
Refactor SkVMGenerator construction.

Previously, the ctor for SkVMGenerator did a lot of setup work and
emitted the global-variable logic directly. Callers were responsible for
calling `writeFunction` exactly one time, to emit main.

Now, the ctor of SkVMGenerator just sets up members, and callers need to
call `writeProgram`. `writeProgram` emits all the setup code as well as
main.

This makes the ctor a little less scary looking, and gives us a natural
place to insert a dsl::Start/End pair.

Change-Id: I713a0ea70def64f9eeeda4eb7504028112b5d7ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451743
Auto-Submit: John Stiles <f4fcf42d3bb5924557f1eeb3be66747535e585da@google.com>
Commit-Queue: Herb Derby <9e12a3d2bbf73546e47cc9958f6ba8f3215b7eaf@google.com>
Reviewed-by: Herb Derby <9e12a3d2bbf73546e47cc9958f6ba8f3215b7eaf@google.com>

aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia