Commit f1cbcaba by Mohan Maiya Committed by Commit Bot

Use const reference when possible

When retrieving BitSet masks return a const reference of the mask to avoid invoking the copy-constructor. Bug: angleproject:3877 Change-Id: I9f724a4864f3db17aa6f1ab74b81053c65313764 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2681767Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
parent aca0dc35
...@@ -247,7 +247,7 @@ class StateCache final : angle::NonCopyable ...@@ -247,7 +247,7 @@ class StateCache final : angle::NonCopyable
// Places that can trigger updateActiveImageUnitIndices: // Places that can trigger updateActiveImageUnitIndices:
// 1. onProgramExecutableChange. // 1. onProgramExecutableChange.
ImageUnitMask getActiveImageUnitIndices() const { return mCachedActiveImageUnitIndices; } const ImageUnitMask &getActiveImageUnitIndices() const { return mCachedActiveImageUnitIndices; }
// Places that can trigger updateCanDraw: // Places that can trigger updateCanDraw:
// 1. onProgramExecutableChange. // 1. onProgramExecutableChange.
......
...@@ -589,7 +589,7 @@ void State::reset(const Context *context) ...@@ -589,7 +589,7 @@ void State::reset(const Context *context)
setAllDirtyBits(); setAllDirtyBits();
} }
ANGLE_INLINE void State::unsetActiveTextures(ActiveTextureMask textureMask) ANGLE_INLINE void State::unsetActiveTextures(const ActiveTextureMask &textureMask)
{ {
// Unset any relevant bound textures. // Unset any relevant bound textures.
for (size_t textureIndex : textureMask) for (size_t textureIndex : textureMask)
......
...@@ -893,7 +893,7 @@ class State : angle::NonCopyable ...@@ -893,7 +893,7 @@ class State : angle::NonCopyable
private: private:
friend class Context; friend class Context;
void unsetActiveTextures(ActiveTextureMask textureMask); void unsetActiveTextures(const ActiveTextureMask &textureMask);
void setActiveTextureDirty(size_t textureIndex, Texture *texture); void setActiveTextureDirty(size_t textureIndex, Texture *texture);
void updateTextureBinding(const Context *context, size_t textureIndex, Texture *texture); void updateTextureBinding(const Context *context, size_t textureIndex, Texture *texture);
void updateActiveTextureStateOnSync(const Context *context, void updateActiveTextureStateOnSync(const Context *context,
......
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