Update gpu caps for valid sample counts.

Instead of query and maxSampleCount and using that to cap, we now have
each config store its supported values and when requested returns either
the next highest or equal supported value, or if non the max config supported.

Bug: skia:
Change-Id: I8802d44c13b3b1703ee54a7e69b82102d4b8dc2d
Reviewed-on: https://skia-review.googlesource.com/24302
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index f9cefc5..c2a7734 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -157,9 +157,10 @@
                                     check_surface(reporter, proxy.get(), origin,
                                                   widthHeight, widthHeight, config,
                                                   kInvalidResourceID, budgeted);
+                                    int supportedSamples = caps.getSampleCount(numSamples, config);
                                     check_rendertarget(reporter, caps, provider,
                                                        proxy->asRenderTargetProxy(),
-                                                       SkTMin(numSamples, caps.maxSampleCount()),
+                                                       supportedSamples,
                                                        fit, caps.maxWindowRectangles(), false);
                                 }
                             }
@@ -214,9 +215,7 @@
         for (auto config : { kAlpha_8_GrPixelConfig, kRGBA_8888_GrPixelConfig }) {
             for (auto budgeted : { SkBudgeted::kYes, SkBudgeted::kNo }) {
                 for (auto numSamples: { 0, 4}) {
-                    if (caps.maxSampleCount() < numSamples) {
-                        continue;
-                    }
+                    int supportedNumSamples = caps.getSampleCount(numSamples, config);
 
                     bool renderable = caps.isConfigRenderable(config, numSamples > 0);
 
@@ -225,7 +224,7 @@
                     desc.fWidth = kWidthHeight;
                     desc.fHeight = kWidthHeight;
                     desc.fConfig = config;
-                    desc.fSampleCnt = numSamples;
+                    desc.fSampleCnt = supportedNumSamples;
 
                     // External on-screen render target.
                     if (renderable && kOpenGL_GrBackend == ctxInfo.backend()) {