Fix validation in TexSubImage.

We weren't properly checking the x and y offsets against the texture
boundary, and were in some cases producing D3D errors with out-of-bounds
writes. This was popping up in IncompleteTextureTest. The test itself
was also bugged.

BUG=angle:610

Change-Id: Id58cac088fed03cae2aabbf00bce234f17208753
Reviewed-on: https://chromium-review.googlesource.com/195410
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index 069e571..6eb7b89 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -5166,14 +5166,14 @@
         {
             if (context->getClientVersion() < 3 &&
                 !ValidateES2TexImageParameters(context, target, level, GL_NONE, false, true,
-                                               0, 0, width, height, 0, format, type, pixels))
+                                               xoffset, yoffset, width, height, 0, format, type, pixels))
             {
                 return;
             }
 
             if (context->getClientVersion() >= 3 &&
                 !ValidateES3TexImageParameters(context, target, level, GL_NONE, false, true,
-                                               0, 0, 0, width, height, 1, 0, format, type, pixels))
+                                               xoffset, yoffset, 0, width, height, 1, 0, format, type, pixels))
             {
                 return;
             }