aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkMasks.cpp
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2015-09-30 12:26:49 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-30 12:26:49 -0700
commit8b17dcb72cfbfb1e9451a311f927291a48a84d79 (patch)
treec75c66ff35b58bb7e4fb8b8a5d5d98bc781fd006 /src/codec/SkMasks.cpp
parentf32602921aba5b54b64d9fa3b6479914034b4d5a (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.cpp')
-rw-r--r--src/codec/SkMasks.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/codec/SkMasks.cpp b/src/codec/SkMasks.cpp
index b8603148b9..3126672f22 100644
--- a/src/codec/SkMasks.cpp
+++ b/src/codec/SkMasks.cpp
@@ -68,16 +68,16 @@ static uint8_t get_comp(uint32_t pixel, uint32_t mask, uint32_t shift,
* Get a color component
*
*/
-uint8_t SkMasks::getRed(uint32_t pixel) {
+uint8_t SkMasks::getRed(uint32_t pixel) const {
return get_comp(pixel, fRed.mask, fRed.shift, fRed.size);
}
-uint8_t SkMasks::getGreen(uint32_t pixel) {
+uint8_t SkMasks::getGreen(uint32_t pixel) const {
return get_comp(pixel, fGreen.mask, fGreen.shift, fGreen.size);
}
-uint8_t SkMasks::getBlue(uint32_t pixel) {
+uint8_t SkMasks::getBlue(uint32_t pixel) const {
return get_comp(pixel, fBlue.mask, fBlue.shift, fBlue.size);
}
-uint8_t SkMasks::getAlpha(uint32_t pixel) {
+uint8_t SkMasks::getAlpha(uint32_t pixel) const {
return get_comp(pixel, fAlpha.mask, fAlpha.shift, fAlpha.size);
}
@@ -152,8 +152,8 @@ SkMasks* SkMasks::CreateMasks(InputMasks masks, uint32_t bitsPerPixel) {
}
-SkMasks::SkMasks(const MaskInfo red, const MaskInfo green,
- const MaskInfo blue, const MaskInfo alpha)
+SkMasks::SkMasks(const MaskInfo& red, const MaskInfo& green,
+ const MaskInfo& blue, const MaskInfo& alpha)
: fRed(red)
, fGreen(green)
, fBlue(blue)