Remove last uses of gl::error in the Buffer classes.

BUG=angle:520

Change-Id: Id18e93b440da64360a6845a42a2664ae531b06f9
Reviewed-on: https://chromium-review.googlesource.com/218769
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/renderer/d3d/IndexDataManager.cpp b/src/libGLESv2/renderer/d3d/IndexDataManager.cpp
index 8d455b4..206ef39 100644
--- a/src/libGLESv2/renderer/d3d/IndexDataManager.cpp
+++ b/src/libGLESv2/renderer/d3d/IndexDataManager.cpp
@@ -97,7 +97,14 @@
 
         ASSERT(typeInfo.bytes * static_cast<unsigned int>(count) + offset <= storage->getSize());
 
-        indices = static_cast<const GLubyte*>(storage->getData()) + offset;
+        const uint8_t *bufferData = NULL;
+        gl::Error error = storage->getData(&bufferData);
+        if (error.isError())
+        {
+            return error;
+        }
+
+        indices = bufferData + offset;
     }
 
     StaticIndexBufferInterface *staticBuffer = storage ? storage->getStaticIndexBuffer() : NULL;
@@ -183,7 +190,16 @@
             return error;
         }
 
-        ConvertIndices(type, destinationIndexType, staticBuffer ? storage->getData() : indices, convertCount, output);
+        const uint8_t *dataPointer = reinterpret_cast<const uint8_t*>(indices);
+        if (staticBuffer)
+        {
+            error = storage->getData(&dataPointer);
+            if (error.isError())
+            {
+                return error;
+            }
+        }
+        ConvertIndices(type, destinationIndexType, dataPointer, convertCount, output);
 
         error = indexBuffer->unmapBuffer();
         if (error.isError())