Correct subImage uses of texture type -> target.

Texture "types" are the same as texture "targets" except for cube maps.
Cube map targets specify a single face. Cube map types specify a whole
cube map. The subImage functions should take a target instead of a
type. We were using both in different places. This CL corrects all uses
in subImage calls to "target". It also adds a helper for getting a
target texture from a target. And clarifies the naming of the texture
query methods.

Bug: angleproject:3356
Change-Id: I06eb5c5666eec9b8934becf2ba57a066d5cdabde
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1558672
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp
index 035ddff..29505a4 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -1203,7 +1203,7 @@
             return false;
     }
 
-    gl::Texture *texture = context->getTargetTexture(texType);
+    gl::Texture *texture = context->getTextureByType(texType);
     if (!texture)
     {
         context->validationError(GL_INVALID_OPERATION, kBufferNotBound);
@@ -1905,7 +1905,7 @@
             break;
     }
 
-    gl::Texture *texture = context->getTargetTexture(target);
+    gl::Texture *texture = context->getTextureByType(target);
     if (!texture || texture->id() == 0)
     {
         context->validationError(GL_INVALID_OPERATION, kMissingTexture);
@@ -6225,7 +6225,7 @@
         return false;
     }
 
-    Texture *texture = context->getTargetTexture(target);
+    Texture *texture = context->getTextureByType(target);
 
     if (texture == nullptr)
     {