Refactor TextureFormatMap to store an array.

std::map lookups are already showing up as a hot spot during some
profile trace analysis. We can elimintate these by only doing a
single switch at the entry point level to convert the GL internal
format to an internal identifier or type info pointer.

This change doesn't completely fix the hot spot, since now we are
doing multiple switch statements, but it does remove the std::map
storage in TextureCapsMap. It replaces it with a flat std::array
indexed by angle::Format::ID, and gives us the option in the future
to eliminate all by one switch statement.

This should allow for a faster texture caps implementation in Vulkan.

This also fixes the missing ANGLE format entries for ETC1 compressed
formats.

BUG=angleproject:2207

Change-Id: I74ea2082e582a6790d5fde90e33246a618a2da0e
Reviewed-on: https://chromium-review.googlesource.com/742375
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index c4a132b..eb0b424 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -41,6 +41,7 @@
 #include "libANGLE/queryutils.h"
 #include "libANGLE/renderer/ContextImpl.h"
 #include "libANGLE/renderer/EGLImplFactory.h"
+#include "libANGLE/renderer/Format.h"
 #include "libANGLE/validationES.h"
 
 namespace
@@ -2738,11 +2739,9 @@
     mCaps.compressedTextureFormats.clear();
     mTextureCaps.clear();
 
-    for (auto capsIt : mImplementation->getNativeTextureCaps())
+    for (GLenum sizedInternalFormat : GetAllSizedInternalFormats())
     {
-        GLenum sizedInternalFormat = capsIt.first;
-        TextureCaps formatCaps     = capsIt.second;
-
+        TextureCaps formatCaps = mImplementation->getNativeTextureCaps().get(sizedInternalFormat);
         const InternalFormat &formatInfo = GetSizedInternalFormatInfo(sizedInternalFormat);
 
         // Update the format caps based on the client version and extensions.