Use vkCmdClearColorImage to clear backend textures

Also don't use GrPixelConfig to create the VkImage.


Bug: skia:7959
Bug: skia:6718

Change-Id: Ia13c5ed2fbe0542c060b725694eff9d566c491f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226078
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 43f8319..da219a1 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -481,14 +481,15 @@
         return GrBackendTexture();
     }
 
-    GrBackendFormat format =
-            this->caps()->getBackendFormatFromColorType(SkColorTypeToGrColorType(colorType));
+    GrColorType ct = SkColorTypeToGrColorType(colorType);
+    GrBackendFormat format = this->caps()->getBackendFormatFromColorType(ct);
     if (!format.isValid()) {
         return GrBackendTexture();
     }
+    SkColor4f swizzledColor = this->caps()->getOutputSwizzle(format, ct).applyTo(color);
 
-    return this->createBackendTexture(width, height, format, color,
-                                      mipMapped, renderable, isProtected);
+    return this->createBackendTexture(width, height, format, swizzledColor, mipMapped, renderable,
+                                      isProtected);
 }
 
 void GrContext::deleteBackendTexture(GrBackendTexture backendTex) {