| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 | 7 |
| 8 #ifndef SkColorSpacePriv_DEFINED | 8 #ifndef SkColorSpacePriv_DEFINED |
| 9 #define SkColorSpacePriv_DEFINED | 9 #define SkColorSpacePriv_DEFINED |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 , fTable(nullptr) | 45 , fTable(nullptr) |
| 46 {} | 46 {} |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 struct SkGammas : public SkRefCnt { | 49 struct SkGammas : public SkRefCnt { |
| 50 public: | 50 public: |
| 51 bool isValues() const { | 51 bool isValues() const { |
| 52 return fRed.isValue() && fGreen.isValue() && fBlue.isValue(); | 52 return fRed.isValue() && fGreen.isValue() && fBlue.isValue(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 SkGammaCurve fRed; | 55 const SkGammaCurve fRed; |
| 56 SkGammaCurve fGreen; | 56 const SkGammaCurve fGreen; |
| 57 SkGammaCurve fBlue; | 57 const SkGammaCurve fBlue; |
| 58 | 58 |
| 59 SkGammas(float red, float green, float blue) | 59 SkGammas(float red, float green, float blue) |
| 60 : fRed(red) | 60 : fRed(red) |
| 61 , fGreen(green) | 61 , fGreen(green) |
| 62 , fBlue(blue) | 62 , fBlue(blue) |
| 63 {} | 63 {} |
| 64 | 64 |
| 65 SkGammas(SkGammaCurve red, SkGammaCurve green, SkGammaCurve blue) |
| 66 : fRed(std::move(red)) |
| 67 , fGreen(std::move(green)) |
| 68 , fBlue(std::move(blue)) |
| 69 {} |
| 70 |
| 65 SkGammas() {} | 71 SkGammas() {} |
| 66 | 72 |
| 67 friend class SkColorSpace; | 73 friend class SkColorSpace; |
| 68 }; | 74 }; |
| 69 | 75 |
| 70 struct SkColorLookUpTable { | 76 struct SkColorLookUpTable { |
| 71 static const uint8_t kMaxChannels = 16; | 77 static const uint8_t kMaxChannels = 16; |
| 72 | 78 |
| 73 uint8_t fInputChannels; | 79 uint8_t fInputChannels; |
| 74 uint8_t fOutputChannels; | 80 uint8_t fOutputChannels; |
| 75 uint8_t fGridPoints[kMaxChannels]; | 81 uint8_t fGridPoints[kMaxChannels]; |
| 76 std::unique_ptr<float[]> fTable; | 82 std::unique_ptr<float[]> fTable; |
| 77 | 83 |
| 78 SkColorLookUpTable() { | 84 SkColorLookUpTable() { |
| 79 memset(this, 0, sizeof(struct SkColorLookUpTable)); | 85 memset(this, 0, sizeof(struct SkColorLookUpTable)); |
| 80 } | 86 } |
| 81 }; | 87 }; |
| 82 | 88 |
| 83 #endif | 89 #endif |
| OLD | NEW |