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

Side by Side Diff: src/codec/SkMasks.h

Issue 1364463005: Avoid copies in SkMasks constructor (Closed) Base URL: https://skia.googlesource.com/skia.git@codecSDmerge
Patch Set: Rebase Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/codec/SkMasks.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #ifndef SkMasks_DEFINED 7 #ifndef SkMasks_DEFINED
8 #define SkMasks_DEFINED 8 #define SkMasks_DEFINED
9 9
10 #include "SkTypes.h" 10 #include "SkTypes.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 * Create the masks object 45 * Create the masks object
46 * 46 *
47 */ 47 */
48 static SkMasks* CreateMasks(InputMasks masks, uint32_t bpp); 48 static SkMasks* CreateMasks(InputMasks masks, uint32_t bpp);
49 49
50 /* 50 /*
51 * 51 *
52 * Get a color component 52 * Get a color component
53 * 53 *
54 */ 54 */
55 uint8_t getRed(uint32_t pixel); 55 uint8_t getRed(uint32_t pixel) const;
56 uint8_t getGreen(uint32_t pixel); 56 uint8_t getGreen(uint32_t pixel) const;
57 uint8_t getBlue(uint32_t pixel); 57 uint8_t getBlue(uint32_t pixel) const;
58 uint8_t getAlpha(uint32_t pixel); 58 uint8_t getAlpha(uint32_t pixel) const;
59 59
60 /* 60 /*
61 * 61 *
62 * Getter for the alpha mask 62 * Getter for the alpha mask
63 * The alpha mask may be used in other decoding modes 63 * The alpha mask may be used in other decoding modes
64 * 64 *
65 */ 65 */
66 uint32_t getAlphaMask() { 66 uint32_t getAlphaMask() const {
67 return fAlpha.mask; 67 return fAlpha.mask;
68 } 68 }
69 69
70 private: 70 private:
71 71
72 /* 72 /*
73 * 73 *
74 * Constrcutor 74 * Constructor
75 * 75 *
76 */ 76 */
77 SkMasks(const MaskInfo red, const MaskInfo green, const MaskInfo blue, 77 SkMasks(const MaskInfo& red, const MaskInfo& green, const MaskInfo& blue,
78 const MaskInfo alpha); 78 const MaskInfo& alpha);
79 79
80 const MaskInfo fRed; 80 const MaskInfo fRed;
81 const MaskInfo fGreen; 81 const MaskInfo fGreen;
82 const MaskInfo fBlue; 82 const MaskInfo fBlue;
83 const MaskInfo fAlpha; 83 const MaskInfo fAlpha;
84 }; 84 };
85 85
86 #endif 86 #endif
OLDNEW
« no previous file with comments | « no previous file | src/codec/SkMasks.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698