Share data between VertexArray and Impl.

Using the same design as for the Framebuffer::Data helper, we can
use a struct to share between the object and the Impl. This also
gives the Impl access to the maxEnabledAttrib, and saves some
duplicated storage.

BUG=angleproject:1040
TEST=WebGL CTS, end2end_tests, unittests

Change-Id: I55c91e8a5f3dcae302cab441182320aafd5375ef
Reviewed-on: https://chromium-review.googlesource.com/283930
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 5179052..2896519 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -1406,7 +1406,7 @@
     const VertexArray *vao = state.getVertexArray();
     const auto &vertexAttribs = vao->getVertexAttributes();
     const int *semanticIndexes = program->getSemanticIndexes();
-    unsigned int maxEnabledAttrib = vao->getMaxEnabledAttribute();
+    size_t maxEnabledAttrib = vao->getMaxEnabledAttribute();
     for (size_t attributeIndex = 0; attributeIndex < maxEnabledAttrib; ++attributeIndex)
     {
         const VertexAttribute &attrib = vertexAttribs[attributeIndex];
@@ -1601,7 +1601,7 @@
     }
 
     const gl::VertexArray *vao = state.getVertexArray();
-    gl::Buffer *elementArrayBuffer = vao->getElementArrayBuffer();
+    gl::Buffer *elementArrayBuffer = vao->getElementArrayBuffer().get();
     if (!indices && !elementArrayBuffer)
     {
         context->recordError(Error(GL_INVALID_OPERATION));