Use angle::Result in front-end (Part 5)

Refactors gl::Buffer and implementation.

Bug: angleproject:2491
Change-Id: Ic6860dac2faf33067965e7117ea8e98dc6a8dc7a
Reviewed-on: https://chromium-review.googlesource.com/c/1283310
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Buffer.cpp b/src/libANGLE/Buffer.cpp
index 653faa5..c506a34 100644
--- a/src/libANGLE/Buffer.cpp
+++ b/src/libANGLE/Buffer.cpp
@@ -71,11 +71,11 @@
     return mState.mLabel;
 }
 
-Error Buffer::bufferData(Context *context,
-                         BufferBinding target,
-                         const void *data,
-                         GLsizeiptr size,
-                         BufferUsage usage)
+angle::Result Buffer::bufferData(Context *context,
+                                 BufferBinding target,
+                                 const void *data,
+                                 GLsizeiptr size,
+                                 BufferUsage usage)
 {
     const void *dataForImpl = data;
 
@@ -99,14 +99,14 @@
     // Notify when storage changes.
     onStateChange(context, angle::SubjectMessage::STORAGE_CHANGED);
 
-    return NoError();
+    return angle::Result::Continue();
 }
 
-Error Buffer::bufferSubData(const Context *context,
-                            BufferBinding target,
-                            const void *data,
-                            GLsizeiptr size,
-                            GLintptr offset)
+angle::Result Buffer::bufferSubData(const Context *context,
+                                    BufferBinding target,
+                                    const void *data,
+                                    GLsizeiptr size,
+                                    GLintptr offset)
 {
     ANGLE_TRY(mImpl->setSubData(context, target, data, size, offset));
 
@@ -115,14 +115,14 @@
     // Notify when data changes.
     onStateChange(context, angle::SubjectMessage::CONTENTS_CHANGED);
 
-    return NoError();
+    return angle::Result::Continue();
 }
 
-Error Buffer::copyBufferSubData(const Context *context,
-                                Buffer *source,
-                                GLintptr sourceOffset,
-                                GLintptr destOffset,
-                                GLsizeiptr size)
+angle::Result Buffer::copyBufferSubData(const Context *context,
+                                        Buffer *source,
+                                        GLintptr sourceOffset,
+                                        GLintptr destOffset,
+                                        GLsizeiptr size)
 {
     ANGLE_TRY(
         mImpl->copySubData(context, source->getImplementation(), sourceOffset, destOffset, size));
@@ -132,10 +132,10 @@
     // Notify when data changes.
     onStateChange(context, angle::SubjectMessage::CONTENTS_CHANGED);
 
-    return NoError();
+    return angle::Result::Continue();
 }
 
-Error Buffer::map(const Context *context, GLenum access)
+angle::Result Buffer::map(const Context *context, GLenum access)
 {
     ASSERT(!mState.mMapped);
 
@@ -154,13 +154,13 @@
     // Notify when state changes.
     onStateChange(context, angle::SubjectMessage::RESOURCE_MAPPED);
 
-    return NoError();
+    return angle::Result::Continue();
 }
 
-Error Buffer::mapRange(const Context *context,
-                       GLintptr offset,
-                       GLsizeiptr length,
-                       GLbitfield access)
+angle::Result Buffer::mapRange(const Context *context,
+                               GLintptr offset,
+                               GLsizeiptr length,
+                               GLbitfield access)
 {
     ASSERT(!mState.mMapped);
     ASSERT(offset + length <= mState.mSize);
@@ -187,10 +187,10 @@
     // Notify when state changes.
     onStateChange(context, angle::SubjectMessage::RESOURCE_MAPPED);
 
-    return NoError();
+    return angle::Result::Continue();
 }
 
-Error Buffer::unmap(const Context *context, GLboolean *result)
+angle::Result Buffer::unmap(const Context *context, GLboolean *result)
 {
     ASSERT(mState.mMapped);
 
@@ -207,7 +207,7 @@
     // Notify when data changes.
     onStateChange(context, angle::SubjectMessage::RESOURCE_UNMAPPED);
 
-    return NoError();
+    return angle::Result::Continue();
 }
 
 void Buffer::onTransformFeedback(const Context *context)
@@ -226,16 +226,16 @@
     onStateChange(context, angle::SubjectMessage::CONTENTS_CHANGED);
 }
 
