Remove use of GrColorType on GrCaps::getRenderTargetSampleCount.

Additionally this changes removes the version of the call that that takes
a GrPixelConfig.

As part of this change many call sites that were calling getRTSampleCount
to just check renderability have been changed to call
isFormat[AsColorType]Renderable instead. This change has also started to
move us to just checking format renderability (without GrCT) in classes
that are specifically dealing with GrSurface (GrResourceProvider, GrGpu, etc.).

Bug: skia:6718
Change-Id: Icf4a1a21a81a44e6863a7cd2059d21b9833d581f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233039
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp
index 037d72b..2ccfdfd 100644
--- a/src/gpu/GrCaps.cpp
+++ b/src/gpu/GrCaps.cpp
@@ -280,9 +280,10 @@
     return this->onCanCopySurface(dst, src, srcRect, dstPoint);
 }
 
-bool GrCaps::validateSurfaceDesc(const GrSurfaceDesc& desc, GrRenderable renderable,
-                                 int renderTargetSampleCnt, GrMipMapped mipped) const {
-    if (!this->isConfigTexturable(desc.fConfig)) {
+bool GrCaps::validateSurfaceParams(const SkISize& size, const GrBackendFormat& format,
+                                   GrPixelConfig config, GrRenderable renderable,
+                                   int renderTargetSampleCnt, GrMipMapped mipped) const {
+    if (!this->isConfigTexturable(config)) {
         return false;
     }
 
@@ -290,16 +291,16 @@
         return false;
     }
 
-    if (desc.fWidth < 1 || desc.fHeight < 1) {
+    if (size.width() < 1 || size.height() < 1) {
         return false;
     }
 
     if (renderable == GrRenderable::kYes) {
-        if (0 == this->getRenderTargetSampleCount(renderTargetSampleCnt, desc.fConfig)) {
+        if (!this->isFormatRenderable(format, renderTargetSampleCnt)) {
             return false;
         }
         int maxRTSize = this->maxRenderTargetSize();
-        if (desc.fWidth > maxRTSize || desc.fHeight > maxRTSize) {
+        if (size.width() > maxRTSize || size.height() > maxRTSize) {
             return false;
         }
     } else {
@@ -308,7 +309,7 @@
             return false;
         }
         int maxSize = this->maxTextureSize();
-        if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
+        if (size.width() > maxSize || size.height() > maxSize) {
             return false;
         }
     }