| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 */ | 69 */ |
| 70 // TODO (msarett): | 70 // TODO (msarett): |
| 71 // Merge with SkFastXform and delete this. SkFastXform can almost do everything
that | 71 // Merge with SkFastXform and delete this. SkFastXform can almost do everything
that |
| 72 // this does. | 72 // this does. |
| 73 class SkDefaultXform : public SkColorSpaceXform { | 73 class SkDefaultXform : public SkColorSpaceXform { |
| 74 public: | 74 public: |
| 75 | 75 |
| 76 void applyTo8888(SkPMColor* dst, const RGBA32* src, int len) const override; | 76 void applyTo8888(SkPMColor* dst, const RGBA32* src, int len) const override; |
| 77 void applyToF16(RGBAF16* dst, const RGBA32* src, int len) const override; | 77 void applyToF16(RGBAF16* dst, const RGBA32* src, int len) const override; |
| 78 | 78 |
| 79 static constexpr int kDstGammaTableSize = 1024; | |
| 80 private: | 79 private: |
| 81 SkDefaultXform(const sk_sp<SkColorSpace>& srcSpace, const SkMatrix44& srcToD
st, | 80 SkDefaultXform(const sk_sp<SkColorSpace>& srcSpace, const SkMatrix44& srcToD
st, |
| 82 const sk_sp<SkColorSpace>& dstSpace); | 81 const sk_sp<SkColorSpace>& dstSpace); |
| 83 | 82 |
| 83 static constexpr int kDstGammaTableSize = 1024; |
| 84 |
| 84 sk_sp<SkColorLookUpTable> fColorLUT; | 85 sk_sp<SkColorLookUpTable> fColorLUT; |
| 85 | 86 |
| 86 // May contain pointers into storage or pointers into precomputed tables. | 87 // May contain pointers into storage or pointers into precomputed tables. |
| 87 const float* fSrcGammaTables[3]; | 88 const float* fSrcGammaTables[3]; |
| 88 float fSrcGammaTableStorage[3 * 256]; | 89 float fSrcGammaTableStorage[3 * 256]; |
| 89 | 90 |
| 90 const SkMatrix44 fSrcToDst; | 91 const SkMatrix44 fSrcToDst; |
| 91 | 92 |
| 92 // May contain pointers into storage or pointers into precomputed tables. | 93 // May contain pointers into storage or pointers into precomputed tables. |
| 93 const uint8_t* fDstGammaTables[3]; | 94 const uint8_t* fDstGammaTables[3]; |
| 94 uint8_t fDstGammaTableStorage[3 * kDstGammaTableSize]; | 95 uint8_t fDstGammaTableStorage[3 * kDstGammaTableSize]; |
| 95 | 96 |
| 96 friend class SkColorSpaceXform; | 97 friend class SkColorSpaceXform; |
| 97 }; | 98 }; |
| 98 | 99 |
| 99 #endif | 100 #endif |
| OLD | NEW |