-Error Buffer::getIndexRange(const gl::Context *context,
-                            GLenum type,
-                            size_t offset,
-                            size_t count,
-                            bool primitiveRestartEnabled,
-                            IndexRange *outRange) const
+angle::Result Buffer::getIndexRange(const gl::Context *context,
+                                    GLenum type,
+                                    size_t offset,
+                                    size_t count,
+                                    bool primitiveRestartEnabled,
+                                    IndexRange *outRange) const
 {
     if (mIndexRangeCache.findRange(type, offset, count, primitiveRestartEnabled, outRange))
     {
-        return NoError();
+        return angle::Result::Continue();
     }
 
     ANGLE_TRY(
@@ -243,7 +243,7 @@
 
     mIndexRangeCache.addRange(type, offset, count, primitiveRestartEnabled, *outRange);
 
-    return NoError();
+    return angle::Result::Continue();
 }
 
 GLint Buffer::getMemorySize() const
diff --git a/src/libANGLE/Buffer.h b/src/libANGLE/Buffer.h
index 629218a..6599957 100644
--- a/src/libANGLE/Buffer.h
+++ b/src/libANGLE/Buffer.h
@@ -36,8 +36,6 @@
     BufferState();
     ~BufferState();
 
-    const std::string &getLabel();
-
     BufferUsage getUsage() const { return mUsage; }
     GLbitfield getAccessFlags() const { return mAccessFlags; }
     GLenum getAccess() const { return mAccess; }
@@ -78,35 +76,38 @@
     void setLabel(const std::string &label) override;
     const std::string &getLabel() const override;
 
-    Error bufferData(Context *context,
-                     BufferBinding target,
-                     const void *data,
-                     GLsizeiptr size,
-                     BufferUsage usage);
-    Error bufferSubData(const Context *context,
-                        BufferBinding target,
-                        const void *data,
-                        GLsizeiptr size,
-                        GLintptr offset);
-    Error copyBufferSubData(const Context *context,
-                            Buffer *source,
-                            GLintptr sourceOffset,
-                            GLintptr destOffset,
-                            GLsizeiptr size);
-    Error map(const Context *context, GLenum access);
-    Error mapRange(const Context *context, GLintptr offset, GLsizeiptr length, GLbitfield access);
-    Error unmap(const Context *context, GLboolean *result);
+    angle::Result bufferData(Context *context,
+                             BufferBinding target,
+                             const void *data,
+                             GLsizeiptr size,
+                             BufferUsage usage);
+    angle::Result bufferSubData(const Context *context,
+                                BufferBinding target,
+                                const void *data,
+                                GLsizeiptr size,
+                                GLintptr offset);
+    angle::Result copyBufferSubData(const Context *context,
+                                    Buffer *source,
+                                    GLintptr sourceOffset,
+                                    GLintptr destOffset,
+                                    GLsizeiptr size);
+    angle::Result map(const Context *context, GLenum access);
+    angle::Result mapRange(const Context *context,
+                           GLintptr offset,
+                           GLsizeiptr length,
+                           GLbitfield access);
+    angle::Result unmap(const Context *context, GLboolean *result);
 
     // These are called when another operation changes Buffer data.
     void onTransformFeedback(const Context *context);
     void onPixelPack(const Context *context);
 
-    Error getIndexRange(const gl::Context *context,
-                        GLenum type,
-                        size_t offset,
-                        size_t count,
-                        bool primitiveRestartEnabled,
-                        IndexRange *outRange) const;
+    angle::Result getIndexRange(const gl::Context *context,
+                                GLenum type,
+                                size_t offset,
+                                size_t count,
+                                bool primitiveRestartEnabled,
+                                IndexRange *outRange) const;
 
     BufferUsage getUsage() const { return mState.mUsage; }
     GLbitfield getAccessFlags() const { return mState.mAccessFlags; }
diff --git a/src/libANGLE/renderer/BufferImpl.h b/src/libANGLE/renderer/BufferImpl.h
index dc5748a..4e5030b 100644
--- a/src/libANGLE/renderer/BufferImpl.h
+++ b/src/libANGLE/renderer/BufferImpl.h
@@ -35,35 +35,35 @@
     virtual ~BufferImpl() {}
     virtual void destroy(const gl::Context *context) {}
 
-    virtual gl::Error setData(const gl::Context *context,
-                              gl::BufferBinding target,
-                              const void *data,
-                              size_t size,
-                              gl::BufferUsage usage)                                = 0;
-    virtual gl::Error setSubData(const gl::Context *context,
-                                 gl::BufferBinding target,
-                                 const void *data,
-                                 size_t size,
-                                 size_t offset)                                     = 0;
-    virtual gl::Error copySubData(const gl::Context *context,
-                                  BufferImpl *source,
-                                  GLintptr sourceOffset,
-                                  GLintptr destOffset,
-                                  GLsizeiptr size)                                  = 0;
-    virtual gl::Error map(const gl::Context *context, GLenum access, void **mapPtr) = 0;
-    virtual gl::Error mapRange(const gl::Context *context,
-                               size_t offset,
-                               size_t length,
-                               GLbitfield access,
-                               void **mapPtr)                                       = 0;
-    virtual gl::Error unmap(const gl::Context *context, GLboolean *result)          = 0;
+    virtual angle::Result setData(const gl::Context *context,
+                                  gl::BufferBinding target,
+                                  const void *data,
+                                  size_t size,
+                                  gl::BufferUsage usage)                                = 0;
+    virtual angle::Result setSubData(const gl::Context *context,
+                                     gl::BufferBinding target,
+                                     const void *data,
+                                     size_t size,
+                                     size_t offset)                                     = 0;
+    virtual angle::Result copySubData(const gl::Context *context,
+                                      BufferImpl *source,
+                                      GLintptr sourceOffset,
+                                      GLintptr destOffset,
+                                      GLsizeiptr size)                                  = 0;
+    virtual angle::Result map(const gl::Context *context, GLenum access, void **mapPtr) = 0;
+    virtual angle::Result mapRange(const gl::Context *context,
+                                   size_t offset,
+                                   size_t length,
+                                   GLbitfield access,
+                                   void **mapPtr)                                       = 0;
+    virtual angle::Result unmap(const gl::Context *context, GLboolean *result)          = 0;
 
-    virtual gl::Error getIndexRange(const gl::Context *context,
-                                    GLenum type,
-                                    size_t offset,
-                                    size_t count,
-                                    bool primitiveRestartEnabled,
-                                    gl::IndexRange *outRange) = 0;
+    virtual angle::Result getIndexRange(const gl::Context *context,
+                                        GLenum type,
+                                        size_t offset,
+                                        size_t count,
+                                        bool primitiveRestartEnabled,
+                                        gl::IndexRange *outRange) = 0;
 
     // Override if accurate native memory size information is available
     virtual GLint getMemorySize() const { return 0; }
diff --git a/src/libANGLE/renderer/BufferImpl_mock.h b/src/libANGLE/renderer/BufferImpl_mock.h
index 5a4e210..94298b9 100644
--- a/src/libANGLE/renderer/BufferImpl_mock.h
+++ b/src/libANGLE/renderer/BufferImpl_mock.h
@@ -22,21 +22,30 @@
     MockBufferImpl() : BufferImpl(mMockState) {}
     ~MockBufferImpl() { destructor(); }
 
+    MOCK_METHOD5(setData,
+                 angle::Result(const gl::Context *,
+                               gl::BufferBinding,
+                               const void *,
+                               size_t,
+                               gl::BufferUsage));
     MOCK_METHOD5(
-        setData,
-        gl::Error(const gl::Context *, gl::BufferBinding, const void *, size_t, gl::BufferUsage));
-    MOCK_METHOD5(setSubData,
-                 gl::Error(const gl::Context *, gl::BufferBinding, const void *, size_t, size_t));
+        setSubData,
+        angle::Result(const gl::Context *, gl::BufferBinding, const void *, size_t, size_t));
+    MOCK_METHOD5(copySubData,
+                 angle::Result(const gl::Context *contextImpl,
+                               BufferImpl *,
+                               GLintptr,
+                               GLintptr,
+                               GLsizeiptr));
+    MOCK_METHOD3(map, angle::Result(const gl::Context *contextImpl, GLenum, void **));
     MOCK_METHOD5(
-        copySubData,
-        gl::Error(const gl::Context *contextImpl, BufferImpl *, GLintptr, GLintptr, GLsizeiptr));
-    MOCK_METHOD3(map, gl::Error(const gl::Context *contextImpl, GLenum, void **));
-    MOCK_METHOD5(mapRange,
-                 gl::Error(const gl::Context *contextImpl, size_t, size_t, GLbitfield, void **));
-    MOCK_METHOD2(unmap, gl::Error(const gl::Context *contextImpl, GLboolean *result));
+        mapRange,
+        angle::Result(const gl::Context *contextImpl, size_t, size_t, GLbitfield, void **));
+    MOCK_METHOD2(unmap, angle::Result(const gl::Context *contextImpl, GLboolean *result));
 
