Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: src/codec/SkMasks.cpp

Issue 1364463005: Avoid copies in SkMasks constructor (Closed) Base URL: https://skia.googlesource.com/skia.git@codecSDmerge
Patch Set: Rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/codec/SkMasks.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkMasks.cpp
diff --git a/src/codec/SkMasks.cpp b/src/codec/SkMasks.cpp
index b8603148b9ec0e172b9fe3b16d131a81b4af5986..3126672f22c8c1e958ca1882be45421ccdfbd9e3 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)
« no previous file with comments | « src/codec/SkMasks.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698