Index: src/core/SkColorSpace.cpp |
diff --git a/src/core/SkColorSpace.cpp b/src/core/SkColorSpace.cpp |
index bdef5b3b7547d601e1233eb68c5418344962410c..b956c7fe3e342255641a64f9530538c0a68e9c0c 100644 |
--- a/src/core/SkColorSpace.cpp |
+++ b/src/core/SkColorSpace.cpp |
@@ -8,6 +8,7 @@ |
#include "SkColorSpace.h" |
#include "SkColorSpace_Base.h" |
#include "SkColorSpacePriv.h" |
+#include "SkColorSpaceXform_Base.h" |
#include "SkOnce.h" |
#include "SkPoint3.h" |
@@ -319,6 +320,23 @@ const SkMatrix44& SkColorSpace_Base::fromXYZD50() const { |
return fFromXYZD50; |
} |
+void SkColorSpace_Base::toDstGammaTables(const uint8_t* tables[3], sk_sp<SkData>* storage, |
+ int numTables) const { |
+ fToDstGammaOnce([this, numTables] { |
+ const bool gammasAreMatching = numTables <= 1; |
+ fDstStorage = |
+ SkData::MakeUninitialized(numTables * SkColorSpaceXform_Base::kDstGammaTableSize); |
+ SkColorSpaceXform_Base::BuildDstGammaTables(fToDstGammaTables, |
+ (uint8_t*) fDstStorage->writable_data(), this, |
+ gammasAreMatching); |
+ }); |
+ |
+ *storage = fDstStorage; |
+ tables[0] = fToDstGammaTables[0]; |
+ tables[1] = fToDstGammaTables[1]; |
+ tables[2] = fToDstGammaTables[2]; |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
enum Version { |