-    MOCK_METHOD6(getIndexRange,
-                 gl::Error(const gl::Context *, GLenum, size_t, size_t, bool, gl::IndexRange *));
+    MOCK_METHOD6(
+        getIndexRange,
+        angle::Result(const gl::Context *, GLenum, size_t, size_t, bool, gl::IndexRange *));
 
     MOCK_METHOD0(destructor, void());
 
diff --git a/src/libANGLE/renderer/d3d/BufferD3D.cpp b/src/libANGLE/renderer/d3d/BufferD3D.cpp
index 3df7e4f..8c0444a 100644
--- a/src/libANGLE/renderer/d3d/BufferD3D.cpp
+++ b/src/libANGLE/renderer/d3d/BufferD3D.cpp
@@ -174,18 +174,18 @@
     }
 }
 
-gl::Error BufferD3D::getIndexRange(const gl::Context *context,
-                                   GLenum type,
-                                   size_t offset,
-                                   size_t count,
-                                   bool primitiveRestartEnabled,
-                                   gl::IndexRange *outRange)
+angle::Result BufferD3D::getIndexRange(const gl::Context *context,
+                                       GLenum type,
+                                       size_t offset,
+                                       size_t count,
+                                       bool primitiveRestartEnabled,
+                                       gl::IndexRange *outRange)
 {
     const uint8_t *data = nullptr;
     ANGLE_TRY(getData(context, &data));
 
     *outRange = gl::ComputeIndexRange(type, data + offset, count, primitiveRestartEnabled);
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 }  // namespace rx
diff --git a/src/libANGLE/renderer/d3d/BufferD3D.h b/src/libANGLE/renderer/d3d/BufferD3D.h
index dfb6bee..765b8b3 100644
--- a/src/libANGLE/renderer/d3d/BufferD3D.h
+++ b/src/libANGLE/renderer/d3d/BufferD3D.h
@@ -57,12 +57,12 @@
 
     void promoteStaticUsage(const gl::Context *context, size_t dataSize);
 
-    gl::Error getIndexRange(const gl::Context *context,
-                            GLenum type,
-                            size_t offset,
-                            size_t count,
-                            bool primitiveRestartEnabled,
-                            gl::IndexRange *outRange) override;
+    angle::Result getIndexRange(const gl::Context *context,
+                                GLenum type,
+                                size_t offset,
+                                size_t count,
+                                bool primitiveRestartEnabled,
+                                gl::IndexRange *outRange) override;
 
     BufferFactoryD3D *getFactory() const { return mFactory; }
     D3DBufferUsage getUsage() const { return mUsage; }
diff --git a/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp b/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
index a120938..f452ea4 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
@@ -337,15 +337,14 @@
     mRenderer->onBufferDelete(this);
 }
 
-gl::Error Buffer11::setData(const gl::Context *context,
-                            gl::BufferBinding target,
-                            const void *data,
-                            size_t size,
-                            gl::BufferUsage usage)
+angle::Result Buffer11::setData(const gl::Context *context,
+                                gl::BufferBinding target,
+                                const void *data,
+                                size_t size,
+                                gl::BufferUsage usage)
 {
     updateD3DBufferUsage(context, usage);
-    ANGLE_TRY(setSubData(context, target, data, size, 0));
-    return gl::NoError();
+    return setSubData(context, target, data, size, 0);
 }
 
 angle::Result Buffer11::getData(const gl::Context *context, const uint8_t **outData)
@@ -367,11 +366,11 @@
     return angle::Result::Continue();
 }
 
