diff options
author | scroggo <scroggo@google.com> | 2015-09-30 12:26:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-30 12:26:49 -0700 |
commit | 8b17dcb72cfbfb1e9451a311f927291a48a84d79 (patch) | |
tree | c75c66ff35b58bb7e4fb8b8a5d5d98bc781fd006 /src/codec/SkMasks.h | |
parent | f32602921aba5b54b64d9fa3b6479914034b4d5a (diff) |
Avoid copies in SkMasks constructor
Also mark const methods as const.
Review URL: https://codereview.chromium.org/1364463005
Diffstat (limited to 'src/codec/SkMasks.h')
-rw-r--r-- | src/codec/SkMasks.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/codec/SkMasks.h b/src/codec/SkMasks.h index 0823704668..9606cbfbeb 100644 --- a/src/codec/SkMasks.h +++ b/src/codec/SkMasks.h @@ -52,10 +52,10 @@ public: * Get a color component * */ - uint8_t getRed(uint32_t pixel); - uint8_t getGreen(uint32_t pixel); - uint8_t getBlue(uint32_t pixel); - uint8_t getAlpha(uint32_t pixel); + uint8_t getRed(uint32_t pixel) const; + uint8_t getGreen(uint32_t pixel) const; + uint8_t getBlue(uint32_t pixel) const; + uint8_t getAlpha(uint32_t pixel) const; /* * @@ -63,7 +63,7 @@ public: * The alpha mask may be used in other decoding modes * */ - uint32_t getAlphaMask() { + uint32_t getAlphaMask() const { return fAlpha.mask; } @@ -71,11 +71,11 @@ private: /* * - * Constrcutor + * Constructor * */ - SkMasks(const MaskInfo red, const MaskInfo green, const MaskInfo blue, - const MaskInfo alpha); + SkMasks(const MaskInfo& red, const MaskInfo& green, const MaskInfo& blue, + const MaskInfo& alpha); const MaskInfo fRed; const MaskInfo fGreen; |