Commit 666818ea by Jamie Madill Committed by Commit Bot

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

Refactors the gl::Texture class and a few related methods. Also reduces binary size by up to 4k. Bug: angleproject:2491 Change-Id: Ib9a69d7f507b0dce35abb17b90532f812bf43214 Reviewed-on: https://chromium-review.googlesource.com/c/1291845 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent f3acb8c1
...@@ -108,7 +108,7 @@ std::vector<gl::Path *> GatherPaths(gl::PathManager &resourceManager, ...@@ -108,7 +108,7 @@ std::vector<gl::Path *> GatherPaths(gl::PathManager &resourceManager,
} }
template <typename T> template <typename T>
gl::Error GetQueryObjectParameter(const gl::Context *context, angle::Result GetQueryObjectParameter(const gl::Context *context,
gl::Query *query, gl::Query *query,
GLenum pname, GLenum pname,
T *params) T *params)
...@@ -122,16 +122,13 @@ gl::Error GetQueryObjectParameter(const gl::Context *context, ...@@ -122,16 +122,13 @@ gl::Error GetQueryObjectParameter(const gl::Context *context,
case GL_QUERY_RESULT_AVAILABLE_EXT: case GL_QUERY_RESULT_AVAILABLE_EXT:
{ {
bool available; bool available;
gl::Error error = query->isResultAvailable(context, &available); ANGLE_TRY(query->isResultAvailable(context, &available));
if (!error.isError())
{
*params = gl::CastFromStateValue<T>(pname, static_cast<GLuint>(available)); *params = gl::CastFromStateValue<T>(pname, static_cast<GLuint>(available));
} return angle::Result::Continue();
return error;
} }
default: default:
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "Unreachable Error"; return angle::Result::Stop();
} }
} }
......
...@@ -62,7 +62,6 @@ class ANGLE_NO_DISCARD Error final ...@@ -62,7 +62,6 @@ class ANGLE_NO_DISCARD Error final
inline ~Error() = default; inline ~Error() = default;
// automatic error type conversion // automatic error type conversion
inline Error(egl::Error &&eglErr);
inline Error(egl::Error eglErr); inline Error(egl::Error eglErr);
inline Error &operator=(const Error &other); inline Error &operator=(const Error &other);
......
...@@ -38,13 +38,6 @@ Error::Error(Error &&other) ...@@ -38,13 +38,6 @@ Error::Error(Error &&other)
} }
// automatic error type conversion // automatic error type conversion
Error::Error(egl::Error &&eglErr)
: mCode(GL_INVALID_OPERATION),
mID(0),
mMessage(std::move(eglErr.mMessage))
{
}
Error::Error(egl::Error eglErr) Error::Error(egl::Error eglErr)
: mCode(GL_INVALID_OPERATION), : mCode(GL_INVALID_OPERATION),
mID(0), mID(0),
......
...@@ -72,7 +72,7 @@ void ImageSibling::setTargetImage(const gl::Context *context, egl::Image *imageT ...@@ -72,7 +72,7 @@ void ImageSibling::setTargetImage(const gl::Context *context, egl::Image *imageT
imageTarget->addTargetSibling(this); imageTarget->addTargetSibling(this);
} }
gl::Error ImageSibling::orphanImages(const gl::Context *context) angle::Result ImageSibling::orphanImages(const gl::Context *context)
{ {
if (mTargetOf.get() != nullptr) if (mTargetOf.get() != nullptr)
{ {
...@@ -91,7 +91,7 @@ gl::Error ImageSibling::orphanImages(const gl::Context *context) ...@@ -91,7 +91,7 @@ gl::Error ImageSibling::orphanImages(const gl::Context *context)
mSourcesOf.clear(); mSourcesOf.clear();
} }
return gl::NoError(); return angle::Result::Continue();
} }
void ImageSibling::addImageSource(egl::Image *imageSource) void ImageSibling::addImageSource(egl::Image *imageSource)
...@@ -273,7 +273,7 @@ void Image::addTargetSibling(ImageSibling *sibling) ...@@ -273,7 +273,7 @@ void Image::addTargetSibling(ImageSibling *sibling)
mState.targets.insert(sibling); mState.targets.insert(sibling);
} }
gl::Error Image::orphanSibling(const gl::Context *context, ImageSibling *sibling) angle::Result Image::orphanSibling(const gl::Context *context, ImageSibling *sibling)
{ {
ASSERT(sibling != nullptr); ASSERT(sibling != nullptr);
...@@ -296,7 +296,7 @@ gl::Error Image::orphanSibling(const gl::Context *context, ImageSibling *sibling ...@@ -296,7 +296,7 @@ gl::Error Image::orphanSibling(const gl::Context *context, ImageSibling *sibling
mState.targets.erase(sibling); mState.targets.erase(sibling);
} }
return gl::NoError(); return angle::Result::Continue();
} }
const gl::Format &Image::getFormat() const const gl::Format &Image::getFormat() const
......
...@@ -53,7 +53,7 @@ class ImageSibling : public gl::FramebufferAttachmentObject ...@@ -53,7 +53,7 @@ class ImageSibling : public gl::FramebufferAttachmentObject
void setTargetImage(const gl::Context *context, egl::Image *imageTarget); void setTargetImage(const gl::Context *context, egl::Image *imageTarget);
// Orphan all EGL image sources and targets // Orphan all EGL image sources and targets
gl::Error orphanImages(const gl::Context *context); angle::Result orphanImages(const gl::Context *context);
private: private:
friend class Image; friend class Image;
...@@ -158,7 +158,7 @@ class Image final : public RefCountObject, public LabeledObject ...@@ -158,7 +158,7 @@ class Image final : public RefCountObject, public LabeledObject
// Called from ImageSibling only to notify the image that a sibling (source or target) has // Called from ImageSibling only to notify the image that a sibling (source or target) has
// been respecified and state tracking should be updated. // been respecified and state tracking should be updated.
gl::Error orphanSibling(const gl::Context *context, ImageSibling *sibling); angle::Result orphanSibling(const gl::Context *context, ImageSibling *sibling);
ImageState mState; ImageState mState;
rx::ImageImpl *mImplementation; rx::ImageImpl *mImplementation;
......
...@@ -76,7 +76,7 @@ Renderbuffer::Renderbuffer(rx::GLImplFactory *implFactory, GLuint id) ...@@ -76,7 +76,7 @@ Renderbuffer::Renderbuffer(rx::GLImplFactory *implFactory, GLuint id)
void Renderbuffer::onDestroy(const Context *context) void Renderbuffer::onDestroy(const Context *context)
{ {
ANGLE_SWALLOW_ERR(orphanImages(context)); (void)(orphanImages(context));
if (mImplementation) if (mImplementation)
{ {
...@@ -103,7 +103,7 @@ angle::Result Renderbuffer::setStorage(const Context *context, ...@@ -103,7 +103,7 @@ angle::Result Renderbuffer::setStorage(const Context *context,
size_t width, size_t width,
size_t height) size_t height)
{ {
ANGLE_TRY_HANDLE(context, orphanImages(context)); ANGLE_TRY(orphanImages(context));
ANGLE_TRY(mImplementation->setStorage(context, internalformat, width, height)); ANGLE_TRY(mImplementation->setStorage(context, internalformat, width, height));
mState.update(static_cast<GLsizei>(width), static_cast<GLsizei>(height), Format(internalformat), mState.update(static_cast<GLsizei>(width), static_cast<GLsizei>(height), Format(internalformat),
...@@ -119,7 +119,7 @@ angle::Result Renderbuffer::setStorageMultisample(const Context *context, ...@@ -119,7 +119,7 @@ angle::Result Renderbuffer::setStorageMultisample(const Context *context,
size_t width, size_t width,
size_t height) size_t height)
{ {
ANGLE_TRY_HANDLE(context, orphanImages(context)); ANGLE_TRY(orphanImages(context));
ANGLE_TRY( ANGLE_TRY(
mImplementation->setStorageMultisample(context, samples, internalformat, width, height)); mImplementation->setStorageMultisample(context, samples, internalformat, width, height));
...@@ -132,7 +132,7 @@ angle::Result Renderbuffer::setStorageMultisample(const Context *context, ...@@ -132,7 +132,7 @@ angle::Result Renderbuffer::setStorageMultisample(const Context *context,
angle::Result Renderbuffer::setStorageEGLImageTarget(const Context *context, egl::Image *image) angle::Result Renderbuffer::setStorageEGLImageTarget(const Context *context, egl::Image *image)
{ {
ANGLE_TRY_HANDLE(context, orphanImages(context)); ANGLE_TRY(orphanImages(context));
ANGLE_TRY(mImplementation->setStorageEGLImageTarget(context, image)); ANGLE_TRY(mImplementation->setStorageEGLImageTarget(context, image));
setTargetImage(context, image); setTargetImage(context, image);
......
...@@ -203,8 +203,8 @@ Error Stream::consumerAcquire(const gl::Context *context) ...@@ -203,8 +203,8 @@ Error Stream::consumerAcquire(const gl::Context *context)
{ {
if (mPlanes[i].texture != nullptr) if (mPlanes[i].texture != nullptr)
{ {
ANGLE_TRY(mPlanes[i].texture->acquireImageFromStream( ANGLE_TRY(gl::Error(mPlanes[i].texture->acquireImageFromStream(
context, mProducerImplementation->getGLFrameDescription(i))); context, mProducerImplementation->getGLFrameDescription(i))));
} }
} }
...@@ -224,7 +224,7 @@ Error Stream::consumerRelease(const gl::Context *context) ...@@ -224,7 +224,7 @@ Error Stream::consumerRelease(const gl::Context *context)
{ {
if (mPlanes[i].texture != nullptr) if (mPlanes[i].texture != nullptr)
{ {
ANGLE_TRY(mPlanes[i].texture->releaseImageFromStream(context)); ANGLE_TRY(gl::Error(mPlanes[i].texture->releaseImageFromStream(context)));
} }
} }
......
...@@ -253,7 +253,7 @@ class Texture final : public RefCountObject, ...@@ -253,7 +253,7 @@ class Texture final : public RefCountObject,
const SamplerState &getSamplerState() const; const SamplerState &getSamplerState() const;
gl::Error setBaseLevel(const Context *context, GLuint baseLevel); angle::Result setBaseLevel(const Context *context, GLuint baseLevel);
GLuint getBaseLevel() const; GLuint getBaseLevel() const;
void setMaxLevel(GLuint maxLevel); void setMaxLevel(GLuint maxLevel);
...@@ -283,7 +283,7 @@ class Texture final : public RefCountObject, ...@@ -283,7 +283,7 @@ class Texture final : public RefCountObject,
bool isMipmapComplete() const; bool isMipmapComplete() const;
Error setImage(const Context *context, angle::Result setImage(const Context *context,
const PixelUnpackState &unpackState, const PixelUnpackState &unpackState,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
...@@ -292,7 +292,7 @@ class Texture final : public RefCountObject, ...@@ -292,7 +292,7 @@ class Texture final : public RefCountObject,
GLenum format, GLenum format,
GLenum type, GLenum type,
const uint8_t *pixels); const uint8_t *pixels);
Error setSubImage(const Context *context, angle::Result setSubImage(const Context *context,
const PixelUnpackState &unpackState, const PixelUnpackState &unpackState,
Buffer *unpackBuffer, Buffer *unpackBuffer,
TextureTarget target, TextureTarget target,
...@@ -302,7 +302,7 @@ class Texture final : public RefCountObject, ...@@ -302,7 +302,7 @@ class Texture final : public RefCountObject,
GLenum type, GLenum type,
const uint8_t *pixels); const uint8_t *pixels);
Error setCompressedImage(const Context *context, angle::Result setCompressedImage(const Context *context,
const PixelUnpackState &unpackState, const PixelUnpackState &unpackState,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
...@@ -310,7 +310,7 @@ class Texture final : public RefCountObject, ...@@ -310,7 +310,7 @@ class Texture final : public RefCountObject,
const Extents &size, const Extents &size,
size_t imageSize, size_t imageSize,
const uint8_t *pixels); const uint8_t *pixels);
Error setCompressedSubImage(const Context *context, angle::Result setCompressedSubImage(const Context *context,
const PixelUnpackState &unpackState, const PixelUnpackState &unpackState,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
...@@ -319,20 +319,20 @@ class Texture final : public RefCountObject, ...@@ -319,20 +319,20 @@ class Texture final : public RefCountObject,
size_t imageSize, size_t imageSize,
const uint8_t *pixels); const uint8_t *pixels);
Error copyImage(const Context *context, angle::Result copyImage(const Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
const Rectangle &sourceArea, const Rectangle &sourceArea,
GLenum internalFormat, GLenum internalFormat,
Framebuffer *source); Framebuffer *source);
Error copySubImage(const Context *context, angle::Result copySubImage(const Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
const Offset &destOffset, const Offset &destOffset,
const Rectangle &sourceArea, const Rectangle &sourceArea,
Framebuffer *source); Framebuffer *source);
Error copyTexture(const Context *context, angle::Result copyTexture(const Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
GLenum internalFormat, GLenum internalFormat,
...@@ -342,7 +342,7 @@ class Texture final : public RefCountObject, ...@@ -342,7 +342,7 @@ class Texture final : public RefCountObject,
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
Texture *source); Texture *source);
Error copySubTexture(const Context *context, angle::Result copySubTexture(const Context *context,
TextureTarget target, TextureTarget target,
GLint level, GLint level,
const Offset &destOffset, const Offset &destOffset,
...@@ -352,24 +352,26 @@ class Texture final : public RefCountObject, ...@@ -352,24 +352,26 @@ class Texture final : public RefCountObject,
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
Texture *source); Texture *source);
Error copyCompressedTexture(const Context *context, const Texture *source); angle::Result copyCompressedTexture(const Context *context, const Texture *source);
Error setStorage(const Context *context, angle::Result setStorage(const Context *context,
TextureType type, TextureType type,
GLsizei levels, GLsizei levels,
GLenum internalFormat, GLenum internalFormat,
const Extents &size); const Extents &size);
Error setStorageMultisample(const Context *context, angle::Result setStorageMultisample(const Context *context,
TextureType type, TextureType type,
GLsizei samples, GLsizei samples,
GLint internalformat, GLint internalformat,
const Extents &size, const Extents &size,
bool fixedSampleLocations); bool fixedSampleLocations);
Error setEGLImageTarget(const Context *context, TextureType type, egl::Image *imageTarget); angle::Result setEGLImageTarget(const Context *context,
TextureType type,
egl::Image *imageTarget);
Error generateMipmap(const Context *context); angle::Result generateMipmap(const Context *context);
egl::Surface *getBoundSurface() const; egl::Surface *getBoundSurface() const;
egl::Stream *getBoundStream() const; egl::Stream *getBoundStream() const;
...@@ -459,26 +461,26 @@ class Texture final : public RefCountObject, ...@@ -459,26 +461,26 @@ class Texture final : public RefCountObject,
// ANGLE-only method, used internally // ANGLE-only method, used internally
friend class egl::Surface; friend class egl::Surface;
Error bindTexImageFromSurface(const Context *context, egl::Surface *surface); angle::Result bindTexImageFromSurface(const Context *context, egl::Surface *surface);
Error releaseTexImageFromSurface(const Context *context); angle::Result releaseTexImageFromSurface(const Context *context);
// ANGLE-only methods, used internally // ANGLE-only methods, used internally
friend class egl::Stream; friend class egl::Stream;
void bindStream(egl::Stream *stream); void bindStream(egl::Stream *stream);
void releaseStream(); void releaseStream();
Error acquireImageFromStream(const Context *context, angle::Result acquireImageFromStream(const Context *context,
const egl::Stream::GLTextureDescription &desc); const egl::Stream::GLTextureDescription &desc);
Error releaseImageFromStream(const Context *context); angle::Result releaseImageFromStream(const Context *context);
void invalidateCompletenessCache() const; void invalidateCompletenessCache() const;
Error releaseTexImageInternal(const Context *context); angle::Result releaseTexImageInternal(const Context *context);
Error ensureSubImageInitialized(const Context *context, angle::Result ensureSubImageInitialized(const Context *context,
TextureTarget target, TextureTarget target,
size_t level, size_t level,
const gl::Box &area); const gl::Box &area);
Error handleMipmapGenerationHint(const Context *context, int level); angle::Result handleMipmapGenerationHint(const Context *context, int level);
TextureState mState; TextureState mState;
DirtyBits mDirtyBits; DirtyBits mDirtyBits;
......
...@@ -47,7 +47,7 @@ class ImageImpl : angle::NonCopyable ...@@ -47,7 +47,7 @@ class ImageImpl : angle::NonCopyable
virtual ~ImageImpl() {} virtual ~ImageImpl() {}
virtual egl::Error initialize(const egl::Display *display) = 0; virtual egl::Error initialize(const egl::Display *display) = 0;
virtual gl::Error orphan(const gl::Context *context, egl::ImageSibling *sibling) = 0; virtual angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) = 0;
protected: protected:
const egl::ImageState &mState; const egl::ImageState &mState;
......
...@@ -21,7 +21,7 @@ class MockImageImpl : public ImageImpl ...@@ -21,7 +21,7 @@ class MockImageImpl : public ImageImpl
MockImageImpl(const egl::ImageState &state) : ImageImpl(state) {} MockImageImpl(const egl::ImageState &state) : ImageImpl(state) {}
virtual ~MockImageImpl() { destructor(); } virtual ~MockImageImpl() { destructor(); }
MOCK_METHOD1(initialize, egl::Error(const egl::Display *)); MOCK_METHOD1(initialize, egl::Error(const egl::Display *));
MOCK_METHOD2(orphan, gl::Error(const gl::Context *, egl::ImageSibling *)); MOCK_METHOD2(orphan, angle::Result(const gl::Context *, egl::ImageSibling *));
MOCK_METHOD0(destructor, void()); MOCK_METHOD0(destructor, void());
}; };
} // namespace rx } // namespace rx
......
...@@ -22,7 +22,7 @@ class PathImpl : angle::NonCopyable ...@@ -22,7 +22,7 @@ class PathImpl : angle::NonCopyable
public: public:
virtual ~PathImpl() {} virtual ~PathImpl() {}
virtual gl::Error setCommands(GLsizei numCommands, virtual angle::Result setCommands(GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
namespace rx namespace rx
{ {
TextureImpl::TextureImpl(const gl::TextureState &state) : mState(state) TextureImpl::TextureImpl(const gl::TextureState &state) : mState(state)
{ {
} }
...@@ -19,12 +18,11 @@ TextureImpl::~TextureImpl() ...@@ -19,12 +18,11 @@ TextureImpl::~TextureImpl()
{ {
} }
gl::Error TextureImpl::onDestroy(const gl::Context *context) void TextureImpl::onDestroy(const gl::Context *context)
{ {
return gl::NoError();
} }
gl::Error TextureImpl::copyTexture(const gl::Context *context, angle::Result TextureImpl::copyTexture(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
GLenum type, GLenum type,
...@@ -35,10 +33,10 @@ gl::Error TextureImpl::copyTexture(const gl::Context *context, ...@@ -35,10 +33,10 @@ gl::Error TextureImpl::copyTexture(const gl::Context *context,
const gl::Texture *source) const gl::Texture *source)
{ {
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "CHROMIUM_copy_texture exposed but not implemented."; return angle::Result::Stop();
} }
gl::Error TextureImpl::copySubTexture(const gl::Context *context, angle::Result TextureImpl::copySubTexture(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
size_t sourceLevel, size_t sourceLevel,
...@@ -49,16 +47,17 @@ gl::Error TextureImpl::copySubTexture(const gl::Context *context, ...@@ -49,16 +47,17 @@ gl::Error TextureImpl::copySubTexture(const gl::Context *context,
const gl::Texture *source) const gl::Texture *source)
{ {
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "CHROMIUM_copy_texture exposed but not implemented."; return angle::Result::Stop();
} }
gl::Error TextureImpl::copyCompressedTexture(const gl::Context *context, const gl::Texture *source) angle::Result TextureImpl::copyCompressedTexture(const gl::Context *context,
const gl::Texture *source)
{ {
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "CHROMIUM_copy_compressed_texture exposed but not implemented."; return angle::Result::Stop();
} }
gl::Error TextureImpl::copy3DTexture(const gl::Context *context, angle::Result TextureImpl::copy3DTexture(const gl::Context *context,
gl::TextureTarget target, gl::TextureTarget target,
GLenum internalFormat, GLenum internalFormat,
GLenum type, GLenum type,
...@@ -70,10 +69,10 @@ gl::Error TextureImpl::copy3DTexture(const gl::Context *context, ...@@ -70,10 +69,10 @@ gl::Error TextureImpl::copy3DTexture(const gl::Context *context,
const gl::Texture *source) const gl::Texture *source)
{ {
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "ANGLE_copy_texture_3d exposed but not implemented."; return angle::Result::Stop();
} }
gl::Error TextureImpl::copy3DSubTexture(const gl::Context *context, angle::Result TextureImpl::copy3DSubTexture(const gl::Context *context,
const gl::TextureTarget target, const gl::TextureTarget target,
const gl::Offset &destOffset, const gl::Offset &destOffset,
size_t sourceLevel, size_t sourceLevel,
...@@ -85,7 +84,6 @@ gl::Error TextureImpl::copy3DSubTexture(const gl::Context *context, ...@@ -85,7 +84,6 @@ gl::Error TextureImpl::copy3DSubTexture(const gl::Context *context,
const gl::Texture *source) const gl::Texture *source)
{ {
UNREACHABLE(); UNREACHABLE();
return gl::InternalError() << "ANGLE_copy_texture_3d exposed but not implemented."; return angle::Result::Stop();
} }
} // namespace rx } // namespace rx
...@@ -46,9 +46,9 @@ class TextureImpl : public FramebufferAttachmentObjectImpl ...@@ -46,9 +46,9 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
TextureImpl(const gl::TextureState &state); TextureImpl(const gl::TextureState &state);
~TextureImpl() override; ~TextureImpl() override;
virtual gl::Error onDestroy(const gl::Context *context); virtual void onDestroy(const gl::Context *context);
virtual gl::Error setImage(const gl::Context *context, virtual angle::Result setImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
...@@ -56,7 +56,7 @@ class TextureImpl : public FramebufferAttachmentObjectImpl ...@@ -56,7 +56,7 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
GLenum type, GLenum type,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
const uint8_t *pixels) = 0; const uint8_t *pixels) = 0;
virtual gl::Error setSubImage(const gl::Context *context, virtual angle::Result setSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
...@@ -65,14 +65,14 @@ class TextureImpl : public FramebufferAttachmentObjectImpl ...@@ -65,14 +65,14 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
gl::Buffer *unpackBuffer, gl::Buffer *unpackBuffer,
const uint8_t *pixels) = 0; const uint8_t *pixels) = 0;
virtual gl::Error setCompressedImage(const gl::Context *context, virtual angle::Result setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
size_t imageSize, size_t imageSize,
const uint8_t *pixels) = 0; const uint8_t *pixels) = 0;
virtual gl::Error setCompressedSubImage(const gl::Context *context, virtual angle::Result setCompressedSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
...@@ -80,18 +80,18 @@ class TextureImpl : public FramebufferAttachmentObjectImpl ...@@ -80,18 +80,18 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
size_t imageSize, size_t imageSize,
const uint8_t *pixels) = 0; const uint8_t *pixels) = 0;
virtual gl::Error copyImage(const gl::Context *context, virtual angle::Result copyImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
GLenum internalFormat, GLenum internalFormat,
gl::Framebuffer *source) = 0; gl::Framebuffer *source) = 0;
virtual gl::Error copySubImage(const gl::Context *context, virtual angle::Result copySubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
gl::Framebuffer *source) = 0; gl::Framebuffer *source) = 0;
virtual gl::Error copyTexture(const gl::Context *context, virtual angle::Result copyTexture(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
GLenum type, GLenum type,
...@@ -100,7 +100,7 @@ class TextureImpl : public FramebufferAttachmentObjectImpl ...@@ -100,7 +100,7 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source); const gl::Texture *source);
virtual gl::Error copySubTexture(const gl::Context *context, virtual angle::Result copySubTexture(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
size_t sourceLevel, size_t sourceLevel,
...@@ -110,9 +110,10 @@ class TextureImpl : public FramebufferAttachmentObjectImpl ...@@ -110,9 +110,10 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source); const gl::Texture *source);
virtual gl::Error copyCompressedTexture(const gl::Context *context, const gl::Texture *source); virtual angle::Result copyCompressedTexture(const gl::Context *context,
const gl::Texture *source);
virtual gl::Error copy3DTexture(const gl::Context *context, virtual angle::Result copy3DTexture(const gl::Context *context,
gl::TextureTarget target, gl::TextureTarget target,
GLenum internalFormat, GLenum internalFormat,
GLenum type, GLenum type,
...@@ -122,7 +123,7 @@ class TextureImpl : public FramebufferAttachmentObjectImpl ...@@ -122,7 +123,7 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source); const gl::Texture *source);
virtual gl::Error copy3DSubTexture(const gl::Context *context, virtual angle::Result copy3DSubTexture(const gl::Context *context,
const gl::TextureTarget target, const gl::TextureTarget target,
const gl::Offset &destOffset, const gl::Offset &destOffset,
size_t sourceLevel, size_t sourceLevel,
...@@ -133,34 +134,34 @@ class TextureImpl : public FramebufferAttachmentObjectImpl ...@@ -133,34 +134,34 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source); const gl::Texture *source);
virtual gl::Error setStorage(const gl::Context *context, virtual angle::Result setStorage(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
size_t levels, size_t levels,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size) = 0; const gl::Extents &size) = 0;
virtual gl::Error setStorageMultisample(const gl::Context *context, virtual angle::Result setStorageMultisample(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
GLsizei samples, GLsizei samples,
GLint internalformat, GLint internalformat,
const gl::Extents &size, const gl::Extents &size,
bool fixedSampleLocations) = 0; bool fixedSampleLocations) = 0;
virtual gl::Error setEGLImageTarget(const gl::Context *context, virtual angle::Result setEGLImageTarget(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Image *image) = 0; egl::Image *image) = 0;
virtual gl::Error setImageExternal(const gl::Context *context, virtual angle::Result setImageExternal(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Stream *stream, egl::Stream *stream,
const egl::Stream::GLTextureDescription &desc) = 0; const egl::Stream::GLTextureDescription &desc) = 0;
virtual gl::Error generateMipmap(const gl::Context *context) = 0; virtual angle::Result generateMipmap(const gl::Context *context) = 0;
virtual gl::Error setBaseLevel(const gl::Context *context, GLuint baseLevel) = 0; virtual angle::Result setBaseLevel(const gl::Context *context, GLuint baseLevel) = 0;
virtual gl::Error bindTexImage(const gl::Context *context, egl::Surface *surface) = 0; virtual angle::Result bindTexImage(const gl::Context *context, egl::Surface *surface) = 0;
virtual gl::Error releaseTexImage(const gl::Context *context) = 0; virtual angle::Result releaseTexImage(const gl::Context *context) = 0;
// Override if accurate native memory size information is available // Override if accurate native memory size information is available
virtual GLint getMemorySize() const { return 0; } virtual GLint getMemorySize() const { return 0; }
......
...@@ -22,7 +22,7 @@ class MockTextureImpl : public TextureImpl ...@@ -22,7 +22,7 @@ class MockTextureImpl : public TextureImpl
MockTextureImpl() : TextureImpl(mMockState), mMockState(gl::TextureType::_2D) {} MockTextureImpl() : TextureImpl(mMockState), mMockState(gl::TextureType::_2D) {}
virtual ~MockTextureImpl() { destructor(); } virtual ~MockTextureImpl() { destructor(); }
MOCK_METHOD8(setImage, MOCK_METHOD8(setImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
GLenum, GLenum,
const gl::Extents &, const gl::Extents &,
...@@ -31,7 +31,7 @@ class MockTextureImpl : public TextureImpl ...@@ -31,7 +31,7 @@ class MockTextureImpl : public TextureImpl
const gl::PixelUnpackState &, const gl::PixelUnpackState &,
const uint8_t *)); const uint8_t *));
MOCK_METHOD8(setSubImage, MOCK_METHOD8(setSubImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
const gl::Box &, const gl::Box &,
GLenum, GLenum,
...@@ -40,7 +40,7 @@ class MockTextureImpl : public TextureImpl ...@@ -40,7 +40,7 @@ class MockTextureImpl : public TextureImpl
gl::Buffer *, gl::Buffer *,
const uint8_t *)); const uint8_t *));
MOCK_METHOD7(setCompressedImage, MOCK_METHOD7(setCompressedImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
GLenum, GLenum,
const gl::Extents &, const gl::Extents &,
...@@ -48,7 +48,7 @@ class MockTextureImpl : public TextureImpl ...@@ -48,7 +48,7 @@ class MockTextureImpl : public TextureImpl
size_t, size_t,
const uint8_t *)); const uint8_t *));
MOCK_METHOD7(setCompressedSubImage, MOCK_METHOD7(setCompressedSubImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
const gl::Box &, const gl::Box &,
GLenum, GLenum,
...@@ -56,19 +56,19 @@ class MockTextureImpl : public TextureImpl ...@@ -56,19 +56,19 @@ class MockTextureImpl : public TextureImpl
size_t, size_t,
const uint8_t *)); const uint8_t *));
MOCK_METHOD5(copyImage, MOCK_METHOD5(copyImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
const gl::Rectangle &, const gl::Rectangle &,
GLenum, GLenum,
gl::Framebuffer *)); gl::Framebuffer *));
MOCK_METHOD5(copySubImage, MOCK_METHOD5(copySubImage,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
const gl::Offset &, const gl::Offset &,
const gl::Rectangle &, const gl::Rectangle &,
gl::Framebuffer *)); gl::Framebuffer *));
MOCK_METHOD9(copyTexture, MOCK_METHOD9(copyTexture,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
GLenum, GLenum,
GLenum, GLenum,
...@@ -78,7 +78,7 @@ class MockTextureImpl : public TextureImpl ...@@ -78,7 +78,7 @@ class MockTextureImpl : public TextureImpl
bool, bool,
const gl::Texture *)); const gl::Texture *));
MOCK_METHOD9(copySubTexture, MOCK_METHOD9(copySubTexture,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
const gl::ImageIndex &, const gl::ImageIndex &,
const gl::Offset &, const gl::Offset &,
size_t, size_t,
...@@ -87,19 +87,21 @@ class MockTextureImpl : public TextureImpl ...@@ -87,19 +87,21 @@ class MockTextureImpl : public TextureImpl
bool, bool,
bool, bool,
const gl::Texture *)); const gl::Texture *));
MOCK_METHOD2(copyCompressedTexture, gl::Error(const gl::Context *, const gl::Texture *source)); MOCK_METHOD2(copyCompressedTexture,
angle::Result(const gl::Context *, const gl::Texture *source));
MOCK_METHOD5( MOCK_METHOD5(
setStorage, setStorage,
gl::Error(const gl::Context *, gl::TextureType, size_t, GLenum, const gl::Extents &)); angle::Result(const gl::Context *, gl::TextureType, size_t, GLenum, const gl::Extents &));
MOCK_METHOD4(setImageExternal, MOCK_METHOD4(setImageExternal,
gl::Error(const gl::Context *, angle::Result(const gl::Context *,
gl::TextureType, gl::TextureType,
egl::Stream *, egl::Stream *,
const egl::Stream::GLTextureDescription &)); const egl::Stream::GLTextureDescription &));
MOCK_METHOD3(setEGLImageTarget, gl::Error(const gl::Context *, gl::TextureType, egl::Image *)); MOCK_METHOD3(setEGLImageTarget,
MOCK_METHOD1(generateMipmap, gl::Error(const gl::Context *)); angle::Result(const gl::Context *, gl::TextureType, egl::Image *));
MOCK_METHOD2(bindTexImage, gl::Error(const gl::Context *, egl::Surface *)); MOCK_METHOD1(generateMipmap, angle::Result(const gl::Context *));
MOCK_METHOD1(releaseTexImage, gl::Error(const gl::Context *)); MOCK_METHOD2(bindTexImage, angle::Result(const gl::Context *, egl::Surface *));
MOCK_METHOD1(releaseTexImage, angle::Result(const gl::Context *));
MOCK_METHOD4(getAttachmentRenderTarget, MOCK_METHOD4(getAttachmentRenderTarget,
angle::Result(const gl::Context *, angle::Result(const gl::Context *,
...@@ -107,11 +109,15 @@ class MockTextureImpl : public TextureImpl ...@@ -107,11 +109,15 @@ class MockTextureImpl : public TextureImpl
const gl::ImageIndex &, const gl::ImageIndex &,
FramebufferAttachmentRenderTarget **)); FramebufferAttachmentRenderTarget **));
MOCK_METHOD6( MOCK_METHOD6(setStorageMultisample,
setStorageMultisample, angle::Result(const gl::Context *,
gl::Error(const gl::Context *, gl::TextureType, GLsizei, GLint, const gl::Extents &, bool)); gl::TextureType,
GLsizei,
GLint,
const gl::Extents &,
bool));
MOCK_METHOD2(setBaseLevel, gl::Error(const gl::Context *, GLuint)); MOCK_METHOD2(setBaseLevel, angle::Result(const gl::Context *, GLuint));
MOCK_METHOD2(syncState, angle::Result(const gl::Context *, const gl::Texture::DirtyBits &)); MOCK_METHOD2(syncState, angle::Result(const gl::Context *, const gl::Texture::DirtyBits &));
......
...@@ -43,14 +43,14 @@ egl::Error EGLImageD3D::initialize(const egl::Display *display) ...@@ -43,14 +43,14 @@ egl::Error EGLImageD3D::initialize(const egl::Display *display)
return egl::NoError(); return egl::NoError();
} }
gl::Error EGLImageD3D::orphan(const gl::Context *context, egl::ImageSibling *sibling) angle::Result EGLImageD3D::orphan(const gl::Context *context, egl::ImageSibling *sibling)
{ {
if (sibling == mState.source) if (sibling == mState.source)
{ {
ANGLE_TRY(copyToLocalRendertarget(context)); ANGLE_TRY(copyToLocalRendertarget(context));
} }
return gl::NoError(); return angle::Result::Continue();
} }
angle::Result EGLImageD3D::getRenderTarget(const gl::Context *context, angle::Result EGLImageD3D::getRenderTarget(const gl::Context *context,
...@@ -71,7 +71,7 @@ angle::Result EGLImageD3D::getRenderTarget(const gl::Context *context, ...@@ -71,7 +71,7 @@ angle::Result EGLImageD3D::getRenderTarget(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error EGLImageD3D::copyToLocalRendertarget(const gl::Context *context) angle::Result EGLImageD3D::copyToLocalRendertarget(const gl::Context *context)
{ {
ASSERT(mState.source != nullptr); ASSERT(mState.source != nullptr);
ASSERT(mRenderTarget == nullptr); ASSERT(mRenderTarget == nullptr);
......
...@@ -40,12 +40,12 @@ class EGLImageD3D final : public ImageImpl ...@@ -40,12 +40,12 @@ class EGLImageD3D final : public ImageImpl
egl::Error initialize(const egl::Display *display) override; egl::Error initialize(const egl::Display *display) override;
gl::Error orphan(const gl::Context *context, egl::ImageSibling *sibling) override; angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) override;
angle::Result getRenderTarget(const gl::Context *context, RenderTargetD3D **outRT) const; angle::Result getRenderTarget(const gl::Context *context, RenderTargetD3D **outRT) const;
private: private:
gl::Error copyToLocalRendertarget(const gl::Context *context); angle::Result copyToLocalRendertarget(const gl::Context *context);
RendererD3D *mRenderer; RendererD3D *mRenderer;
RenderTargetD3D *mRenderTarget; RenderTargetD3D *mRenderTarget;
......
...@@ -204,8 +204,8 @@ GLenum FramebufferD3D::getImplementationColorReadFormat(const gl::Context *conte ...@@ -204,8 +204,8 @@ GLenum FramebufferD3D::getImplementationColorReadFormat(const gl::Context *conte
} }
RenderTargetD3D *attachmentRenderTarget = nullptr; RenderTargetD3D *attachmentRenderTarget = nullptr;
gl::Error error = readAttachment->getRenderTarget(context, &attachmentRenderTarget); angle::Result error = readAttachment->getRenderTarget(context, &attachmentRenderTarget);
if (error.isError()) if (error != angle::Result::Continue())
{ {
return GL_NONE; return GL_NONE;
} }
...@@ -227,8 +227,8 @@ GLenum FramebufferD3D::getImplementationColorReadType(const gl::Context *context ...@@ -227,8 +227,8 @@ GLenum FramebufferD3D::getImplementationColorReadType(const gl::Context *context
} }
RenderTargetD3D *attachmentRenderTarget = nullptr; RenderTargetD3D *attachmentRenderTarget = nullptr;
gl::Error error = readAttachment->getRenderTarget(context, &attachmentRenderTarget); angle::Result error = readAttachment->getRenderTarget(context, &attachmentRenderTarget);
if (error.isError()) if (error != angle::Result::Continue())
{ {
return GL_NONE; return GL_NONE;
} }
......
...@@ -603,7 +603,7 @@ angle::Result Context11::getIncompleteTexture(const gl::Context *context, ...@@ -603,7 +603,7 @@ angle::Result Context11::getIncompleteTexture(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error Context11::initializeMultisampleTextureToBlack(const gl::Context *context, angle::Result Context11::initializeMultisampleTextureToBlack(const gl::Context *context,
gl::Texture *glTexture) gl::Texture *glTexture)
{ {
ASSERT(glTexture->getType() == gl::TextureType::_2DMultisample); ASSERT(glTexture->getType() == gl::TextureType::_2DMultisample);
......
...@@ -158,7 +158,7 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer ...@@ -158,7 +158,7 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
gl::TextureType type, gl::TextureType type,
gl::Texture **textureOut); gl::Texture **textureOut);
gl::Error initializeMultisampleTextureToBlack(const gl::Context *context, angle::Result initializeMultisampleTextureToBlack(const gl::Context *context,
gl::Texture *glTexture) override; gl::Texture *glTexture) override;
void handleResult(HRESULT hr, void handleResult(HRESULT hr,
......
...@@ -26,11 +26,11 @@ class ImageGL : public ImageImpl ...@@ -26,11 +26,11 @@ class ImageGL : public ImageImpl
// TextureGL does not have access to all the parameters needed to implement // TextureGL does not have access to all the parameters needed to implement
// glEGLImageTargetTexture2DOES or glEGLImageTargetRenderbufferStorageOES. This allows the Image // glEGLImageTargetTexture2DOES or glEGLImageTargetRenderbufferStorageOES. This allows the Image
// to implement these functions because it holds the native EGLimage or emulated object. // to implement these functions because it holds the native EGLimage or emulated object.
virtual gl::Error setTexture2D(const gl::Context *context, virtual angle::Result setTexture2D(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
TextureGL *texture, TextureGL *texture,
GLenum *outInternalFormat) = 0; GLenum *outInternalFormat) = 0;
virtual gl::Error setRenderbufferStorage(const gl::Context *context, virtual angle::Result setRenderbufferStorage(const gl::Context *context,
RenderbufferGL *renderbuffer, RenderbufferGL *renderbuffer,
GLenum *outInternalFormat) = 0; GLenum *outInternalFormat) = 0;
}; };
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
namespace rx namespace rx
{ {
PathGL::PathGL(const FunctionsGL *functions, GLuint path) : mFunctions(functions), mPathID(path) PathGL::PathGL(const FunctionsGL *functions, GLuint path) : mFunctions(functions), mPathID(path)
{ {
} }
...@@ -20,19 +19,18 @@ PathGL::~PathGL() ...@@ -20,19 +19,18 @@ PathGL::~PathGL()
{ {
} }
gl::Error PathGL::setCommands(GLsizei numCommands, angle::Result PathGL::setCommands(GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
const void *coords) const void *coords)
{ {
mFunctions->pathCommandsNV(mPathID, numCommands, commands, numCoords, coordType, coords); mFunctions->pathCommandsNV(mPathID, numCommands, commands, numCoords, coordType, coords);
return gl::NoError(); return angle::Result::Continue();
} }
void PathGL::setPathParameter(GLenum pname, GLfloat value) void PathGL::setPathParameter(GLenum pname, GLfloat value)
{ {
mFunctions->pathParameterfNV(mPathID, pname, value); mFunctions->pathParameterfNV(mPathID, pname, value);
} }
} // namespace rx
} // rx
...@@ -23,7 +23,7 @@ class PathGL : public PathImpl ...@@ -23,7 +23,7 @@ class PathGL : public PathImpl
PathGL(const FunctionsGL *functions, GLuint path); PathGL(const FunctionsGL *functions, GLuint path);
~PathGL() override; ~PathGL() override;
gl::Error setCommands(GLsizei numCommands, angle::Result setCommands(GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
......
...@@ -59,9 +59,9 @@ class TextureGL : public TextureImpl ...@@ -59,9 +59,9 @@ class TextureGL : public TextureImpl
TextureGL(const gl::TextureState &state, GLuint id); TextureGL(const gl::TextureState &state, GLuint id);
~TextureGL() override; ~TextureGL() override;
gl::Error onDestroy(const gl::Context *context) override; void onDestroy(const gl::Context *context) override;
gl::Error setImage(const gl::Context *context, angle::Result setImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
...@@ -69,7 +69,7 @@ class TextureGL : public TextureImpl ...@@ -69,7 +69,7 @@ class TextureGL : public TextureImpl
GLenum type, GLenum type,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error setSubImage(const gl::Context *context, angle::Result setSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
...@@ -78,14 +78,14 @@ class TextureGL : public TextureImpl ...@@ -78,14 +78,14 @@ class TextureGL : public TextureImpl
gl::Buffer *unpackBuffer, gl::Buffer *unpackBuffer,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error setCompressedImage(const gl::Context *context, angle::Result setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
size_t imageSize, size_t imageSize,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error setCompressedSubImage(const gl::Context *context, angle::Result setCompressedSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
...@@ -93,18 +93,18 @@ class TextureGL : public TextureImpl ...@@ -93,18 +93,18 @@ class TextureGL : public TextureImpl
size_t imageSize, size_t imageSize,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error copyImage(const gl::Context *context, angle::Result copyImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
GLenum internalFormat, GLenum internalFormat,
gl::Framebuffer *source) override; gl::Framebuffer *source) override;
gl::Error copySubImage(const gl::Context *context, angle::Result copySubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
gl::Framebuffer *source) override; gl::Framebuffer *source) override;
gl::Error copyTexture(const gl::Context *context, angle::Result copyTexture(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
GLenum type, GLenum type,
...@@ -113,7 +113,7 @@ class TextureGL : public TextureImpl ...@@ -113,7 +113,7 @@ class TextureGL : public TextureImpl
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source) override; const gl::Texture *source) override;
gl::Error copySubTexture(const gl::Context *context, angle::Result copySubTexture(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
size_t sourceLevel, size_t sourceLevel,
...@@ -122,7 +122,7 @@ class TextureGL : public TextureImpl ...@@ -122,7 +122,7 @@ class TextureGL : public TextureImpl
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source) override; const gl::Texture *source) override;
gl::Error copySubTextureHelper(const gl::Context *context, angle::Result copySubTextureHelper(const gl::Context *context,
gl::TextureTarget target, gl::TextureTarget target,
size_t level, size_t level,
const gl::Offset &destOffset, const gl::Offset &destOffset,
...@@ -134,30 +134,30 @@ class TextureGL : public TextureImpl ...@@ -134,30 +134,30 @@ class TextureGL : public TextureImpl
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source); const gl::Texture *source);
gl::Error setStorage(const gl::Context *context, angle::Result setStorage(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
size_t levels, size_t levels,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size) override; const gl::Extents &size) override;
gl::Error setStorageMultisample(const gl::Context *context, angle::Result setStorageMultisample(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
GLsizei samples, GLsizei samples,
GLint internalFormat, GLint internalformat,
const gl::Extents &size, const gl::Extents &size,
bool fixedSampleLocations) override; bool fixedSampleLocations) override;
gl::Error setImageExternal(const gl::Context *context, angle::Result setImageExternal(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Stream *stream, egl::Stream *stream,
const egl::Stream::GLTextureDescription &desc) override; const egl::Stream::GLTextureDescription &desc) override;
gl::Error generateMipmap(const gl::Context *context) override; angle::Result generateMipmap(const gl::Context *context) override;
gl::Error bindTexImage(const gl::Context *context, egl::Surface *surface) override; angle::Result bindTexImage(const gl::Context *context, egl::Surface *surface) override;
gl::Error releaseTexImage(const gl::Context *context) override; angle::Result releaseTexImage(const gl::Context *context) override;
gl::Error setEGLImageTarget(const gl::Context *context, angle::Result setEGLImageTarget(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Image *image) override; egl::Image *image) override;
...@@ -169,7 +169,7 @@ class TextureGL : public TextureImpl ...@@ -169,7 +169,7 @@ class TextureGL : public TextureImpl
const gl::Texture::DirtyBits &dirtyBits) override; const gl::Texture::DirtyBits &dirtyBits) override;
bool hasAnyDirtyBit() const; bool hasAnyDirtyBit() const;
gl::Error setBaseLevel(const gl::Context *context, GLuint baseLevel) override; angle::Result setBaseLevel(const gl::Context *context, GLuint baseLevel) override;
angle::Result initializeContents(const gl::Context *context, angle::Result initializeContents(const gl::Context *context,
const gl::ImageIndex &imageIndex) override; const gl::ImageIndex &imageIndex) override;
...@@ -198,7 +198,7 @@ class TextureGL : public TextureImpl ...@@ -198,7 +198,7 @@ class TextureGL : public TextureImpl
const gl::Extents &size, const gl::Extents &size,
GLenum format, GLenum format,
GLenum type); GLenum type);
gl::Error setSubImageRowByRowWorkaround(const gl::Context *context, angle::Result setSubImageRowByRowWorkaround(const gl::Context *context,
gl::TextureTarget target, gl::TextureTarget target,
size_t level, size_t level,
const gl::Box &area, const gl::Box &area,
...@@ -208,7 +208,7 @@ class TextureGL : public TextureImpl ...@@ -208,7 +208,7 @@ class TextureGL : public TextureImpl
const gl::Buffer *unpackBuffer, const gl::Buffer *unpackBuffer,
const uint8_t *pixels); const uint8_t *pixels);
gl::Error setSubImagePaddingWorkaround(const gl::Context *context, angle::Result setSubImagePaddingWorkaround(const gl::Context *context,
gl::TextureTarget target, gl::TextureTarget target,
size_t level, size_t level,
const gl::Box &area, const gl::Box &area,
......
...@@ -98,13 +98,13 @@ egl::Error ImageEGL::initialize(const egl::Display *display) ...@@ -98,13 +98,13 @@ egl::Error ImageEGL::initialize(const egl::Display *display)
return egl::NoError(); return egl::NoError();
} }
gl::Error ImageEGL::orphan(const gl::Context *context, egl::ImageSibling *sibling) angle::Result ImageEGL::orphan(const gl::Context *context, egl::ImageSibling *sibling)
{ {
// Nothing to do, the native EGLImage will orphan automatically. // Nothing to do, the native EGLImage will orphan automatically.
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error ImageEGL::setTexture2D(const gl::Context *context, angle::Result ImageEGL::setTexture2D(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
TextureGL *texture, TextureGL *texture,
GLenum *outInternalFormat) GLenum *outInternalFormat)
...@@ -119,10 +119,10 @@ gl::Error ImageEGL::setTexture2D(const gl::Context *context, ...@@ -119,10 +119,10 @@ gl::Error ImageEGL::setTexture2D(const gl::Context *context,
functionsGL->eGLImageTargetTexture2DOES(ToGLenum(type), mImage); functionsGL->eGLImageTargetTexture2DOES(ToGLenum(type), mImage);
*outInternalFormat = mNativeInternalFormat; *outInternalFormat = mNativeInternalFormat;
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error ImageEGL::setRenderbufferStorage(const gl::Context *context, angle::Result ImageEGL::setRenderbufferStorage(const gl::Context *context,
RenderbufferGL *renderbuffer, RenderbufferGL *renderbuffer,
GLenum *outInternalFormat) GLenum *outInternalFormat)
{ {
...@@ -136,7 +136,7 @@ gl::Error ImageEGL::setRenderbufferStorage(const gl::Context *context, ...@@ -136,7 +136,7 @@ gl::Error ImageEGL::setRenderbufferStorage(const gl::Context *context,
functionsGL->eGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, mImage); functionsGL->eGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, mImage);
*outInternalFormat = mNativeInternalFormat; *outInternalFormat = mNativeInternalFormat;
return gl::NoError(); return angle::Result::Continue();
} }
} // namespace rx } // namespace rx
...@@ -33,13 +33,13 @@ class ImageEGL final : public ImageGL ...@@ -33,13 +33,13 @@ class ImageEGL final : public ImageGL
egl::Error initialize(const egl::Display *display) override; egl::Error initialize(const egl::Display *display) override;
gl::Error orphan(const gl::Context *context, egl::ImageSibling *sibling) override; angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) override;
gl::Error setTexture2D(const gl::Context *context, angle::Result setTexture2D(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
TextureGL *texture, TextureGL *texture,
GLenum *outInternalFormat) override; GLenum *outInternalFormat) override;
gl::Error setRenderbufferStorage(const gl::Context *context, angle::Result setRenderbufferStorage(const gl::Context *context,
RenderbufferGL *renderbuffer, RenderbufferGL *renderbuffer,
GLenum *outInternalFormat) override; GLenum *outInternalFormat) override;
......
...@@ -27,9 +27,9 @@ egl::Error ImageNULL::initialize(const egl::Display *display) ...@@ -27,9 +27,9 @@ egl::Error ImageNULL::initialize(const egl::Display *display)
return egl::NoError(); return egl::NoError();
} }
gl::Error ImageNULL::orphan(const gl::Context *context, egl::ImageSibling *sibling) angle::Result ImageNULL::orphan(const gl::Context *context, egl::ImageSibling *sibling)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
} // namespace rx } // namespace rx
...@@ -22,7 +22,7 @@ class ImageNULL : public ImageImpl ...@@ -22,7 +22,7 @@ class ImageNULL : public ImageImpl
~ImageNULL() override; ~ImageNULL() override;
egl::Error initialize(const egl::Display *display) override; egl::Error initialize(const egl::Display *display) override;
gl::Error orphan(const gl::Context *context, egl::ImageSibling *sibling) override; angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) override;
}; };
} // namespace rx } // namespace rx
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
namespace rx namespace rx
{ {
PathNULL::PathNULL() : PathImpl() PathNULL::PathNULL() : PathImpl()
{ {
} }
...@@ -22,19 +21,16 @@ PathNULL::~PathNULL() ...@@ -22,19 +21,16 @@ PathNULL::~PathNULL()
{ {
} }
gl::Error PathNULL::setCommands(GLsizei numCommands, angle::Result PathNULL::setCommands(GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
const void *coords) const void *coords)
{ {
UNIMPLEMENTED(); return angle::Result::Continue();
return gl::InternalError();
} }
void PathNULL::setPathParameter(GLenum pname, GLfloat value) void PathNULL::setPathParameter(GLenum pname, GLfloat value)
{ {
UNIMPLEMENTED();
} }
} // namespace rx } // namespace rx
...@@ -21,7 +21,7 @@ class PathNULL : public PathImpl ...@@ -21,7 +21,7 @@ class PathNULL : public PathImpl
PathNULL(); PathNULL();
~PathNULL() override; ~PathNULL() override;
gl::Error setCommands(GLsizei numCommands, angle::Result setCommands(GLsizei numCommands,
const GLubyte *commands, const GLubyte *commands,
GLsizei numCoords, GLsizei numCoords,
GLenum coordType, GLenum coordType,
......
...@@ -22,7 +22,7 @@ TextureNULL::~TextureNULL() ...@@ -22,7 +22,7 @@ TextureNULL::~TextureNULL()
{ {
} }
gl::Error TextureNULL::setImage(const gl::Context *context, angle::Result TextureNULL::setImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
...@@ -33,10 +33,10 @@ gl::Error TextureNULL::setImage(const gl::Context *context, ...@@ -33,10 +33,10 @@ gl::Error TextureNULL::setImage(const gl::Context *context,
{ {
// TODO(geofflang): Read all incoming pixel data (maybe hash it?) to make sure we don't read out // TODO(geofflang): Read all incoming pixel data (maybe hash it?) to make sure we don't read out
// of bounds due to validation bugs. // of bounds due to validation bugs.
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setSubImage(const gl::Context *context, angle::Result TextureNULL::setSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
...@@ -45,10 +45,10 @@ gl::Error TextureNULL::setSubImage(const gl::Context *context, ...@@ -45,10 +45,10 @@ gl::Error TextureNULL::setSubImage(const gl::Context *context,
gl::Buffer *unpackBuffer, gl::Buffer *unpackBuffer,
const uint8_t *pixels) const uint8_t *pixels)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setCompressedImage(const gl::Context *context, angle::Result TextureNULL::setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
...@@ -56,10 +56,10 @@ gl::Error TextureNULL::setCompressedImage(const gl::Context *context, ...@@ -56,10 +56,10 @@ gl::Error TextureNULL::setCompressedImage(const gl::Context *context,
size_t imageSize, size_t imageSize,
const uint8_t *pixels) const uint8_t *pixels)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setCompressedSubImage(const gl::Context *context, angle::Result TextureNULL::setCompressedSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
...@@ -67,69 +67,69 @@ gl::Error TextureNULL::setCompressedSubImage(const gl::Context *context, ...@@ -67,69 +67,69 @@ gl::Error TextureNULL::setCompressedSubImage(const gl::Context *context,
size_t imageSize, size_t imageSize,
const uint8_t *pixels) const uint8_t *pixels)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::copyImage(const gl::Context *context, angle::Result TextureNULL::copyImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
GLenum internalFormat, GLenum internalFormat,
gl::Framebuffer *source) gl::Framebuffer *source)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::copySubImage(const gl::Context *context, angle::Result TextureNULL::copySubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
gl::Framebuffer *source) gl::Framebuffer *source)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setStorage(const gl::Context *context, angle::Result TextureNULL::setStorage(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
size_t levels, size_t levels,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size) const gl::Extents &size)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setEGLImageTarget(const gl::Context *context, angle::Result TextureNULL::setEGLImageTarget(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Image *image) egl::Image *image)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setImageExternal(const gl::Context *context, angle::Result TextureNULL::setImageExternal(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Stream *stream, egl::Stream *stream,
const egl::Stream::GLTextureDescription &desc) const egl::Stream::GLTextureDescription &desc)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::generateMipmap(const gl::Context *context) angle::Result TextureNULL::generateMipmap(const gl::Context *context)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setBaseLevel(const gl::Context *context, GLuint baseLevel) angle::Result TextureNULL::setBaseLevel(const gl::Context *context, GLuint baseLevel)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::bindTexImage(const gl::Context *context, egl::Surface *surface) angle::Result TextureNULL::bindTexImage(const gl::Context *context, egl::Surface *surface)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
gl::Error TextureNULL::releaseTexImage(const gl::Context *context) angle::Result TextureNULL::releaseTexImage(const gl::Context *context)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
angle::Result TextureNULL::syncState(const gl::Context *context, angle::Result TextureNULL::syncState(const gl::Context *context,
...@@ -138,14 +138,14 @@ angle::Result TextureNULL::syncState(const gl::Context *context, ...@@ -138,14 +138,14 @@ angle::Result TextureNULL::syncState(const gl::Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
gl::Error TextureNULL::setStorageMultisample(const gl::Context *context, angle::Result TextureNULL::setStorageMultisample(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
GLsizei samples, GLsizei samples,
GLint internalformat, GLint internalformat,
const gl::Extents &size, const gl::Extents &size,
bool fixedSampleLocations) bool fixedSampleLocations)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
angle::Result TextureNULL::initializeContents(const gl::Context *context, angle::Result TextureNULL::initializeContents(const gl::Context *context,
......
...@@ -21,7 +21,7 @@ class TextureNULL : public TextureImpl ...@@ -21,7 +21,7 @@ class TextureNULL : public TextureImpl
TextureNULL(const gl::TextureState &state); TextureNULL(const gl::TextureState &state);
~TextureNULL() override; ~TextureNULL() override;
gl::Error setImage(const gl::Context *context, angle::Result setImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
...@@ -29,7 +29,7 @@ class TextureNULL : public TextureImpl ...@@ -29,7 +29,7 @@ class TextureNULL : public TextureImpl
GLenum type, GLenum type,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error setSubImage(const gl::Context *context, angle::Result setSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
...@@ -38,14 +38,14 @@ class TextureNULL : public TextureImpl ...@@ -38,14 +38,14 @@ class TextureNULL : public TextureImpl
gl::Buffer *unpackBuffer, gl::Buffer *unpackBuffer,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error setCompressedImage(const gl::Context *context, angle::Result setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
size_t imageSize, size_t imageSize,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error setCompressedSubImage(const gl::Context *context, angle::Result setCompressedSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
...@@ -53,43 +53,43 @@ class TextureNULL : public TextureImpl ...@@ -53,43 +53,43 @@ class TextureNULL : public TextureImpl
size_t imageSize, size_t imageSize,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error copyImage(const gl::Context *context, angle::Result copyImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
GLenum internalFormat, GLenum internalFormat,
gl::Framebuffer *source) override; gl::Framebuffer *source) override;
gl::Error copySubImage(const gl::Context *context, angle::Result copySubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
gl::Framebuffer *source) override; gl::Framebuffer *source) override;
gl::Error setStorage(const gl::Context *context, angle::Result setStorage(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
size_t levels, size_t levels,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size) override; const gl::Extents &size) override;
gl::Error setEGLImageTarget(const gl::Context *context, angle::Result setEGLImageTarget(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Image *image) override; egl::Image *image) override;
gl::Error setImageExternal(const gl::Context *context, angle::Result setImageExternal(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Stream *stream, egl::Stream *stream,
const egl::Stream::GLTextureDescription &desc) override; const egl::Stream::GLTextureDescription &desc) override;
gl::Error generateMipmap(const gl::Context *context) override; angle::Result generateMipmap(const gl::Context *context) override;
gl::Error setBaseLevel(const gl::Context *context, GLuint baseLevel) override; angle::Result setBaseLevel(const gl::Context *context, GLuint baseLevel) override;
gl::Error bindTexImage(const gl::Context *context, egl::Surface *surface) override; angle::Result bindTexImage(const gl::Context *context, egl::Surface *surface) override;
gl::Error releaseTexImage(const gl::Context *context) override; angle::Result releaseTexImage(const gl::Context *context) override;
angle::Result syncState(const gl::Context *context, angle::Result syncState(const gl::Context *context,
const gl::Texture::DirtyBits &dirtyBits) override; const gl::Texture::DirtyBits &dirtyBits) override;
gl::Error setStorageMultisample(const gl::Context *context, angle::Result setStorageMultisample(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
GLsizei samples, GLsizei samples,
GLint internalformat, GLint internalformat,
......
...@@ -413,7 +413,7 @@ void IncompleteTextureSet::onDestroy(const gl::Context *context) ...@@ -413,7 +413,7 @@ void IncompleteTextureSet::onDestroy(const gl::Context *context)
} }
} }
gl::Error IncompleteTextureSet::getIncompleteTexture( angle::Result IncompleteTextureSet::getIncompleteTexture(
const gl::Context *context, const gl::Context *context,
gl::TextureType type, gl::TextureType type,
MultisampleTextureInitializer *multisampleInitializer, MultisampleTextureInitializer *multisampleInitializer,
...@@ -422,7 +422,7 @@ gl::Error IncompleteTextureSet::getIncompleteTexture( ...@@ -422,7 +422,7 @@ gl::Error IncompleteTextureSet::getIncompleteTexture(
*textureOut = mIncompleteTextures[type].get(); *textureOut = mIncompleteTextures[type].get();
if (*textureOut != nullptr) if (*textureOut != nullptr)
{ {
return gl::NoError(); return angle::Result::Continue();
} }
ContextImpl *implFactory = context->getImplementation(); ContextImpl *implFactory = context->getImplementation();
...@@ -472,7 +472,7 @@ gl::Error IncompleteTextureSet::getIncompleteTexture( ...@@ -472,7 +472,7 @@ gl::Error IncompleteTextureSet::getIncompleteTexture(
mIncompleteTextures[type].set(context, t.release()); mIncompleteTextures[type].set(context, t.release());
*textureOut = mIncompleteTextures[type].get(); *textureOut = mIncompleteTextures[type].get();
return gl::NoError(); return angle::Result::Continue();
} }
#define ANGLE_INSTANTIATE_SET_UNIFORM_MATRIX_FUNC(cols, rows) \ #define ANGLE_INSTANTIATE_SET_UNIFORM_MATRIX_FUNC(cols, rows) \
......
...@@ -236,7 +236,7 @@ class MultisampleTextureInitializer ...@@ -236,7 +236,7 @@ class MultisampleTextureInitializer
{ {
public: public:
virtual ~MultisampleTextureInitializer() {} virtual ~MultisampleTextureInitializer() {}
virtual gl::Error initializeMultisampleTextureToBlack(const gl::Context *context, virtual angle::Result initializeMultisampleTextureToBlack(const gl::Context *context,
gl::Texture *glTexture) = 0; gl::Texture *glTexture) = 0;
}; };
...@@ -248,7 +248,7 @@ class IncompleteTextureSet final : angle::NonCopyable ...@@ -248,7 +248,7 @@ class IncompleteTextureSet final : angle::NonCopyable
void onDestroy(const gl::Context *context); void onDestroy(const gl::Context *context);
gl::Error getIncompleteTexture(const gl::Context *context, angle::Result getIncompleteTexture(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
MultisampleTextureInitializer *multisampleInitializer, MultisampleTextureInitializer *multisampleInitializer,
gl::Texture **textureOut); gl::Texture **textureOut);
......
...@@ -178,7 +178,7 @@ void ContextVk::onDestroy(const gl::Context *context) ...@@ -178,7 +178,7 @@ void ContextVk::onDestroy(const gl::Context *context)
} }
} }
gl::Error ContextVk::getIncompleteTexture(const gl::Context *context, angle::Result ContextVk::getIncompleteTexture(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
gl::Texture **textureOut) gl::Texture **textureOut)
{ {
...@@ -1259,7 +1259,7 @@ angle::Result ContextVk::updateActiveTextures(const gl::Context *context) ...@@ -1259,7 +1259,7 @@ angle::Result ContextVk::updateActiveTextures(const gl::Context *context)
// Null textures represent incomplete textures. // Null textures represent incomplete textures.
if (texture == nullptr) if (texture == nullptr)
{ {
ANGLE_TRY_HANDLE(context, getIncompleteTexture(context, textureType, &texture)); ANGLE_TRY(getIncompleteTexture(context, textureType, &texture));
} }
mActiveTextures[textureUnit] = vk::GetImpl(texture); mActiveTextures[textureUnit] = vk::GetImpl(texture);
......
...@@ -174,7 +174,7 @@ class ContextVk : public ContextImpl, public vk::Context ...@@ -174,7 +174,7 @@ class ContextVk : public ContextImpl, public vk::Context
const VkClearValue &getClearDepthStencilValue() const; const VkClearValue &getClearDepthStencilValue() const;
VkColorComponentFlags getClearColorMask() const; VkColorComponentFlags getClearColorMask() const;
const VkRect2D &getScissor() const { return mScissor; } const VkRect2D &getScissor() const { return mScissor; }
gl::Error getIncompleteTexture(const gl::Context *context, angle::Result getIncompleteTexture(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
gl::Texture **textureOut); gl::Texture **textureOut);
void updateColorMask(const gl::BlendState &blendState); void updateColorMask(const gl::BlendState &blendState);
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
#include "libANGLE/renderer/vulkan/ImageVk.h" #include "libANGLE/renderer/vulkan/ImageVk.h"
#include "common/debug.h" #include "common/debug.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "libANGLE/renderer/vulkan/vk_utils.h"
namespace rx namespace rx
{ {
...@@ -28,10 +31,9 @@ egl::Error ImageVk::initialize(const egl::Display *display) ...@@ -28,10 +31,9 @@ egl::Error ImageVk::initialize(const egl::Display *display)
return egl::EglBadAccess(); return egl::EglBadAccess();
} }
gl::Error ImageVk::orphan(const gl::Context *context, egl::ImageSibling *sibling) angle::Result ImageVk::orphan(const gl::Context *context, egl::ImageSibling *sibling)
{ {
UNIMPLEMENTED(); ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return gl::InternalError(); return angle::Result::Stop();
} }
} // namespace rx } // namespace rx
...@@ -22,7 +22,7 @@ class ImageVk : public ImageImpl ...@@ -22,7 +22,7 @@ class ImageVk : public ImageImpl
~ImageVk() override; ~ImageVk() override;
egl::Error initialize(const egl::Display *display) override; egl::Error initialize(const egl::Display *display) override;
gl::Error orphan(const gl::Context *context, egl::ImageSibling *sibling) override; angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) override;
}; };
} // namespace rx } // namespace rx
......
...@@ -88,9 +88,9 @@ class TextureVk : public TextureImpl ...@@ -88,9 +88,9 @@ class TextureVk : public TextureImpl
public: public:
TextureVk(const gl::TextureState &state, RendererVk *renderer); TextureVk(const gl::TextureState &state, RendererVk *renderer);
~TextureVk() override; ~TextureVk() override;
gl::Error onDestroy(const gl::Context *context) override; void onDestroy(const gl::Context *context) override;
gl::Error setImage(const gl::Context *context, angle::Result setImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
...@@ -98,7 +98,7 @@ class TextureVk : public TextureImpl ...@@ -98,7 +98,7 @@ class TextureVk : public TextureImpl
GLenum type, GLenum type,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error setSubImage(const gl::Context *context, angle::Result setSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
...@@ -107,14 +107,14 @@ class TextureVk : public TextureImpl ...@@ -107,14 +107,14 @@ class TextureVk : public TextureImpl
gl::Buffer *unpackBuffer, gl::Buffer *unpackBuffer,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error setCompressedImage(const gl::Context *context, angle::Result setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size, const gl::Extents &size,
const gl::PixelUnpackState &unpack, const gl::PixelUnpackState &unpack,
size_t imageSize, size_t imageSize,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error setCompressedSubImage(const gl::Context *context, angle::Result setCompressedSubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Box &area, const gl::Box &area,
GLenum format, GLenum format,
...@@ -122,18 +122,18 @@ class TextureVk : public TextureImpl ...@@ -122,18 +122,18 @@ class TextureVk : public TextureImpl
size_t imageSize, size_t imageSize,
const uint8_t *pixels) override; const uint8_t *pixels) override;
gl::Error copyImage(const gl::Context *context, angle::Result copyImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Rectangle &sourceArea, const gl::Rectangle &sourceArea,
GLenum internalFormat, GLenum internalFormat,
gl::Framebuffer *source) override; gl::Framebuffer *source) override;
gl::Error copySubImage(const gl::Context *context, angle::Result copySubImage(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
const gl::Rectangle &sourceRect, const gl::Rectangle &sourceArea,
gl::Framebuffer *source) override; gl::Framebuffer *source) override;
gl::Error copyTexture(const gl::Context *context, angle::Result copyTexture(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
GLenum internalFormat, GLenum internalFormat,
GLenum type, GLenum type,
...@@ -142,7 +142,7 @@ class TextureVk : public TextureImpl ...@@ -142,7 +142,7 @@ class TextureVk : public TextureImpl
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source) override; const gl::Texture *source) override;
gl::Error copySubTexture(const gl::Context *context, angle::Result copySubTexture(const gl::Context *context,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
size_t sourceLevel, size_t sourceLevel,
...@@ -152,27 +152,27 @@ class TextureVk : public TextureImpl ...@@ -152,27 +152,27 @@ class TextureVk : public TextureImpl
bool unpackUnmultiplyAlpha, bool unpackUnmultiplyAlpha,
const gl::Texture *source) override; const gl::Texture *source) override;
gl::Error setStorage(const gl::Context *context, angle::Result setStorage(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
size_t levels, size_t levels,
GLenum internalFormat, GLenum internalFormat,
const gl::Extents &size) override; const gl::Extents &size) override;
gl::Error setEGLImageTarget(const gl::Context *context, angle::Result setEGLImageTarget(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Image *image) override; egl::Image *image) override;
gl::Error setImageExternal(const gl::Context *context, angle::Result setImageExternal(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
egl::Stream *stream, egl::Stream *stream,
const egl::Stream::GLTextureDescription &desc) override; const egl::Stream::GLTextureDescription &desc) override;
gl::Error generateMipmap(const gl::Context *context) override; angle::Result generateMipmap(const gl::Context *context) override;
gl::Error setBaseLevel(const gl::Context *context, GLuint baseLevel) override; angle::Result setBaseLevel(const gl::Context *context, GLuint baseLevel) override;
gl::Error bindTexImage(const gl::Context *context, egl::Surface *surface) override; angle::Result bindTexImage(const gl::Context *context, egl::Surface *surface) override;
gl::Error releaseTexImage(const gl::Context *context) override; angle::Result releaseTexImage(const gl::Context *context) override;
angle::Result getAttachmentRenderTarget(const gl::Context *context, angle::Result getAttachmentRenderTarget(const gl::Context *context,
GLenum binding, GLenum binding,
...@@ -182,7 +182,7 @@ class TextureVk : public TextureImpl ...@@ -182,7 +182,7 @@ class TextureVk : public TextureImpl
angle::Result syncState(const gl::Context *context, angle::Result syncState(const gl::Context *context,
const gl::Texture::DirtyBits &dirtyBits) override; const gl::Texture::DirtyBits &dirtyBits) override;
gl::Error setStorageMultisample(const gl::Context *context, angle::Result setStorageMultisample(const gl::Context *context,
gl::TextureType type, gl::TextureType type,
GLsizei samples, GLsizei samples,
GLint internalformat, GLint internalformat,
...@@ -240,7 +240,7 @@ class TextureVk : public TextureImpl ...@@ -240,7 +240,7 @@ class TextureVk : public TextureImpl
const gl::InternalFormat &internalFormat, const gl::InternalFormat &internalFormat,
gl::Framebuffer *source); gl::Framebuffer *source);
gl::Error copySubTextureImpl(ContextVk *contextVk, angle::Result copySubTextureImpl(ContextVk *contextVk,
const gl::ImageIndex &index, const gl::ImageIndex &index,
const gl::Offset &destOffset, const gl::Offset &destOffset,
const gl::InternalFormat &destFormat, const gl::InternalFormat &destFormat,
......
...@@ -37,9 +37,9 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest ...@@ -37,9 +37,9 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest
mSourceBuffer = new rx::Buffer11(mBufferState, mRenderer); mSourceBuffer = new rx::Buffer11(mBufferState, mRenderer);
GLfloat testData[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }; GLfloat testData[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f };
gl::Error error = mSourceBuffer->setData(nullptr, gl::BufferBinding::Array, testData, angle::Result error = mSourceBuffer->setData(nullptr, gl::BufferBinding::Array, testData,
sizeof(testData), gl::BufferUsage::StaticDraw); sizeof(testData), gl::BufferUsage::StaticDraw);
ASSERT_FALSE(error.isError()); ASSERT_EQ(angle::Result::Continue(), error);
mTranslatedAttribute.baseOffset = 0; mTranslatedAttribute.baseOffset = 0;
mTranslatedAttribute.usesFirstVertexOffset = false; mTranslatedAttribute.usesFirstVertexOffset = false;
...@@ -112,9 +112,9 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest ...@@ -112,9 +112,9 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest
void emulateAndCompare(rx::SourceIndexData *srcData) void emulateAndCompare(rx::SourceIndexData *srcData)
{ {
ID3D11Buffer *emulatedBuffer = nullptr; ID3D11Buffer *emulatedBuffer = nullptr;
gl::Error error = mSourceBuffer->getEmulatedIndexedBuffer( angle::Result error = mSourceBuffer->getEmulatedIndexedBuffer(
mContext, srcData, mTranslatedAttribute, 0, &emulatedBuffer); mContext, srcData, mTranslatedAttribute, 0, &emulatedBuffer);
ASSERT_FALSE(error.isError()); ASSERT_EQ(angle::Result::Continue(), error);
ASSERT_TRUE(emulatedBuffer != nullptr); ASSERT_TRUE(emulatedBuffer != nullptr);
compareContents(emulatedBuffer); compareContents(emulatedBuffer);
} }
...@@ -180,8 +180,8 @@ TEST_P(D3D11EmulatedIndexedBufferTest, TestSourceBufferRemainsUntouchedAfterExpa ...@@ -180,8 +180,8 @@ TEST_P(D3D11EmulatedIndexedBufferTest, TestSourceBufferRemainsUntouchedAfterExpa
const uint8_t *sourceBufferMem = nullptr; const uint8_t *sourceBufferMem = nullptr;
const uint8_t *cleanBufferMem = nullptr; const uint8_t *cleanBufferMem = nullptr;
gl::Error error = mSourceBuffer->getData(mContext, &sourceBufferMem); angle::Result error = mSourceBuffer->getData(mContext, &sourceBufferMem);
ASSERT_FALSE(error.isError()); ASSERT_EQ(angle::Result::Continue(), error);
error = cleanSourceBuffer->getData(mContext, &cleanBufferMem); error = cleanSourceBuffer->getData(mContext, &cleanBufferMem);
ASSERT_FALSE(error.isError()); ASSERT_FALSE(error.isError());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment