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
rx::ContextImpl *getImplementation() const { return mImplementation.get(); }
const Workarounds &getWorkarounds() const;
bool getScratchBuffer(size_t requestedSizeBytes, angle::MemoryBuffer **scratchBufferOut) const;
bool getZeroFilledBuffer(size_t requstedSizeBytes, angle::MemoryBuffer **zeroBufferOut) const;
ANGLE_NO_DISCARD bool getScratchBuffer(size_t requestedSizeBytes,
angle::MemoryBuffer **scratchBufferOut) const;
ANGLE_NO_DISCARD bool getZeroFilledBuffer(size_t requstedSizeBytes,
angle::MemoryBuffer **zeroBufferOut) const;
Error prepareForDispatch();
......
......@@ -56,37 +56,37 @@ struct InternalFormat
GLuint computePixelBytes(GLenum formatType) const;
bool computeRowPitch(GLenum formatType,
GLsizei width,
GLint alignment,
GLint rowLength,
GLuint *resultOut) const;
bool computeDepthPitch(GLsizei height,
GLint imageHeight,
GLuint rowPitch,
GLuint *resultOut) const;
bool computeDepthPitch(GLenum formatType,
GLsizei width,
GLsizei height,
GLint alignment,
GLint rowLength,
GLint imageHeight,
GLuint *resultOut) const;
bool computeCompressedImageSize(const Extents &size, GLuint *resultOut) const;
bool computeSkipBytes(GLenum formatType,
GLuint rowPitch,
GLuint depthPitch,
const PixelStoreStateBase &state,
bool is3D,
GLuint *resultOut) const;
bool computePackUnpackEndByte(GLenum formatType,
const Extents &size,
const PixelStoreStateBase &state,
bool is3D,
GLuint *resultOut) const;
ANGLE_NO_DISCARD bool computeRowPitch(GLenum formatType,
GLsizei width,
GLint alignment,
GLint rowLength,
GLuint *resultOut) const;
ANGLE_NO_DISCARD bool computeDepthPitch(GLsizei height,
GLint imageHeight,
GLuint rowPitch,
GLuint *resultOut) const;
ANGLE_NO_DISCARD bool computeDepthPitch(GLenum formatType,
GLsizei width,
GLsizei height,
GLint alignment,
GLint rowLength,
GLint imageHeight,
GLuint *resultOut) const;
ANGLE_NO_DISCARD bool computeCompressedImageSize(const Extents &size, GLuint *resultOut) const;
ANGLE_NO_DISCARD bool computeSkipBytes(GLenum formatType,
GLuint rowPitch,
GLuint depthPitch,
const PixelStoreStateBase &state,
bool is3D,
GLuint *resultOut) const;
ANGLE_NO_DISCARD bool computePackUnpackEndByte(GLenum formatType,
const Extents &size,
const PixelStoreStateBase &state,
bool is3D,
GLuint *resultOut) const;
bool isLUMA() 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