Use the FormatCaps for multisample validation and queries.

BUG=angle:658

Change-Id: Ic9fa53fb62d7eff62f07b68d7ddada461ecad859
Reviewed-on: https://chromium-review.googlesource.com/206832
Tested-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index 5e2ec4a..3a45243 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -7904,10 +7904,12 @@
         {
           case GL_NUM_SAMPLE_COUNTS:
             if (bufSize != 0)
-                *params = context->getNumSampleCounts(internalformat);
+            {
+                *params = formatCaps.sampleCounts.size();
+            }
             break;
           case GL_SAMPLES:
-            context->getSampleCounts(internalformat, bufSize, params);
+            std::copy_n(formatCaps.sampleCounts.rbegin(), std::min<size_t>(bufSize, formatCaps.sampleCounts.size()), params);
             break;
           default:
             return gl::error(GL_INVALID_ENUM);