-gl::Error Buffer11::setSubData(const gl::Context *context,
-                               gl::BufferBinding target,
-                               const void *data,
-                               size_t size,
-                               size_t offset)
+angle::Result Buffer11::setSubData(const gl::Context *context,
+                                   gl::BufferBinding target,
+                                   const void *data,
+                                   size_t size,
+                                   size_t offset)
 {
     size_t requiredSize = size + offset;
 
@@ -424,14 +423,14 @@
     mSize = std::max(mSize, requiredSize);
     invalidateStaticData(context);
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error Buffer11::copySubData(const gl::Context *context,
-                                BufferImpl *source,
-                                GLintptr sourceOffset,
-                                GLintptr destOffset,
-                                GLsizeiptr size)
+angle::Result Buffer11::copySubData(const gl::Context *context,
+                                    BufferImpl *source,
+                                    GLintptr sourceOffset,
+                                    GLintptr destOffset,
+                                    GLsizeiptr size)
 {
     Buffer11 *sourceBuffer = GetAs<Buffer11>(source);
     ASSERT(sourceBuffer != nullptr);
@@ -488,10 +487,10 @@
     mSize = std::max<size_t>(mSize, destOffset + size);
     invalidateStaticData(context);
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error Buffer11::map(const gl::Context *context, GLenum access, void **mapPtr)
+angle::Result Buffer11::map(const gl::Context *context, GLenum access, void **mapPtr)
 {
     // GL_OES_mapbuffer uses an enum instead of a bitfield for it's access, convert to a bitfield
     // and call mapRange.
@@ -499,11 +498,11 @@
     return mapRange(context, 0, mSize, GL_MAP_WRITE_BIT, mapPtr);
 }
 
-gl::Error Buffer11::mapRange(const gl::Context *context,
-                             size_t offset,
-                             size_t length,
-                             GLbitfield access,
-                             void **mapPtr)
+angle::Result Buffer11::mapRange(const gl::Context *context,
+                                 size_t offset,
+                                 size_t length,
+                                 GLbitfield access,
+                                 void **mapPtr)
 {
     ASSERT(!mMappedStorage);
 
@@ -538,10 +537,10 @@
     ASSERT(mappedBuffer);
 
     *mapPtr = static_cast<void *>(mappedBuffer);
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error Buffer11::unmap(const gl::Context *context, GLboolean *result)
+angle::Result Buffer11::unmap(const gl::Context *context, GLboolean *result)
 {
     ASSERT(mMappedStorage);
     mMappedStorage->unmap();
@@ -550,7 +549,7 @@
     // TODO: detect if we had corruption. if so, return false.
     *result = GL_TRUE;
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 angle::Result Buffer11::markTransformFeedbackUsage(const gl::Context *context)
diff --git a/src/libANGLE/renderer/d3d/d3d11/Buffer11.h b/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
index 1175409..ba3773e 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
+++ b/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
@@ -85,28 +85,28 @@
     void invalidateStaticData(const gl::Context *context) override;
 
     // BufferImpl implementation
-    gl::Error setData(const gl::Context *context,
-                      gl::BufferBinding target,
-                      const void *data,
-                      size_t size,
-                      gl::BufferUsage usage) override;
-    gl::Error setSubData(const gl::Context *context,
-                         gl::BufferBinding target,
-                         const void *data,
-                         size_t size,
-                         size_t offset) override;
-    gl::Error copySubData(const gl::Context *context,
-                          BufferImpl *source,
-                          GLintptr sourceOffset,
-                          GLintptr destOffset,
-                          GLsizeiptr size) override;
-    gl::Error map(const gl::Context *context, GLenum access, void **mapPtr) override;
-    gl::Error mapRange(const gl::Context *context,
-                       size_t offset,
-                       size_t length,
-                       GLbitfield access,
-                       void **mapPtr) override;
-    gl::Error unmap(const gl::Context *context, GLboolean *result) override;
+    angle::Result setData(const gl::Context *context,
+                          gl::BufferBinding target,
+                          const void *data,
+                          size_t size,
+                          gl::BufferUsage usage) override;
+    angle::Result setSubData(const gl::Context *context,
+                             gl::BufferBinding target,
+                             const void *data,
+                             size_t size,
+                             size_t offset) override;
+    angle::Result copySubData(const gl::Context *context,
+                              BufferImpl *source,
+                              GLintptr sourceOffset,
+                              GLintptr destOffset,
+                              GLsizeiptr size) override;
+    angle::Result map(const gl::Context *context, GLenum access, void **mapPtr) override;
+    angle::Result mapRange(const gl::Context *context,
+                           size_t offset,
+                           size_t length,
+                           GLbitfield access,
+                           void **mapPtr) override;
+    angle::Result unmap(const gl::Context *context, GLboolean *result) override;
     angle::Result markTransformFeedbackUsage(const gl::Context *context) override;
 
   private:
diff --git a/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp b/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp
index be239b6..ed2a1c7 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp
@@ -34,18 +34,15 @@
     return false;
 }
 
-gl::Error Buffer9::setData(const gl::Context *context,
-                           gl::BufferBinding /*target*/,
-                           const void *data,
-                           size_t size,
-                           gl::BufferUsage usage)
+angle::Result Buffer9::setData(const gl::Context *context,
+                               gl::BufferBinding target,
+                               const void *data,
+                               size_t size,
+                               gl::BufferUsage usage)
 {
     if (size > mMemory.size())
     {
-        if (!mMemory.resize(size))
-        {
-            return gl::OutOfMemory() << "Failed to resize internal buffer.";
-        }
+        ANGLE_CHECK_HR_ALLOC(GetImplAs<Context9>(context), mMemory.resize(size));
     }
 
     mSize = size;
@@ -58,7 +55,7 @@
 
     invalidateStaticData(context);
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 angle::Result Buffer9::getData(const gl::Context *context, const uint8_t **outData)
@@ -67,18 +64,15 @@
     return angle::Result::Continue();
 }
 
-gl::Error Buffer9::setSubData(const gl::Context *context,
-                              gl::BufferBinding /*target*/,
-                              const void *data,
-                              size_t size,
-                              size_t offset)
+angle::Result Buffer9::setSubData(const gl::Context *context,
+                                  gl::BufferBinding target,
+                                  const void *data,
+                                  size_t size,
+                                  size_t offset)
 {
     if (offset + size > mMemory.size())
     {
-        if (!mMemory.resize(offset + size))
-        {
-            return gl::OutOfMemory() << "Failed to resize internal buffer.";
-        }
+        ANGLE_CHECK_HR_ALLOC(GetImplAs<Context9>(context), mMemory.resize(size + offset));
     }
 
     mSize = std::max(mSize, offset + size);
@@ -89,14 +83,14 @@
 
     invalidateStaticData(context);
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error Buffer9::copySubData(const gl::Context *context,
-                               BufferImpl *source,
-                               GLintptr sourceOffset,
-                               GLintptr destOffset,
-                               GLsizeiptr size)
+angle::Result Buffer9::copySubData(const gl::Context *context,
+                                   BufferImpl *source,
+                                   GLintptr sourceOffset,
+                                   GLintptr destOffset,
+                                   GLsizeiptr size)
 {
     // Note: this method is currently unreachable
     Buffer9 *sourceBuffer = GetAs<Buffer9>(source);
@@ -106,30 +100,30 @@
 
     invalidateStaticData(context);
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 // We do not support buffer mapping in D3D9
-gl::Error Buffer9::map(const gl::Context *context, GLenum access, void **mapPtr)
+angle::Result Buffer9::map(const gl::Context *context, GLenum access, void **mapPtr)
 {
-    UNREACHABLE();
-    return gl::InternalError();
+    ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
+    return angle::Result::Stop();
 }
 
-gl::Error Buffer9::mapRange(const gl::Context *context,
-                            size_t offset,
-                            size_t length,
-                            GLbitfield access,
-                            void **mapPtr)
+angle::Result Buffer9::mapRange(const gl::Context *context,
+                                size_t offset,
+                                size_t length,
+                                GLbitfield access,
+                                void **mapPtr)
 {
-    UNREACHABLE();
-    return gl::InternalError();
+    ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
+    return angle::Result::Stop();
 }
 
-gl::Error Buffer9::unmap(const gl::Context *context, GLboolean *result)
+angle::Result Buffer9::unmap(const gl::Context *context, GLboolean *result)
 {
-    UNREACHABLE();
-    return gl::InternalError();
+    ANGLE_HR_UNREACHABLE(GetImplAs<Context9>(context));
+    return angle::Result::Stop();
 }
 
 angle::Result Buffer9::markTransformFeedbackUsage(const gl::Context *context)
diff --git a/src/libANGLE/renderer/d3d/d3d9/Buffer9.h b/src/libANGLE/renderer/d3d/d3d9/Buffer9.h
index d5e8e5e..dad120d 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Buffer9.h
+++ b/src/libANGLE/renderer/d3d/d3d9/Buffer9.h
@@ -29,28 +29,28 @@
     angle::Result getData(const gl::Context *context, const uint8_t **outData) override;
 
     // BufferImpl implementation
-    gl::Error setData(const gl::Context *context,
-                      gl::BufferBinding target,
-                      const void *data,
-                      size_t size,
-                      gl::BufferUsage usage) override;
-    gl::Error setSubData(const gl::Context *context,
-                         gl::BufferBinding target,
-                         const void *data,
-                         size_t size,
-                         size_t offset) override;
-    gl::Error copySubData(const gl::Context *context,
-                          BufferImpl *source,
-                          GLintptr sourceOffset,
-                          GLintptr destOffset,
-                          GLsizeiptr size) override;
-    gl::Error map(const gl::Context *context, GLenum access, void **mapPtr) override;
-    gl::Error mapRange(const gl::Context *context,
-                       size_t offset,
-                       size_t length,
-                       GLbitfield access,
-                       void **mapPtr) override;
-    gl::Error unmap(const gl::Context *context, GLboolean *result) override;
+    angle::Result setData(const gl::Context *context,
+                          gl::BufferBinding target,
+                          const void *data,
+                          size_t size,
+                          gl::BufferUsage usage) override;
+    angle::Result setSubData(const gl::Context *context,
+                             gl::BufferBinding target,
+                             const void *data,
+                             size_t size,
+                             size_t offset) override;
+    angle::Result copySubData(const gl::Context *context,
+                              BufferImpl *source,
+                              GLintptr sourceOffset,
+                              GLintptr destOffset,
+                              GLsizeiptr size) override;
+    angle::Result map(const gl::Context *context, GLenum access, void **mapPtr) override;
+    angle::Result mapRange(const gl::Context *context,
+                           size_t offset,
+                           size_t length,
+                           GLbitfield access,
+                           void **mapPtr) override;
+    angle::Result unmap(const gl::Context *context, GLboolean *result) override;
     angle::Result markTransformFeedbackUsage(const gl::Context *context) override;
 
   private:
diff --git a/src/libANGLE/renderer/gl/BufferGL.cpp b/src/libANGLE/renderer/gl/BufferGL.cpp
index 50cc467..0417ab1 100644
--- a/src/libANGLE/renderer/gl/BufferGL.cpp
+++ b/src/libANGLE/renderer/gl/BufferGL.cpp
@@ -10,8 +10,10 @@
 
 #include "common/debug.h"
 #include "common/utilities.h"
+#include "libANGLE/Context.h"
 #include "libANGLE/angletypes.h"
 #include "libANGLE/formatutils.h"
+#include "libANGLE/renderer/gl/ContextGL.h"
 #include "libANGLE/renderer/gl/FunctionsGL.h"
 #include "libANGLE/renderer/gl/StateManagerGL.h"
 #include "libANGLE/renderer/gl/renderergl_utils.h"
@@ -55,21 +57,18 @@
     mBufferID = 0;
 }
 
-gl::Error BufferGL::setData(const gl::Context * /*context*/,
-                            gl::BufferBinding /*target*/,
-                            const void *data,
-                            size_t size,
-                            gl::BufferUsage usage)
+angle::Result BufferGL::setData(const gl::Context *context,
+                                gl::BufferBinding target,
+                                const void *data,
+                                size_t size,
+                                gl::BufferUsage usage)
 {
     mStateManager->bindBuffer(DestBufferOperationTarget, mBufferID);
     mFunctions->bufferData(gl::ToGLenum(DestBufferOperationTarget), size, data, ToGLenum(usage));
 
     if (mShadowBufferData)
     {
-        if (!mShadowCopy.resize(size))
-        {
-            return gl::OutOfMemory() << "Failed to resize buffer data shadow copy.";
-        }
+        ANGLE_CHECK_GL_ALLOC(GetImplAs<ContextGL>(context), mShadowCopy.resize(size));
 
         if (size > 0 && data != nullptr)
         {
@@ -79,14 +78,14 @@
 
     mBufferSize = size;
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferGL::setSubData(const gl::Context * /*context*/,
-                               gl::BufferBinding /*target*/,
-                               const void *data,
-                               size_t size,
-                               size_t offset)
+angle::Result BufferGL::setSubData(const gl::Context *context,
+                                   gl::BufferBinding target,
+                                   const void *data,
+                                   size_t size,
+                                   size_t offset)
 {
     mStateManager->bindBuffer(DestBufferOperationTarget, mBufferID);
     mFunctions->bufferSubData(gl::ToGLenum(DestBufferOperationTarget), offset, size, data);
@@ -96,14 +95,14 @@
         memcpy(mShadowCopy.data() + offset, data, size);
     }
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferGL::copySubData(const gl::Context *context,
-                                BufferImpl *source,
-                                GLintptr sourceOffset,
-                                GLintptr destOffset,
-                                GLsizeiptr size)
+angle::Result BufferGL::copySubData(const gl::Context *context,
+                                    BufferImpl *source,
+                                    GLintptr sourceOffset,
+                                    GLintptr destOffset,
+                                    GLsizeiptr size)
 {
     BufferGL *sourceGL = GetAs<BufferGL>(source);
 
@@ -120,10 +119,10 @@
         memcpy(mShadowCopy.data() + destOffset, sourceGL->mShadowCopy.data() + sourceOffset, size);
     }
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferGL::map(const gl::Context *context, GLenum access, void **mapPtr)
+angle::Result BufferGL::map(const gl::Context *context, GLenum access, void **mapPtr)
 {
     if (mShadowBufferData)
     {
@@ -146,14 +145,14 @@
     mMapOffset = 0;
     mMapSize   = mBufferSize;
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferGL::mapRange(const gl::Context *context,
-                             size_t offset,
-                             size_t length,
-                             GLbitfield access,
-                             void **mapPtr)
+angle::Result BufferGL::mapRange(const gl::Context *context,
+                                 size_t offset,
+                                 size_t length,
+                                 GLbitfield access,
+                                 void **mapPtr)
 {
     if (mShadowBufferData)
     {
@@ -170,10 +169,10 @@
     mMapOffset = offset;
     mMapSize   = length;
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferGL::unmap(const gl::Context *context, GLboolean *result)
+angle::Result BufferGL::unmap(const gl::Context *context, GLboolean *result)
 {
     ASSERT(result);
     ASSERT(mIsMapped);
@@ -192,15 +191,15 @@
     }
 
     mIsMapped = false;
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferGL::getIndexRange(const gl::Context *context,
-                                  GLenum type,
-                                  size_t offset,
-                                  size_t count,
-                                  bool primitiveRestartEnabled,
-                                  gl::IndexRange *outRange)
+angle::Result BufferGL::getIndexRange(const gl::Context *context,
+                                      GLenum type,
+                                      size_t offset,
+                                      size_t count,
+                                      bool primitiveRestartEnabled,
+                                      gl::IndexRange *outRange)
 {
     ASSERT(!mIsMapped);
 
@@ -221,7 +220,7 @@
         mFunctions->unmapBuffer(gl::ToGLenum(DestBufferOperationTarget));
     }
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 GLuint BufferGL::getBufferID() const
diff --git a/src/libANGLE/renderer/gl/BufferGL.h b/src/libANGLE/renderer/gl/BufferGL.h
index fbac40c..285da0c 100644
--- a/src/libANGLE/renderer/gl/BufferGL.h
+++ b/src/libANGLE/renderer/gl/BufferGL.h
@@ -26,35 +26,35 @@
              StateManagerGL *stateManager);
     ~BufferGL() override;
 
-    gl::Error setData(const gl::Context *context,
-                      gl::BufferBinding target,
-                      const void *data,
-                      size_t size,
-                      gl::BufferUsage usage) override;
-    gl::Error setSubData(const gl::Context *context,
-                         gl::BufferBinding target,
-                         const void *data,
-                         size_t size,
-                         size_t offset) override;
-    gl::Error copySubData(const gl::Context *context,
-                          BufferImpl *source,
-                          GLintptr sourceOffset,
-                          GLintptr destOffset,
-                          GLsizeiptr size) override;
-    gl::Error map(const gl::Context *context, GLenum access, void **mapPtr) override;
-    gl::Error mapRange(const gl::Context *context,
-                       size_t offset,
-                       size_t length,
-                       GLbitfield access,
-                       void **mapPtr) override;
-    gl::Error unmap(const gl::Context *context, GLboolean *result) override;
+    angle::Result setData(const gl::Context *context,
+                          gl::BufferBinding target,
+                          const void *data,
+                          size_t size,
+                          gl::BufferUsage usage) override;
+    angle::Result setSubData(const gl::Context *context,
+                             gl::BufferBinding target,
+                             const void *data,
+                             size_t size,
+                             size_t offset) override;
+    angle::Result copySubData(const gl::Context *context,
+                              BufferImpl *source,
+                              GLintptr sourceOffset,
+                              GLintptr destOffset,
+                              GLsizeiptr size) override;
+    angle::Result map(const gl::Context *context, GLenum access, void **mapPtr) override;
+    angle::Result mapRange(const gl::Context *context,
+                           size_t offset,
+                           size_t length,
+                           GLbitfield access,
+                           void **mapPtr) override;
+    angle::Result unmap(const gl::Context *context, GLboolean *result) override;
 
-    gl::Error getIndexRange(const gl::Context *context,
-                            GLenum type,
-                            size_t offset,
-                            size_t count,
-                            bool primitiveRestartEnabled,
-                            gl::IndexRange *outRange) override;
+    angle::Result getIndexRange(const gl::Context *context,
+                                GLenum type,
+                                size_t offset,
+                                size_t count,
+                                bool primitiveRestartEnabled,
+                                gl::IndexRange *outRange) override;
 
     GLuint getBufferID() const;
 
diff --git a/src/libANGLE/renderer/null/BufferNULL.cpp b/src/libANGLE/renderer/null/BufferNULL.cpp
index 08a67d6..310bd3e 100644
--- a/src/libANGLE/renderer/null/BufferNULL.cpp
+++ b/src/libANGLE/renderer/null/BufferNULL.cpp
@@ -11,6 +11,7 @@
 
 #include "common/debug.h"
 #include "common/utilities.h"
+#include "libANGLE/Context.h"
 #include "libANGLE/angletypes.h"
 #include "libANGLE/renderer/null/ContextNULL.h"
 
@@ -29,83 +30,81 @@
     ASSERT(memoryReleaseResult);
 }
 
-gl::Error BufferNULL::setData(const gl::Context *context,
-                              gl::BufferBinding target,
-                              const void *data,
-                              size_t size,
-                              gl::BufferUsage usage)
+angle::Result BufferNULL::setData(const gl::Context *context,
+                                  gl::BufferBinding target,
+                                  const void *data,
+                                  size_t size,
+                                  gl::BufferUsage usage)
 {
-    if (!mAllocationTracker->updateMemoryAllocation(mData.size(), size))
-    {
-        return gl::OutOfMemory() << "Unable to allocate internal buffer storage.";
-    }
+    ANGLE_CHECK_GL_ALLOC(GetImplAs<ContextNULL>(context),
+                         mAllocationTracker->updateMemoryAllocation(mData.size(), size));
 
     mData.resize(size, 0);
     if (size > 0 && data != nullptr)
     {
         memcpy(mData.data(), data, size);
     }
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferNULL::setSubData(const gl::Context *context,
-                                 gl::BufferBinding target,
-                                 const void *data,
-                                 size_t size,
-                                 size_t offset)
+angle::Result BufferNULL::setSubData(const gl::Context *context,
+                                     gl::BufferBinding target,
+                                     const void *data,
+                                     size_t size,
+                                     size_t offset)
 {
     if (size > 0)
     {
         memcpy(mData.data() + offset, data, size);
     }
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferNULL::copySubData(const gl::Context *context,
-                                  BufferImpl *source,
-                                  GLintptr sourceOffset,
-                                  GLintptr destOffset,
-                                  GLsizeiptr size)
+angle::Result BufferNULL::copySubData(const gl::Context *context,
+                                      BufferImpl *source,
+                                      GLintptr sourceOffset,
+                                      GLintptr destOffset,
+                                      GLsizeiptr size)
 {
     BufferNULL *sourceNULL = GetAs<BufferNULL>(source);
     if (size > 0)
     {
         memcpy(mData.data() + destOffset, sourceNULL->mData.data() + sourceOffset, size);
     }
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferNULL::map(const gl::Context *context, GLenum access, void **mapPtr)
+angle::Result BufferNULL::map(const gl::Context *context, GLenum access, void **mapPtr)
 {
     *mapPtr = mData.data();
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferNULL::mapRange(const gl::Context *context,
-                               size_t offset,
-                               size_t length,
-                               GLbitfield access,
-                               void **mapPtr)
+angle::Result BufferNULL::mapRange(const gl::Context *context,
+                                   size_t offset,
+                                   size_t length,
+                                   GLbitfield access,
+                                   void **mapPtr)
 {
     *mapPtr = mData.data() + offset;
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferNULL::unmap(const gl::Context *context, GLboolean *result)
+angle::Result BufferNULL::unmap(const gl::Context *context, GLboolean *result)
 {
     *result = GL_TRUE;
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferNULL::getIndexRange(const gl::Context *context,
-                                    GLenum type,
-                                    size_t offset,
-                                    size_t count,
-                                    bool primitiveRestartEnabled,
-                                    gl::IndexRange *outRange)
+angle::Result BufferNULL::getIndexRange(const gl::Context *context,
+                                        GLenum type,
+                                        size_t offset,
+                                        size_t count,
+                                        bool primitiveRestartEnabled,
+                                        gl::IndexRange *outRange)
 {
     *outRange = gl::ComputeIndexRange(type, mData.data() + offset, count, primitiveRestartEnabled);
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 uint8_t *BufferNULL::getDataPtr()
diff --git a/src/libANGLE/renderer/null/BufferNULL.h b/src/libANGLE/renderer/null/BufferNULL.h
index 1fa40e1..d136b68 100644
--- a/src/libANGLE/renderer/null/BufferNULL.h
+++ b/src/libANGLE/renderer/null/BufferNULL.h
@@ -23,35 +23,35 @@
     BufferNULL(const gl::BufferState &state, AllocationTrackerNULL *allocationTracker);
     ~BufferNULL() override;
 
-    gl::Error setData(const gl::Context *context,
-                      gl::BufferBinding target,
-                      const void *data,
-                      size_t size,
-                      gl::BufferUsage usage) override;
-    gl::Error setSubData(const gl::Context *context,
-                         gl::BufferBinding target,
-                         const void *data,
-                         size_t size,
-                         size_t offset) override;
-    gl::Error copySubData(const gl::Context *context,
-                          BufferImpl *source,
-                          GLintptr sourceOffset,
-                          GLintptr destOffset,
-                          GLsizeiptr size) override;
-    gl::Error map(const gl::Context *context, GLenum access, void **mapPtr) override;
-    gl::Error mapRange(const gl::Context *context,
-                       size_t offset,
-                       size_t length,
-                       GLbitfield access,
-                       void **mapPtr) override;
-    gl::Error unmap(const gl::Context *context, GLboolean *result) override;
+    angle::Result setData(const gl::Context *context,
+                          gl::BufferBinding target,
+                          const void *data,
+                          size_t size,
+                          gl::BufferUsage usage) override;
+    angle::Result setSubData(const gl::Context *context,
+                             gl::BufferBinding target,
+                             const void *data,
+                             size_t size,
+                             size_t offset) override;
+    angle::Result copySubData(const gl::Context *context,
+                              BufferImpl *source,
+                              GLintptr sourceOffset,
+                              GLintptr destOffset,
+                              GLsizeiptr size) override;
+    angle::Result map(const gl::Context *context, GLenum access, void **mapPtr) override;
+    angle::Result mapRange(const gl::Context *context,
+                           size_t offset,
+                           size_t length,
+                           GLbitfield access,
+                           void **mapPtr) override;
+    angle::Result unmap(const gl::Context *context, GLboolean *result) override;
 
-    gl::Error getIndexRange(const gl::Context *context,
-                            GLenum type,
-                            size_t offset,
-                            size_t count,
-                            bool primitiveRestartEnabled,
-                            gl::IndexRange *outRange) override;
+    angle::Result getIndexRange(const gl::Context *context,
+                                GLenum type,
+                                size_t offset,
+                                size_t count,
+                                bool primitiveRestartEnabled,
+                                gl::IndexRange *outRange) override;
 
     uint8_t *getDataPtr();
     const uint8_t *getDataPtr() const;
diff --git a/src/libANGLE/renderer/vulkan/BufferVk.cpp b/src/libANGLE/renderer/vulkan/BufferVk.cpp
index 7bb6c68..1a505a0 100644
--- a/src/libANGLE/renderer/vulkan/BufferVk.cpp
+++ b/src/libANGLE/renderer/vulkan/BufferVk.cpp
@@ -39,11 +39,11 @@
     mBuffer.release(renderer);
 }
 
-gl::Error BufferVk::setData(const gl::Context *context,
-                            gl::BufferBinding target,
-                            const void *data,
-                            size_t size,
-                            gl::BufferUsage usage)
+angle::Result BufferVk::setData(const gl::Context *context,
+                                gl::BufferBinding target,
+                                const void *data,
+                                size_t size,
+                                gl::BufferUsage usage)
 {
     ContextVk *contextVk = vk::GetImpl(context);
 
@@ -79,40 +79,39 @@
         ANGLE_TRY(setDataImpl(contextVk, static_cast<const uint8_t *>(data), size, 0));
     }
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferVk::setSubData(const gl::Context *context,
-                               gl::BufferBinding target,
-                               const void *data,
-                               size_t size,
-                               size_t offset)
+angle::Result BufferVk::setSubData(const gl::Context *context,
+                                   gl::BufferBinding target,
+                                   const void *data,
+                                   size_t size,
+                                   size_t offset)
 {
     ASSERT(mBuffer.valid());
 
     ContextVk *contextVk = vk::GetImpl(context);
     ANGLE_TRY(setDataImpl(contextVk, static_cast<const uint8_t *>(data), size, offset));
 
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
-gl::Error BufferVk::copySubData(const gl::Context *context,
-                                BufferImpl *source,
-                                GLintptr sourceOffset,
-                                GLintptr destOffset,
-                                GLsizeiptr size)
+angle::Result BufferVk::copySubData(const gl::Context *context,
+                                    BufferImpl *source,
+                                    GLintptr sourceOffset,
+                                    GLintptr destOffset,
+                                    GLsizeiptr size)
 {
-    UNIMPLEMENTED();
-    return gl::InternalError();
+    ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
+    return angle::Result::Stop();
 }
 
-gl::Error BufferVk::map(const gl::Context *context, GLenum access, void **mapPtr)
+angle::Result BufferVk::map(const gl::Context *context, GLenum access, void **mapPtr)
 {
     ASSERT(mBuffer.valid());
 
     ContextVk *contextVk = vk::GetImpl(context);
-    ANGLE_TRY(mapImpl(contextVk, mapPtr));
-    return gl::NoError();
+    return mapImpl(contextVk, mapPtr);
 }
 
 angle::Result BufferVk::mapImpl(ContextVk *contextVk, void **mapPtr)
@@ -126,23 +125,21 @@
     return mState.getSize();
 }
 
-gl::Error BufferVk::mapRange(const gl::Context *context,
-                             size_t offset,
-                             size_t length,
-                             GLbitfield access,
-                             void **mapPtr)
+angle::Result BufferVk::mapRange(const gl::Context *context,
+                                 size_t offset,
+                                 size_t length,
+                                 GLbitfield access,
+                                 void **mapPtr)
 {
     ASSERT(mBuffer.valid());
 
     ContextVk *contextVk = vk::GetImpl(context);
 
-    ANGLE_TRY(mBuffer.getDeviceMemory().map(contextVk, offset, length, 0,
-                                            reinterpret_cast<uint8_t **>(mapPtr)));
-
-    return gl::NoError();
+    return mBuffer.getDeviceMemory().map(contextVk, offset, length, 0,
+                                         reinterpret_cast<uint8_t **>(mapPtr));
 }
 
-gl::Error BufferVk::unmap(const gl::Context *context, GLboolean *result)
+angle::Result BufferVk::unmap(const gl::Context *context, GLboolean *result)
 {
     return unmapImpl(vk::GetImpl(context));
 }
@@ -156,12 +153,12 @@
     return angle::Result::Continue();
 }
 
-gl::Error BufferVk::getIndexRange(const gl::Context *context,
-                                  GLenum type,
-                                  size_t offset,
-                                  size_t count,
-                                  bool primitiveRestartEnabled,
-                                  gl::IndexRange *outRange)
+angle::Result BufferVk::getIndexRange(const gl::Context *context,
+                                      GLenum type,
+                                      size_t offset,
+                                      size_t count,
+                                      bool primitiveRestartEnabled,
+                                      gl::IndexRange *outRange)
 {
     ContextVk *contextVk = vk::GetImpl(context);
 
@@ -180,7 +177,7 @@
     *outRange = gl::ComputeIndexRange(type, mapPointer, count, primitiveRestartEnabled);
 
     mBuffer.getDeviceMemory().unmap(contextVk->getDevice());
-    return gl::NoError();
+    return angle::Result::Continue();
 }
 
 angle::Result BufferVk::setDataImpl(ContextVk *contextVk,
diff --git a/src/libANGLE/renderer/vulkan/BufferVk.h b/src/libANGLE/renderer/vulkan/BufferVk.h
index b6c0288..c45bd1e 100644
--- a/src/libANGLE/renderer/vulkan/BufferVk.h
+++ b/src/libANGLE/renderer/vulkan/BufferVk.h
@@ -25,35 +25,35 @@
     ~BufferVk() override;
     void destroy(const gl::Context *context) override;
 
-    gl::Error setData(const gl::Context *context,
-                      gl::BufferBinding target,
-                      const void *data,
-                      size_t size,
-                      gl::BufferUsage usage) override;
-    gl::Error setSubData(const gl::Context *context,
-                         gl::BufferBinding target,
-                         const void *data,
-                         size_t size,
-                         size_t offset) override;
-    gl::Error copySubData(const gl::Context *context,
-                          BufferImpl *source,
-                          GLintptr sourceOffset,
-                          GLintptr destOffset,
-                          GLsizeiptr size) override;
-    gl::Error map(const gl::Context *context, GLenum access, void **mapPtr) override;
-    gl::Error mapRange(const gl::Context *context,
-                       size_t offset,
-                       size_t length,
-                       GLbitfield access,
-                       void **mapPtr) override;
-    gl::Error unmap(const gl::Context *context, GLboolean *result) override;
+    angle::Result setData(const gl::Context *context,
+                          gl::BufferBinding target,
+                          const void *data,
+                          size_t size,
+                          gl::BufferUsage usage) override;
+    angle::Result setSubData(const gl::Context *context,
+                             gl::BufferBinding target,
+                             const void *data,
+                             size_t size,
+                             size_t offset) override;
+    angle::Result copySubData(const gl::Context *context,
+                              BufferImpl *source,
+                              GLintptr sourceOffset,
+                              GLintptr destOffset,
+                              GLsizeiptr size) override;
+    angle::Result map(const gl::Context *context, GLenum access, void **mapPtr) override;
+    angle::Result mapRange(const gl::Context *context,
+                           size_t offset,
+                           size_t length,
+                           GLbitfield access,
+                           void **mapPtr) override;
+    angle::Result unmap(const gl::Context *context, GLboolean *result) override;
 
-    gl::Error getIndexRange(const gl::Context *context,
-                            GLenum type,
-                            size_t offset,
-                            size_t count,
-                            bool primitiveRestartEnabled,
-                            gl::IndexRange *outRange) override;
+    angle::Result getIndexRange(const gl::Context *context,
+                                GLenum type,
+                                size_t offset,
+                                size_t count,
+                                bool primitiveRestartEnabled,
+                                gl::IndexRange *outRange) override;
     GLint64 getSize();
 
     const vk::BufferHelper &getBuffer() const
diff --git a/src/tests/perf_tests/IndexDataManagerTest.cpp b/src/tests/perf_tests/IndexDataManagerTest.cpp
index 93bee31..55d14b0 100644
--- a/src/tests/perf_tests/IndexDataManagerTest.cpp
+++ b/src/tests/perf_tests/IndexDataManagerTest.cpp
@@ -81,27 +81,28 @@
     MockBufferD3D(rx::BufferFactoryD3D *factory) : BufferD3D(mockState, factory), mData() {}
 
     // BufferImpl
-    gl::Error setData(const gl::Context *context,
-                      gl::BufferBinding target,
-                      const void *data,
-                      size_t size,
-                      gl::BufferUsage) override
+    angle::Result setData(const gl::Context *context,
+                          gl::BufferBinding target,
+                          const void *data,
+                          size_t size,
+                          gl::BufferUsage) override
     {
         mData.resize(size);
         if (data && size > 0)
         {
             memcpy(&mData[0], data, size);
         }
-        return gl::NoError();
+        return angle::Result::Continue();
     }
 
-    MOCK_METHOD5(setSubData,
-                 gl::Error(const gl::Context *, gl::BufferBinding, const void *, size_t, size_t));
+    MOCK_METHOD5(
+        setSubData,
+        angle::Result(const gl::Context *, gl::BufferBinding, const void *, size_t, size_t));
     MOCK_METHOD5(copySubData,
-                 gl::Error(const gl::Context *, BufferImpl *, GLintptr, GLintptr, GLsizeiptr));
-    MOCK_METHOD3(map, gl::Error(const gl::Context *context, GLenum, void **));
-    MOCK_METHOD5(mapRange, gl::Error(const gl::Context *, size_t, size_t, GLbitfield, void **));
-    MOCK_METHOD2(unmap, gl::Error(const gl::Context *context, GLboolean *));
+                 angle::Result(const gl::Context *, BufferImpl *, GLintptr, GLintptr, GLsizeiptr));
+    MOCK_METHOD3(map, angle::Result(const gl::Context *context, GLenum, void **));
+    MOCK_METHOD5(mapRange, angle::Result(const gl::Context *, size_t, size_t, GLbitfield, void **));
+    MOCK_METHOD2(unmap, angle::Result(const gl::Context *context, GLboolean *));
 
     // BufferD3D
     MOCK_METHOD1(markTransformFeedbackUsage, angle::Result(const gl::Context *));