Add an ImageIndex helper struct to index into tex levels.

This encapsulates the three values needed to index into the image
array. It will simplify the logic for querying texture images from
the base calss.

BUG=angle:732

Change-Id: I31c55b3f972fd4d96ab540ec8498ef4b9b2ba16b
Reviewed-on: https://chromium-review.googlesource.com/213856
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libGLESv2/Texture.cpp b/src/libGLESv2/Texture.cpp
index 4f74532..f5010b3 100644
--- a/src/libGLESv2/Texture.cpp
+++ b/src/libGLESv2/Texture.cpp
@@ -114,6 +114,30 @@
     return (baseImage ? baseImage->getInternalFormat() : GL_NONE);
 }
 
+GLsizei Texture::getWidth(const ImageIndex &index) const
+{
+    rx::Image *image = mTexture->getImage(index.mipIndex, index.layerIndex);
+    return image->getWidth();
+}
+
+GLsizei Texture::getHeight(const ImageIndex &index) const
+{
+    rx::Image *image = mTexture->getImage(index.mipIndex, index.layerIndex);
+    return image->getHeight();
+}
+
+GLenum Texture::getInternalFormat(const ImageIndex &index) const
+{
+    rx::Image *image = mTexture->getImage(index.mipIndex, index.layerIndex);
+    return image->getInternalFormat();
+}
+
+GLenum Texture::getActualFormat(const ImageIndex &index) const
+{
+    rx::Image *image = mTexture->getImage(index.mipIndex, index.layerIndex);
+    return image->getActualFormat();
+}
+
 rx::TextureStorageInterface *Texture::getNativeTexture()
 {
     return getImplementation()->getNativeTexture();