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

Side by Side Diff: src/core/SkColorSpaceXform.h

Issue 2336913005: Store SkColorSpaceXform gamma LUTs in a malloced field (Closed)
Patch Set: Fixes Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkColorSpaceXform.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 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
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
OLDNEW
« no previous file with comments | « no previous file | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698