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 SkColorSpaceXform_DEFINED | 8 #ifndef SkColorSpaceXform_DEFINED |
9 #define SkColorSpaceXform_DEFINED | 9 #define SkColorSpaceXform_DEFINED |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 SkAlphaType dstAlphaType) const override; | 70 SkAlphaType dstAlphaType) const override; |
71 | 71 |
72 static constexpr int kDstGammaTableSize = 1024; | 72 static constexpr int kDstGammaTableSize = 1024; |
73 | 73 |
74 private: | 74 private: |
75 SkColorSpaceXform_Base(const sk_sp<SkColorSpace>& srcSpace, const SkMatrix44
& srcToDst, | 75 SkColorSpaceXform_Base(const sk_sp<SkColorSpace>& srcSpace, const SkMatrix44
& srcToDst, |
76 const sk_sp<SkColorSpace>& dstSpace); | 76 const sk_sp<SkColorSpace>& dstSpace); |
77 | 77 |
78 sk_sp<SkColorLookUpTable> fColorLUT; | 78 sk_sp<SkColorLookUpTable> fColorLUT; |
79 | 79 |
80 // May contain pointers into storage or pointers into precomputed tables. | 80 // Contain pointers into storage or pointers into precomputed tables. |
81 const float* fSrcGammaTables[3]; | 81 const float* fSrcGammaTables[3]; |
82 float fSrcGammaTableStorage[3 * 256]; | 82 const uint8_t* fDstGammaTables[3]; |
| 83 SkAutoMalloc fStorage; |
83 | 84 |
84 float fSrcToDst[16]; | 85 float fSrcToDst[16]; |
85 | 86 |
86 // May contain pointers into storage or pointers into precomputed tables. | |
87 const uint8_t* fDstGammaTables[3]; | |
88 uint8_t fDstGammaTableStorage[3 * kDstGammaTableSize]; | |
89 | |
90 friend class SkColorSpaceXform; | 87 friend class SkColorSpaceXform; |
91 friend std::unique_ptr<SkColorSpaceXform> SlowIdentityXform(const sk_sp<SkCo
lorSpace>& space); | 88 friend std::unique_ptr<SkColorSpaceXform> SlowIdentityXform(const sk_sp<SkCo
lorSpace>& space); |
92 }; | 89 }; |
93 | 90 |
94 // For testing. Bypasses opts for when src and dst color spaces are equal. | 91 // For testing. Bypasses opts for when src and dst color spaces are equal. |
95 std::unique_ptr<SkColorSpaceXform> SlowIdentityXform(const sk_sp<SkColorSpace>&
space); | 92 std::unique_ptr<SkColorSpaceXform> SlowIdentityXform(const sk_sp<SkColorSpace>&
space); |
96 | 93 |
97 #endif | 94 #endif |
OLD | NEW |