Always return an invalid backend format for unknown color types
Always return an invalid backend format for unknown color types

Confirmed that this fixes the linked fuzzer bug.

I opted to leave the the backend implementations of
onGetDefaultBackendFormat unchanged, since they technically check
for unknown backend-specific formats before returning an invalid
GrBackendFormat object. It just so happens that this mapping always
ensures GrColorType::kUnknown has an unknown backend-specific format.
Presumably there are other known GrColorTypes that may be unknown
for a specific backend, so those low-level checks are still needed.

Now, we just check the GrColorType in GrCaps before calling the
virtual. This avoids trying to create an invalid format for
GrMockCaps and allows GrBitmapTextureMaker to convert unsupported
color types ot rgba8 even with the mock backend.

Bug: chromium:1185960
Change-Id: I043eb6730efe30884b4180768229b94d35d32047
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/383036
Auto-Submit: Michael Ludwig <cb1f3dd24de0f0b611b26bc28bec758a551d9b7d@google.com>
Reviewed-by: Greg Daniel <39df0a804564ccb6cf75f18db79653821f37c1c5@google.com>

aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_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,google/skia,google/skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia