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,
}
template <typename T>
gl::Error GetQueryObjectParameter(const gl::Context *context,
angle::Result GetQueryObjectParameter(const gl::Context *context,
gl::Query *query,
GLenum pname,
T *params)
......@@ -122,16 +122,13 @@ gl::Error GetQueryObjectParameter(const gl::Context *context,
case GL_QUERY_RESULT_AVAILABLE_EXT:
{
bool available;
gl::Error error = query->isResultAvailable(context, &available);
if (!error.isError())
{
ANGLE_TRY(query->isResultAvailable(context, &available));
*params = gl::CastFromStateValue<T>(pname, static_cast<GLuint>(available));
}
return error;
return angle::Result::Continue();
}
default:
UNREACHABLE();
return gl::InternalError() << "Unreachable Error";
return angle::Result::Stop();
}
}
......
......@@ -62,7 +62,6 @@ class ANGLE_NO_DISCARD Error final
inline ~Error() = default;
// automatic error type conversion
inline Error(egl::Error &&eglErr);
inline Error(egl::Error eglErr);
inline Error &operator=(const Error &other);
......
......@@ -38,13 +38,6 @@ Error::Error(Error &&other)
}
// 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)
: mCode(GL_INVALID_OPERATION),
mID(0),
......
......@@ -72,7 +72,7 @@ void ImageSibling::setTargetImage(const gl::Context *context, egl::Image *imageT
imageTarget->addTargetSibling(this);
}
gl::Error ImageSibling::orphanImages(const gl::Context *context)
angle::Result ImageSibling::orphanImages(const gl::Context *context)
{
if (mTargetOf.get() != nullptr)
{
......@@ -91,7 +91,7 @@ gl::Error ImageSibling::orphanImages(const gl::Context *context)
mSourcesOf.clear();
}
return gl::NoError();
return angle::Result::Continue();
}
void ImageSibling::addImageSource(egl::Image *imageSource)
......@@ -273,7 +273,7 @@ void Image::addTargetSibling(ImageSibling *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);
......@@ -296,7 +296,7 @@ gl::Error Image::orphanSibling(const gl::Context *context, ImageSibling *sibling
mState.targets.erase(sibling);
}
return gl::NoError();
return angle::Result::Continue();
}
const gl::Format &Image::getFormat() const
......
......@@ -53,7 +53,7 @@ class ImageSibling : public gl::FramebufferAttachmentObject
void setTargetImage(const gl::Context *context, egl::Image *imageTarget);
// Orphan all EGL image sources and targets
gl::Error orphanImages(const gl::Context *context);
angle::Result orphanImages(const gl::Context *context);
private:
friend class Image;
......@@ -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
// 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;
rx::ImageImpl *mImplementation;
......
......@@ -76,7 +76,7 @@ Renderbuffer::Renderbuffer(rx::GLImplFactory *implFactory, GLuint id)
void Renderbuffer::onDestroy(const Context *context)
{
ANGLE_SWALLOW_ERR(orphanImages(context));
(void)(orphanImages(context));
if (mImplementation)
{
......@@ -103,7 +103,7 @@ angle::Result Renderbuffer::setStorage(const Context *context,
size_t width,
size_t height)
{
ANGLE_TRY_HANDLE(context, orphanImages(context));
ANGLE_TRY(orphanImages(context));
ANGLE_TRY(mImplementation->setStorage(context, internalformat, width, height));
mState.update(static_cast<GLsizei>(width), static_cast<GLsizei>(height), Format(internalformat),
......@@ -119,7 +119,7 @@ angle::Result Renderbuffer::setStorageMultisample(const Context *context,
size_t width,
size_t height)
{
ANGLE_TRY_HANDLE(context, orphanImages(context));
ANGLE_TRY(orphanImages(context));
ANGLE_TRY(
mImplementation->setStorageMultisample(context, samples, internalformat, width, height));
......@@ -132,7 +132,7 @@ angle::Result Renderbuffer::setStorageMultisample(const Context *context,
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));
setTargetImage(context, image);
......
......@@ -203,8 +203,8 @@ Error Stream::consumerAcquire(const gl::Context *context)
{
if (mPlanes[i].texture != nullptr)
{
ANGLE_TRY(mPlanes[i].texture->acquireImageFromStream(
context, mProducerImplementation->getGLFrameDescription(i)));
ANGLE_TRY(gl::Error(mPlanes[i].texture->acquireImageFromStream(
context, mProducerImplementation->getGLFrameDescription(i))));
}
}
......@@ -224,7 +224,7 @@ Error Stream::consumerRelease(const gl::Context *context)
{
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,
const SamplerState &getSamplerState() const;
gl::Error setBaseLevel(const Context *context, GLuint baseLevel);
angle::Result setBaseLevel(const Context *context, GLuint baseLevel);
GLuint getBaseLevel() const;
void setMaxLevel(GLuint maxLevel);
......@@ -283,7 +283,7 @@ class Texture final : public RefCountObject,
bool isMipmapComplete() const;
Error setImage(const Context *context,
angle::Result setImage(const Context *context,
const PixelUnpackState &unpackState,
TextureTarget target,
GLint level,
......@@ -292,7 +292,7 @@ class Texture final : public RefCountObject,
GLenum format,
GLenum type,
const uint8_t *pixels);
Error setSubImage(const Context *context,
angle::Result setSubImage(const Context *context,
const PixelUnpackState &unpackState,
Buffer *unpackBuffer,
TextureTarget target,
......@@ -302,7 +302,7 @@ class Texture final : public RefCountObject,
GLenum type,
const uint8_t *pixels);
Error setCompressedImage(const Context *context,
angle::Result setCompressedImage(const Context *context,
const PixelUnpackState &unpackState,
TextureTarget target,
GLint level,
......@@ -310,7 +310,7 @@ class Texture final : public RefCountObject,
const Extents &size,
size_t imageSize,
const uint8_t *pixels);
Error setCompressedSubImage(const Context *context,
angle::Result setCompressedSubImage(const Context *context,
const PixelUnpackState &unpackState,
TextureTarget target,
GLint level,
......@@ -319,20 +319,20 @@ class Texture final : public RefCountObject,
size_t imageSize,
const uint8_t *pixels);
Error copyImage(const Context *context,
angle::Result copyImage(const Context *context,
TextureTarget target,
GLint level,
const Rectangle &sourceArea,
GLenum internalFormat,
Framebuffer *source);
Error copySubImage(const Context *context,
angle::Result copySubImage(const Context *context,
TextureTarget target,
GLint level,
const Offset &destOffset,
const Rectangle &sourceArea,
Framebuffer *source);
Error copyTexture(const Context *context,
angle::Result copyTexture(const Context *context,
TextureTarget target,
GLint level,
GLenum internalFormat,
......@@ -342,7 +342,7 @@ class Texture final : public RefCountObject,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
Texture *source);
Error copySubTexture(const Context *context,
angle::Result copySubTexture(const Context *context,
TextureTarget target,
GLint level,
const Offset &destOffset,
......@@ -352,24 +352,26 @@ class Texture final : public RefCountObject,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
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,
GLsizei levels,
GLenum internalFormat,
const Extents &size);
Error setStorageMultisample(const Context *context,
angle::Result setStorageMultisample(const Context *context,
TextureType type,
GLsizei samples,
GLint internalformat,
const Extents &size,
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::Stream *getBoundStream() const;
......@@ -459,26 +461,26 @@ class Texture final : public RefCountObject,
// ANGLE-only method, used internally
friend class egl::Surface;
Error bindTexImageFromSurface(const Context *context, egl::Surface *surface);
Error releaseTexImageFromSurface(const Context *context);
angle::Result bindTexImageFromSurface(const Context *context, egl::Surface *surface);
angle::Result releaseTexImageFromSurface(const Context *context);
// ANGLE-only methods, used internally
friend class egl::Stream;
void bindStream(egl::Stream *stream);
void releaseStream();
Error acquireImageFromStream(const Context *context,
angle::Result acquireImageFromStream(const Context *context,
const egl::Stream::GLTextureDescription &desc);
Error releaseImageFromStream(const Context *context);
angle::Result releaseImageFromStream(const Context *context);
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,
size_t level,
const gl::Box &area);
Error handleMipmapGenerationHint(const Context *context, int level);
angle::Result handleMipmapGenerationHint(const Context *context, int level);
TextureState mState;
DirtyBits mDirtyBits;
......
......@@ -47,7 +47,7 @@ class ImageImpl : angle::NonCopyable
virtual ~ImageImpl() {}
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:
const egl::ImageState &mState;
......
......@@ -21,7 +21,7 @@ class MockImageImpl : public ImageImpl
MockImageImpl(const egl::ImageState &state) : ImageImpl(state) {}
virtual ~MockImageImpl() { destructor(); }
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());
};
} // namespace rx
......
......@@ -22,7 +22,7 @@ class PathImpl : angle::NonCopyable
public:
virtual ~PathImpl() {}
virtual gl::Error setCommands(GLsizei numCommands,
virtual angle::Result setCommands(GLsizei numCommands,
const GLubyte *commands,
GLsizei numCoords,
GLenum coordType,
......
......@@ -10,7 +10,6 @@
namespace rx
{
TextureImpl::TextureImpl(const gl::TextureState &state) : mState(state)
{
}
......@@ -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,
GLenum internalFormat,
GLenum type,
......@@ -35,10 +33,10 @@ gl::Error TextureImpl::copyTexture(const gl::Context *context,
const gl::Texture *source)
{
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::Offset &destOffset,
size_t sourceLevel,
......@@ -49,16 +47,17 @@ gl::Error TextureImpl::copySubTexture(const gl::Context *context,
const gl::Texture *source)
{
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();
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,
GLenum internalFormat,
GLenum type,
......@@ -70,10 +69,10 @@ gl::Error TextureImpl::copy3DTexture(const gl::Context *context,
const gl::Texture *source)
{
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::Offset &destOffset,
size_t sourceLevel,
......@@ -85,7 +84,6 @@ gl::Error TextureImpl::copy3DSubTexture(const gl::Context *context,
const gl::Texture *source)
{
UNREACHABLE();
return gl::InternalError() << "ANGLE_copy_texture_3d exposed but not implemented.";
return angle::Result::Stop();
}
} // namespace rx
......@@ -46,9 +46,9 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
TextureImpl(const gl::TextureState &state);
~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,
GLenum internalFormat,
const gl::Extents &size,
......@@ -56,7 +56,7 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
GLenum type,
const gl::PixelUnpackState &unpack,
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::Box &area,
GLenum format,
......@@ -65,14 +65,14 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
gl::Buffer *unpackBuffer,
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,
GLenum internalFormat,
const gl::Extents &size,
const gl::PixelUnpackState &unpack,
size_t imageSize,
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::Box &area,
GLenum format,
......@@ -80,18 +80,18 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
size_t imageSize,
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::Rectangle &sourceArea,
GLenum internalFormat,
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::Offset &destOffset,
const gl::Rectangle &sourceArea,
gl::Framebuffer *source) = 0;
virtual gl::Error copyTexture(const gl::Context *context,
virtual angle::Result copyTexture(const gl::Context *context,
const gl::ImageIndex &index,
GLenum internalFormat,
GLenum type,
......@@ -100,7 +100,7 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
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::Offset &destOffset,
size_t sourceLevel,
......@@ -110,9 +110,10 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
bool unpackUnmultiplyAlpha,
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,
GLenum internalFormat,
GLenum type,
......@@ -122,7 +123,7 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
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::Offset &destOffset,
size_t sourceLevel,
......@@ -133,34 +134,34 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
bool unpackUnmultiplyAlpha,
const gl::Texture *source);
virtual gl::Error setStorage(const gl::Context *context,
virtual angle::Result setStorage(const gl::Context *context,
gl::TextureType type,
size_t levels,
GLenum internalFormat,
const gl::Extents &size) = 0;
virtual gl::Error setStorageMultisample(const gl::Context *context,
virtual angle::Result setStorageMultisample(const gl::Context *context,
gl::TextureType type,
GLsizei samples,
GLint internalformat,
const gl::Extents &size,
bool fixedSampleLocations) = 0;
virtual gl::Error setEGLImageTarget(const gl::Context *context,
virtual angle::Result setEGLImageTarget(const gl::Context *context,
gl::TextureType type,
egl::Image *image) = 0;
virtual gl::Error setImageExternal(const gl::Context *context,
virtual angle::Result setImageExternal(const gl::Context *context,
gl::TextureType type,
egl::Stream *stream,
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 gl::Error releaseTexImage(const gl::Context *context) = 0;
virtual angle::Result bindTexImage(const gl::Context *context, egl::Surface *surface) = 0;
virtual angle::Result releaseTexImage(const gl::Context *context) = 0;
// Override if accurate native memory size information is available
virtual GLint getMemorySize() const { return 0; }
......
......@@ -22,7 +22,7 @@ class MockTextureImpl : public TextureImpl
MockTextureImpl() : TextureImpl(mMockState), mMockState(gl::TextureType::_2D) {}
virtual ~MockTextureImpl() { destructor(); }
MOCK_METHOD8(setImage,
gl::Error(const gl::Context *,
angle::Result(const gl::Context *,
const gl::ImageIndex &,
GLenum,
const gl::Extents &,
......@@ -31,7 +31,7 @@ class MockTextureImpl : public TextureImpl
const gl::PixelUnpackState &,
const uint8_t *));
MOCK_METHOD8(setSubImage,
gl::Error(const gl::Context *,
angle::Result(const gl::Context *,
const gl::ImageIndex &,
const gl::Box &,
GLenum,
......@@ -40,7 +40,7 @@ class MockTextureImpl : public TextureImpl
gl::Buffer *,
const uint8_t *));
MOCK_METHOD7(setCompressedImage,
gl::Error(const gl::Context *,
angle::Result(const gl::Context *,
const gl::ImageIndex &,
GLenum,
const gl::Extents &,
......@@ -48,7 +48,7 @@ class MockTextureImpl : public TextureImpl
size_t,
const uint8_t *));
MOCK_METHOD7(setCompressedSubImage,
gl::Error(const gl::Context *,
angle::Result(const gl::Context *,
const gl::ImageIndex &,
const gl::Box &,
GLenum,
......@@ -56,19 +56,19 @@ class MockTextureImpl : public TextureImpl
size_t,
const uint8_t *));
MOCK_METHOD5(copyImage,
gl::Error(const gl::Context *,
angle::Result(const gl::Context *,
const gl::ImageIndex &,
const gl::Rectangle &,
GLenum,
gl::Framebuffer *));
MOCK_METHOD5(copySubImage,
gl::Error(const gl::Context *,
angle::Result(const gl::Context *,
const gl::ImageIndex &,
const gl::Offset &,
const gl::Rectangle &,
gl::Framebuffer *));
MOCK_METHOD9(copyTexture,
gl::Error(const gl::Context *,
angle::Result(const gl::Context *,
const gl::ImageIndex &,
GLenum,
GLenum,
......@@ -78,7 +78,7 @@ class MockTextureImpl : public TextureImpl
bool,
const gl::Texture *));
MOCK_METHOD9(copySubTexture,
gl::Error(const gl::Context *,
angle::Result(const gl::Context *,
const gl::ImageIndex &,
const gl::Offset &,
size_t,
......@@ -87,19 +87,21 @@ class MockTextureImpl : public TextureImpl
bool,
bool,
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(
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,
gl::Error(const gl::Context *,
angle::Result(const gl::Context *,
gl::TextureType,
egl::Stream *,
const egl::Stream::GLTextureDescription &));
MOCK_METHOD3(setEGLImageTarget, gl::Error(const gl::Context *, gl::TextureType, egl::Image *));
MOCK_METHOD1(generateMipmap, gl::Error(const gl::Context *));
MOCK_METHOD2(bindTexImage, gl::Error(const gl::Context *, egl::Surface *));
MOCK_METHOD1(releaseTexImage, gl::Error(const gl::Context *));
MOCK_METHOD3(setEGLImageTarget,
angle::Result(const gl::Context *, gl::TextureType, egl::Image *));
MOCK_METHOD1(generateMipmap, angle::Result(const gl::Context *));
MOCK_METHOD2(bindTexImage, angle::Result(const gl::Context *, egl::Surface *));
MOCK_METHOD1(releaseTexImage, angle::Result(const gl::Context *));
MOCK_METHOD4(getAttachmentRenderTarget,
angle::Result(const gl::Context *,
......@@ -107,11 +109,15 @@ class MockTextureImpl : public TextureImpl
const gl::ImageIndex &,
FramebufferAttachmentRenderTarget **));
MOCK_METHOD6(
setStorageMultisample,
gl::Error(const gl::Context *, gl::TextureType, GLsizei, GLint, const gl::Extents &, bool));
MOCK_METHOD6(setStorageMultisample,
angle::Result(const gl::Context *,
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 &));
......
......@@ -43,14 +43,14 @@ egl::Error EGLImageD3D::initialize(const egl::Display *display)
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)
{
ANGLE_TRY(copyToLocalRendertarget(context));
}
return gl::NoError();
return angle::Result::Continue();
}
angle::Result EGLImageD3D::getRenderTarget(const gl::Context *context,
......@@ -71,7 +71,7 @@ angle::Result EGLImageD3D::getRenderTarget(const gl::Context *context,
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(mRenderTarget == nullptr);
......
......@@ -40,12 +40,12 @@ class EGLImageD3D final : public ImageImpl
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;
private:
gl::Error copyToLocalRendertarget(const gl::Context *context);
angle::Result copyToLocalRendertarget(const gl::Context *context);
RendererD3D *mRenderer;
RenderTargetD3D *mRenderTarget;
......
......@@ -204,8 +204,8 @@ GLenum FramebufferD3D::getImplementationColorReadFormat(const gl::Context *conte
}
RenderTargetD3D *attachmentRenderTarget = nullptr;
gl::Error error = readAttachment->getRenderTarget(context, &attachmentRenderTarget);
if (error.isError())
angle::Result error = readAttachment->getRenderTarget(context, &attachmentRenderTarget);
if (error != angle::Result::Continue())
{
return GL_NONE;
}
......@@ -227,8 +227,8 @@ GLenum FramebufferD3D::getImplementationColorReadType(const gl::Context *context
}
RenderTargetD3D *attachmentRenderTarget = nullptr;
gl::Error error = readAttachment->getRenderTarget(context, &attachmentRenderTarget);
if (error.isError())
angle::Result error = readAttachment->getRenderTarget(context, &attachmentRenderTarget);
if (error != angle::Result::Continue())
{
return GL_NONE;
}
......
......@@ -603,7 +603,7 @@ angle::Result Context11::getIncompleteTexture(const gl::Context *context,
return angle::Result::Continue();
}
gl::Error Context11::initializeMultisampleTextureToBlack(const gl::Context *context,
angle::Result Context11::initializeMultisampleTextureToBlack(const gl::Context *context,
gl::Texture *glTexture)
{
ASSERT(glTexture->getType() == gl::TextureType::_2DMultisample);
......
......@@ -158,7 +158,7 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
gl::TextureType type,
gl::Texture **textureOut);
gl::Error initializeMultisampleTextureToBlack(const gl::Context *context,
angle::Result initializeMultisampleTextureToBlack(const gl::Context *context,
gl::Texture *glTexture) override;
void handleResult(HRESULT hr,
......
......@@ -26,11 +26,11 @@ class ImageGL : public ImageImpl
// TextureGL does not have access to all the parameters needed to implement
// glEGLImageTargetTexture2DOES or glEGLImageTargetRenderbufferStorageOES. This allows the Image
// 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,
TextureGL *texture,
GLenum *outInternalFormat) = 0;
virtual gl::Error setRenderbufferStorage(const gl::Context *context,
virtual angle::Result setRenderbufferStorage(const gl::Context *context,
RenderbufferGL *renderbuffer,
GLenum *outInternalFormat) = 0;
};
......
......@@ -11,7 +11,6 @@
namespace rx
{
PathGL::PathGL(const FunctionsGL *functions, GLuint path) : mFunctions(functions), mPathID(path)
{
}
......@@ -20,19 +19,18 @@ PathGL::~PathGL()
{
}
gl::Error PathGL::setCommands(GLsizei numCommands,
angle::Result PathGL::setCommands(GLsizei numCommands,
const GLubyte *commands,
GLsizei numCoords,
GLenum coordType,
const void *coords)
{
mFunctions->pathCommandsNV(mPathID, numCommands, commands, numCoords, coordType, coords);
return gl::NoError();
return angle::Result::Continue();
}
void PathGL::setPathParameter(GLenum pname, GLfloat value)
{
mFunctions->pathParameterfNV(mPathID, pname, value);
}
} // rx
} // namespace rx
......@@ -23,7 +23,7 @@ class PathGL : public PathImpl
PathGL(const FunctionsGL *functions, GLuint path);
~PathGL() override;
gl::Error setCommands(GLsizei numCommands,
angle::Result setCommands(GLsizei numCommands,
const GLubyte *commands,
GLsizei numCoords,
GLenum coordType,
......
......@@ -59,9 +59,9 @@ class TextureGL : public TextureImpl
TextureGL(const gl::TextureState &state, GLuint id);
~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,
GLenum internalFormat,
const gl::Extents &size,
......@@ -69,7 +69,7 @@ class TextureGL : public TextureImpl
GLenum type,
const gl::PixelUnpackState &unpack,
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::Box &area,
GLenum format,
......@@ -78,14 +78,14 @@ class TextureGL : public TextureImpl
gl::Buffer *unpackBuffer,
const uint8_t *pixels) override;
gl::Error setCompressedImage(const gl::Context *context,
angle::Result setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index,
GLenum internalFormat,
const gl::Extents &size,
const gl::PixelUnpackState &unpack,
size_t imageSize,
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::Box &area,
GLenum format,
......@@ -93,18 +93,18 @@ class TextureGL : public TextureImpl
size_t imageSize,
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::Rectangle &sourceArea,
GLenum internalFormat,
gl::Framebuffer *source) override;
gl::Error copySubImage(const gl::Context *context,
angle::Result copySubImage(const gl::Context *context,
const gl::ImageIndex &index,
const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
gl::Framebuffer *source) override;
gl::Error copyTexture(const gl::Context *context,
angle::Result copyTexture(const gl::Context *context,
const gl::ImageIndex &index,
GLenum internalFormat,
GLenum type,
......@@ -113,7 +113,7 @@ class TextureGL : public TextureImpl
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
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::Offset &destOffset,
size_t sourceLevel,
......@@ -122,7 +122,7 @@ class TextureGL : public TextureImpl
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error copySubTextureHelper(const gl::Context *context,
angle::Result copySubTextureHelper(const gl::Context *context,
gl::TextureTarget target,
size_t level,
const gl::Offset &destOffset,
......@@ -134,30 +134,30 @@ class TextureGL : public TextureImpl
bool unpackUnmultiplyAlpha,
const gl::Texture *source);
gl::Error setStorage(const gl::Context *context,
angle::Result setStorage(const gl::Context *context,
gl::TextureType type,
size_t levels,
GLenum internalFormat,
const gl::Extents &size) override;
gl::Error setStorageMultisample(const gl::Context *context,
angle::Result setStorageMultisample(const gl::Context *context,
gl::TextureType type,
GLsizei samples,
GLint internalFormat,
GLint internalformat,
const gl::Extents &size,
bool fixedSampleLocations) override;
gl::Error setImageExternal(const gl::Context *context,
angle::Result setImageExternal(const gl::Context *context,
gl::TextureType type,
egl::Stream *stream,
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;
gl::Error releaseTexImage(const gl::Context *context) override;
angle::Result bindTexImage(const gl::Context *context, egl::Surface *surface) 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,
egl::Image *image) override;
......@@ -169,7 +169,7 @@ class TextureGL : public TextureImpl
const gl::Texture::DirtyBits &dirtyBits) override;
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,
const gl::ImageIndex &imageIndex) override;
......@@ -198,7 +198,7 @@ class TextureGL : public TextureImpl
const gl::Extents &size,
GLenum format,
GLenum type);
gl::Error setSubImageRowByRowWorkaround(const gl::Context *context,
angle::Result setSubImageRowByRowWorkaround(const gl::Context *context,
gl::TextureTarget target,
size_t level,
const gl::Box &area,
......@@ -208,7 +208,7 @@ class TextureGL : public TextureImpl
const gl::Buffer *unpackBuffer,
const uint8_t *pixels);
gl::Error setSubImagePaddingWorkaround(const gl::Context *context,
angle::Result setSubImagePaddingWorkaround(const gl::Context *context,
gl::TextureTarget target,
size_t level,
const gl::Box &area,
......
......@@ -98,13 +98,13 @@ egl::Error ImageEGL::initialize(const egl::Display *display)
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.
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,
TextureGL *texture,
GLenum *outInternalFormat)
......@@ -119,10 +119,10 @@ gl::Error ImageEGL::setTexture2D(const gl::Context *context,
functionsGL->eGLImageTargetTexture2DOES(ToGLenum(type), mImage);
*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,
GLenum *outInternalFormat)
{
......@@ -136,7 +136,7 @@ gl::Error ImageEGL::setRenderbufferStorage(const gl::Context *context,
functionsGL->eGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, mImage);
*outInternalFormat = mNativeInternalFormat;
return gl::NoError();
return angle::Result::Continue();
}
} // namespace rx
......@@ -33,13 +33,13 @@ class ImageEGL final : public ImageGL
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,
TextureGL *texture,
GLenum *outInternalFormat) override;
gl::Error setRenderbufferStorage(const gl::Context *context,
angle::Result setRenderbufferStorage(const gl::Context *context,
RenderbufferGL *renderbuffer,
GLenum *outInternalFormat) override;
......
......@@ -27,9 +27,9 @@ egl::Error ImageNULL::initialize(const egl::Display *display)
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
......@@ -22,7 +22,7 @@ class ImageNULL : public ImageImpl
~ImageNULL() 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
......
......@@ -13,7 +13,6 @@
namespace rx
{
PathNULL::PathNULL() : PathImpl()
{
}
......@@ -22,19 +21,16 @@ PathNULL::~PathNULL()
{
}
gl::Error PathNULL::setCommands(GLsizei numCommands,
angle::Result PathNULL::setCommands(GLsizei numCommands,
const GLubyte *commands,
GLsizei numCoords,
GLenum coordType,
const void *coords)
{
UNIMPLEMENTED();
return gl::InternalError();
return angle::Result::Continue();
}
void PathNULL::setPathParameter(GLenum pname, GLfloat value)
{
UNIMPLEMENTED();
}
} // namespace rx
......@@ -21,7 +21,7 @@ class PathNULL : public PathImpl
PathNULL();
~PathNULL() override;
gl::Error setCommands(GLsizei numCommands,
angle::Result setCommands(GLsizei numCommands,
const GLubyte *commands,
GLsizei numCoords,
GLenum coordType,
......
......@@ -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,
GLenum internalFormat,
const gl::Extents &size,
......@@ -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
// 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::Box &area,
GLenum format,
......@@ -45,10 +45,10 @@ gl::Error TextureNULL::setSubImage(const gl::Context *context,
gl::Buffer *unpackBuffer,
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,
GLenum internalFormat,
const gl::Extents &size,
......@@ -56,10 +56,10 @@ gl::Error TextureNULL::setCompressedImage(const gl::Context *context,
size_t imageSize,
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::Box &area,
GLenum format,
......@@ -67,69 +67,69 @@ gl::Error TextureNULL::setCompressedSubImage(const gl::Context *context,
size_t imageSize,
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::Rectangle &sourceArea,
GLenum internalFormat,
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::Offset &destOffset,
const gl::Rectangle &sourceArea,
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,
size_t levels,
GLenum internalFormat,
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,
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,
egl::Stream *stream,
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,
......@@ -138,14 +138,14 @@ angle::Result TextureNULL::syncState(const gl::Context *context,
return angle::Result::Continue();
}
gl::Error TextureNULL::setStorageMultisample(const gl::Context *context,
angle::Result TextureNULL::setStorageMultisample(const gl::Context *context,
gl::TextureType type,
GLsizei samples,
GLint internalformat,
const gl::Extents &size,
bool fixedSampleLocations)
{
return gl::NoError();
return angle::Result::Continue();
}
angle::Result TextureNULL::initializeContents(const gl::Context *context,
......
......@@ -21,7 +21,7 @@ class TextureNULL : public TextureImpl
TextureNULL(const gl::TextureState &state);
~TextureNULL() override;
gl::Error setImage(const gl::Context *context,
angle::Result setImage(const gl::Context *context,
const gl::ImageIndex &index,
GLenum internalFormat,
const gl::Extents &size,
......@@ -29,7 +29,7 @@ class TextureNULL : public TextureImpl
GLenum type,
const gl::PixelUnpackState &unpack,
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::Box &area,
GLenum format,
......@@ -38,14 +38,14 @@ class TextureNULL : public TextureImpl
gl::Buffer *unpackBuffer,
const uint8_t *pixels) override;
gl::Error setCompressedImage(const gl::Context *context,
angle::Result setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index,
GLenum internalFormat,
const gl::Extents &size,
const gl::PixelUnpackState &unpack,
size_t imageSize,
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::Box &area,
GLenum format,
......@@ -53,43 +53,43 @@ class TextureNULL : public TextureImpl
size_t imageSize,
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::Rectangle &sourceArea,
GLenum internalFormat,
gl::Framebuffer *source) override;
gl::Error copySubImage(const gl::Context *context,
angle::Result copySubImage(const gl::Context *context,
const gl::ImageIndex &index,
const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
gl::Framebuffer *source) override;
gl::Error setStorage(const gl::Context *context,
angle::Result setStorage(const gl::Context *context,
gl::TextureType type,
size_t levels,
GLenum internalFormat,
const gl::Extents &size) override;
gl::Error setEGLImageTarget(const gl::Context *context,
angle::Result setEGLImageTarget(const gl::Context *context,
gl::TextureType type,
egl::Image *image) override;
gl::Error setImageExternal(const gl::Context *context,
angle::Result setImageExternal(const gl::Context *context,
gl::TextureType type,
egl::Stream *stream,
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;
gl::Error releaseTexImage(const gl::Context *context) override;
angle::Result bindTexImage(const gl::Context *context, egl::Surface *surface) override;
angle::Result releaseTexImage(const gl::Context *context) override;
angle::Result syncState(const gl::Context *context,
const gl::Texture::DirtyBits &dirtyBits) override;
gl::Error setStorageMultisample(const gl::Context *context,
angle::Result setStorageMultisample(const gl::Context *context,
gl::TextureType type,
GLsizei samples,
GLint internalformat,
......
......@@ -413,7 +413,7 @@ void IncompleteTextureSet::onDestroy(const gl::Context *context)
}
}
gl::Error IncompleteTextureSet::getIncompleteTexture(
angle::Result IncompleteTextureSet::getIncompleteTexture(
const gl::Context *context,
gl::TextureType type,
MultisampleTextureInitializer *multisampleInitializer,
......@@ -422,7 +422,7 @@ gl::Error IncompleteTextureSet::getIncompleteTexture(
*textureOut = mIncompleteTextures[type].get();
if (*textureOut != nullptr)
{
return gl::NoError();
return angle::Result::Continue();
}
ContextImpl *implFactory = context->getImplementation();
......@@ -472,7 +472,7 @@ gl::Error IncompleteTextureSet::getIncompleteTexture(
mIncompleteTextures[type].set(context, t.release());
*textureOut = mIncompleteTextures[type].get();
return gl::NoError();
return angle::Result::Continue();
}
#define ANGLE_INSTANTIATE_SET_UNIFORM_MATRIX_FUNC(cols, rows) \
......
......@@ -236,7 +236,7 @@ class MultisampleTextureInitializer
{
public:
virtual ~MultisampleTextureInitializer() {}
virtual gl::Error initializeMultisampleTextureToBlack(const gl::Context *context,
virtual angle::Result initializeMultisampleTextureToBlack(const gl::Context *context,
gl::Texture *glTexture) = 0;
};
......@@ -248,7 +248,7 @@ class IncompleteTextureSet final : angle::NonCopyable
void onDestroy(const gl::Context *context);
gl::Error getIncompleteTexture(const gl::Context *context,
angle::Result getIncompleteTexture(const gl::Context *context,
gl::TextureType type,
MultisampleTextureInitializer *multisampleInitializer,
gl::Texture **textureOut);
......
......@@ -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::Texture **textureOut)
{
......@@ -1259,7 +1259,7 @@ angle::Result ContextVk::updateActiveTextures(const gl::Context *context)
// Null textures represent incomplete textures.
if (texture == nullptr)
{
ANGLE_TRY_HANDLE(context, getIncompleteTexture(context, textureType, &texture));
ANGLE_TRY(getIncompleteTexture(context, textureType, &texture));
}
mActiveTextures[textureUnit] = vk::GetImpl(texture);
......
......@@ -174,7 +174,7 @@ class ContextVk : public ContextImpl, public vk::Context
const VkClearValue &getClearDepthStencilValue() const;
VkColorComponentFlags getClearColorMask() const;
const VkRect2D &getScissor() const { return mScissor; }
gl::Error getIncompleteTexture(const gl::Context *context,
angle::Result getIncompleteTexture(const gl::Context *context,
gl::TextureType type,
gl::Texture **textureOut);
void updateColorMask(const gl::BlendState &blendState);
......
......@@ -10,6 +10,9 @@
#include "libANGLE/renderer/vulkan/ImageVk.h"
#include "common/debug.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "libANGLE/renderer/vulkan/vk_utils.h"
namespace rx
{
......@@ -28,10 +31,9 @@ egl::Error ImageVk::initialize(const egl::Display *display)
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();
return gl::InternalError();
ANGLE_VK_UNREACHABLE(vk::GetImpl(context));
return angle::Result::Stop();
}
} // namespace rx
......@@ -22,7 +22,7 @@ class ImageVk : public ImageImpl
~ImageVk() 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
......
......@@ -88,9 +88,9 @@ class TextureVk : public TextureImpl
public:
TextureVk(const gl::TextureState &state, RendererVk *renderer);
~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,
GLenum internalFormat,
const gl::Extents &size,
......@@ -98,7 +98,7 @@ class TextureVk : public TextureImpl
GLenum type,
const gl::PixelUnpackState &unpack,
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::Box &area,
GLenum format,
......@@ -107,14 +107,14 @@ class TextureVk : public TextureImpl
gl::Buffer *unpackBuffer,
const uint8_t *pixels) override;
gl::Error setCompressedImage(const gl::Context *context,
angle::Result setCompressedImage(const gl::Context *context,
const gl::ImageIndex &index,
GLenum internalFormat,
const gl::Extents &size,
const gl::PixelUnpackState &unpack,
size_t imageSize,
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::Box &area,
GLenum format,
......@@ -122,18 +122,18 @@ class TextureVk : public TextureImpl
size_t imageSize,
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::Rectangle &sourceArea,
GLenum internalFormat,
gl::Framebuffer *source) override;
gl::Error copySubImage(const gl::Context *context,
angle::Result copySubImage(const gl::Context *context,
const gl::ImageIndex &index,
const gl::Offset &destOffset,
const gl::Rectangle &sourceRect,
const gl::Rectangle &sourceArea,
gl::Framebuffer *source) override;
gl::Error copyTexture(const gl::Context *context,
angle::Result copyTexture(const gl::Context *context,
const gl::ImageIndex &index,
GLenum internalFormat,
GLenum type,
......@@ -142,7 +142,7 @@ class TextureVk : public TextureImpl
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
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::Offset &destOffset,
size_t sourceLevel,
......@@ -152,27 +152,27 @@ class TextureVk : public TextureImpl
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error setStorage(const gl::Context *context,
angle::Result setStorage(const gl::Context *context,
gl::TextureType type,
size_t levels,
GLenum internalFormat,
const gl::Extents &size) override;
gl::Error setEGLImageTarget(const gl::Context *context,
angle::Result setEGLImageTarget(const gl::Context *context,
gl::TextureType type,
egl::Image *image) override;
gl::Error setImageExternal(const gl::Context *context,
angle::Result setImageExternal(const gl::Context *context,
gl::TextureType type,
egl::Stream *stream,
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;
gl::Error releaseTexImage(const gl::Context *context) override;
angle::Result bindTexImage(const gl::Context *context, egl::Surface *surface) override;
angle::Result releaseTexImage(const gl::Context *context) override;
angle::Result getAttachmentRenderTarget(const gl::Context *context,
GLenum binding,
......@@ -182,7 +182,7 @@ class TextureVk : public TextureImpl
angle::Result syncState(const gl::Context *context,
const gl::Texture::DirtyBits &dirtyBits) override;
gl::Error setStorageMultisample(const gl::Context *context,
angle::Result setStorageMultisample(const gl::Context *context,
gl::TextureType type,
GLsizei samples,
GLint internalformat,
......@@ -240,7 +240,7 @@ class TextureVk : public TextureImpl
const gl::InternalFormat &internalFormat,
gl::Framebuffer *source);
gl::Error copySubTextureImpl(ContextVk *contextVk,
angle::Result copySubTextureImpl(ContextVk *contextVk,
const gl::ImageIndex &index,
const gl::Offset &destOffset,
const gl::InternalFormat &destFormat,
......
......@@ -37,9 +37,9 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest
mSourceBuffer = new rx::Buffer11(mBufferState, mRenderer);
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);
ASSERT_FALSE(error.isError());
ASSERT_EQ(angle::Result::Continue(), error);
mTranslatedAttribute.baseOffset = 0;
mTranslatedAttribute.usesFirstVertexOffset = false;
......@@ -112,9 +112,9 @@ class D3D11EmulatedIndexedBufferTest : public ANGLETest
void emulateAndCompare(rx::SourceIndexData *srcData)
{
ID3D11Buffer *emulatedBuffer = nullptr;
gl::Error error = mSourceBuffer->getEmulatedIndexedBuffer(
angle::Result error = mSourceBuffer->getEmulatedIndexedBuffer(
mContext, srcData, mTranslatedAttribute, 0, &emulatedBuffer);
ASSERT_FALSE(error.isError());
ASSERT_EQ(angle::Result::Continue(), error);
ASSERT_TRUE(emulatedBuffer != nullptr);
compareContents(emulatedBuffer);
}
......@@ -180,8 +180,8 @@ TEST_P(D3D11EmulatedIndexedBufferTest, TestSourceBufferRemainsUntouchedAfterExpa
const uint8_t *sourceBufferMem = nullptr;
const uint8_t *cleanBufferMem = nullptr;
gl::Error error = mSourceBuffer->getData(mContext, &sourceBufferMem);
ASSERT_FALSE(error.isError());
angle::Result error = mSourceBuffer->getData(mContext, &sourceBufferMem);
ASSERT_EQ(angle::Result::Continue(), error);
error = cleanSourceBuffer->getData(mContext, &cleanBufferMem);
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