Fix npot Texture level 0 validation.

We were rejecting npot textures for level 0, even though it is
valid in GLES 2 for non-mipped textures to have npot size.

BUG=381495

Change-Id: Iacc3ab50d6487ecba804fd8963aa0a2ada2f1cae
Reviewed-on: https://chromium-review.googlesource.com/205220
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Change-Id: Iad3f5d007e878e60a87180bba3a2c1e246c311ca
Reviewed-on: https://chromium-review.googlesource.com/207121
Reviewed-by: Nicolas Capens <capn@chromium.org>
diff --git a/src/libGLESv2/validationES.cpp b/src/libGLESv2/validationES.cpp
index e44a0f7..03b8f71 100644
--- a/src/libGLESv2/validationES.cpp
+++ b/src/libGLESv2/validationES.cpp
@@ -166,14 +166,16 @@
     return level < maxLevel;
 }
 
-bool ValidImageSize(const gl::Context *context, GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth)
+bool ValidImageSize(const gl::Context *context, GLenum target, GLint level,
+                    GLsizei width, GLsizei height, GLsizei depth)
 {
     if (level < 0 || width < 0 || height < 0 || depth < 0)
     {
         return false;
     }
 
-    if (!context->supportsNonPower2Texture() && (level != 0 || !gl::isPow2(width) || !gl::isPow2(height) || !gl::isPow2(depth)))
+    if (!context->supportsNonPower2Texture() &&
+        (level != 0 && (!gl::isPow2(width) || !gl::isPow2(height) || !gl::isPow2(depth))))
     {
         return false;
     }