Updated mipmap generation to return Error objects.

BUG=angle:520

Change-Id: Ic4e57148d031d6c452b3054efad98f6e730c7691
Reviewed-on: https://chromium-review.googlesource.com/221394
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index 0b6f22d..bc1b589 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -1766,7 +1766,12 @@
             }
         }
 
-        texture->generateMipmaps();
+        gl::Error error = texture->generateMipmaps();
+        if (error.isError())
+        {
+            context->recordError(error);
+            return;
+        }
     }
 }