ImageIndex: Consolidate layer/cube face.

In terms of the Texture or Image resource, a cube face
refers to a layer of a 2D texture. This layer has a special
meaning for cube textures, but it is represented as a layer
with a layer index. Cube array textures are no different,
they just use a different indexing scheme for the array
layers.

This also cleans up the ImageIndex helper to have a class
structure with private data, and cleans up a few cases to
use generic Make functions and iterators where they were
setting properties of the index directly.

This will make it easier to have ImageIndexes address
entire levels of a Cube map in the future, and makes the
layer count logic in Vulkan cleaner.

Bug: angleproject:2318
Change-Id: Iea9842e233f974a9896282ca224cb001f7882bd1
Reviewed-on: https://chromium-review.googlesource.com/987525
Reviewed-by: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp
index cdb79c9..29f11f5 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -2473,7 +2473,7 @@
         if (readColorAttachment && drawColorAttachment)
         {
             if (!(readColorAttachment->type() == GL_TEXTURE &&
-                  readColorAttachment->getTextureImageIndex().type == TextureType::_2D) &&
+                  readColorAttachment->getTextureImageIndex().getType() == TextureType::_2D) &&
                 readColorAttachment->type() != GL_RENDERBUFFER &&
                 readColorAttachment->type() != GL_FRAMEBUFFER_DEFAULT)
             {
@@ -2489,7 +2489,7 @@
                 if (attachment)
                 {
                     if (!(attachment->type() == GL_TEXTURE &&
-                          attachment->getTextureImageIndex().type == TextureType::_2D) &&
+                          attachment->getTextureImageIndex().getType() == TextureType::_2D) &&
                         attachment->type() != GL_RENDERBUFFER &&
                         attachment->type() != GL_FRAMEBUFFER_DEFAULT)
                     {