gpu: Add a flag for specifying the GrContext type

Currently, setting the use-vulkan flag both initializes Vulkan and
enables Vulkan compositing/raster. WebGPU-on-Linux sets the use-vulkan
flag so it can use Vulkan for rendering, but it also requires a bunch
of other flags [1] despite having no dependencies on other Vulkan
efforts. As such, we would like to be able to decouple WebGPU's
development from that of the larger Vulkan-on-Chrome effort.

The core issue is that while use-vulkan initializes the VkInstance, it
also sets the |vulkan_context_provider| [2] for the GrContext. Vulkan
Chrome codepaths then check for the existence of the
|vulkan_context_provider| to decide whether the GrContext is Vulkan and
thus, enable Vulkan compositing/raster.

This CL adds a new gr-context-type flag so the type of the GrContext
can be explicitly set instead of implied via the existence of
|vulkan_context_provider| and |metal_context_provider|. For WebGPU, we
can simply set --use-vulkan=true and --gr-context-type=gl to get the
VkInstance without any side effects.

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=976495#c21
[2] https://cs.chromium.org/chromium/src/gpu/command_buffer/service/shared_context_state.h?l=69&rcl=b405097b146118b345e2802b20d7df5d9a5ea908

BUG=996470,976495,1009029
TEST=unit tests and ran chrome with various permutations of the Vulkan
flags

Change-Id: I49cf84c65f58044446eadffabdaef7ab4db517d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829863
Commit-Queue: Brian Ho <hob@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Greg Kerr <kerrnel@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Reviewed-by: Eric Karl <ericrk@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707579}
28 files changed