Commit 6c70bd8a by Jamie Madill Committed by Commit Bot

Mark key functions as nodiscard.

This marks the internal format pixel bytes compute helpers and the Context scratch and zero buffer helpers as "no discard". This prevents sketchy code where we don't catch error values. Bug: angleproject:2713 Change-Id: Ic6d285897dc36ad529cd5361d2763338578df61f Reviewed-on: https://chromium-review.googlesource.com/1134207Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 5396f2a6
...@@ -1404,8 +1404,10 @@ class Context final : public egl::LabeledObject, angle::NonCopyable ...@@ -1404,8 +1404,10 @@ class Context final : public egl::LabeledObject, angle::NonCopyable
rx::ContextImpl *getImplementation() const { return mImplementation.get(); } rx::ContextImpl *getImplementation() const { return mImplementation.get(); }
const Workarounds &getWorkarounds() const; const Workarounds &getWorkarounds() const;
bool getScratchBuffer(size_t requestedSizeBytes, angle::MemoryBuffer **scratchBufferOut) const; ANGLE_NO_DISCARD bool getScratchBuffer(size_t requestedSizeBytes,
bool getZeroFilledBuffer(size_t requstedSizeBytes, angle::MemoryBuffer **zeroBufferOut) const; angle::MemoryBuffer **scratchBufferOut) const;
ANGLE_NO_DISCARD bool getZeroFilledBuffer(size_t requstedSizeBytes,
angle::MemoryBuffer **zeroBufferOut) const;
Error prepareForDispatch(); Error prepareForDispatch();
......
...@@ -56,37 +56,37 @@ struct InternalFormat ...@@ -56,37 +56,37 @@ struct InternalFormat
GLuint computePixelBytes(GLenum formatType) const; GLuint computePixelBytes(GLenum formatType) const;
bool computeRowPitch(GLenum formatType, ANGLE_NO_DISCARD bool computeRowPitch(GLenum formatType,
GLsizei width, GLsizei width,
GLint alignment, GLint alignment,
GLint rowLength, GLint rowLength,
GLuint *resultOut) const; GLuint *resultOut) const;
bool computeDepthPitch(GLsizei height, ANGLE_NO_DISCARD bool computeDepthPitch(GLsizei height,
GLint imageHeight, GLint imageHeight,
GLuint rowPitch, GLuint rowPitch,
GLuint *resultOut) const; GLuint *resultOut) const;
bool computeDepthPitch(GLenum formatType, ANGLE_NO_DISCARD bool computeDepthPitch(GLenum formatType,
GLsizei width, GLsizei width,
GLsizei height, GLsizei height,
GLint alignment, GLint alignment,
GLint rowLength, GLint rowLength,
GLint imageHeight, GLint imageHeight,
GLuint *resultOut) const; GLuint *resultOut) const;
bool computeCompressedImageSize(const Extents &size, GLuint *resultOut) const; ANGLE_NO_DISCARD bool computeCompressedImageSize(const Extents &size, GLuint *resultOut) const;
bool computeSkipBytes(GLenum formatType, ANGLE_NO_DISCARD bool computeSkipBytes(GLenum formatType,
GLuint rowPitch, GLuint rowPitch,
GLuint depthPitch, GLuint depthPitch,
const PixelStoreStateBase &state, const PixelStoreStateBase &state,
bool is3D, bool is3D,
GLuint *resultOut) const; GLuint *resultOut) const;
bool computePackUnpackEndByte(GLenum formatType, ANGLE_NO_DISCARD bool computePackUnpackEndByte(GLenum formatType,
const Extents &size, const Extents &size,
const PixelStoreStateBase &state, const PixelStoreStateBase &state,
bool is3D, bool is3D,
GLuint *resultOut) const; GLuint *resultOut) const;
bool isLUMA() const; bool isLUMA() const;
GLenum getReadPixelsFormat() const; GLenum getReadPixelsFormat() const;
......
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