Update SkSurface_Gpu::Valid to take a backend format

This is pulled out of:

https://skia-review.googlesource.com/c/skia/+/222781 (Add bridge between GrContext::createBackendTexture and SkSurface::MakeFromBackendTexture)

Change-Id: I0c26bba2592a6e6fe759b49de83f994b05d862a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223698
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrProgramDesc.cpp b/src/gpu/GrProgramDesc.cpp
index 0ea5417..f0212e5 100644
--- a/src/gpu/GrProgramDesc.cpp
+++ b/src/gpu/GrProgramDesc.cpp
@@ -34,6 +34,10 @@
         case GrTextureType::kRectangle:
             value = 2;
             break;
+        default:
+            SK_ABORT("Unexpected texture type");
+            value = 3;
+            break;
     }
     SkASSERT((value & ((1 << kSamplerOrImageTypeKeyBits) - 1)) == value);
     return SkToU16(value);