Add SkDefaultXform as a catch-all to handle color conversions
I'd like to start optimizing the common case for color xforms,
but before doing that, I think it makes sense to have correct
code to support all xforms.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2038823002
Review-Url: https://codereview.chromium.org/2038823002
diff --git a/src/core/SkColorSpace_Base.h b/src/core/SkColorSpace_Base.h
index 68514d0..ffab17a 100644
--- a/src/core/SkColorSpace_Base.h
+++ b/src/core/SkColorSpace_Base.h
@@ -78,6 +78,11 @@
return fRed.isValue() && fGreen.isValue() && fBlue.isValue();
}
+ const SkGammaCurve& operator[](int i) {
+ SkASSERT(0 <= i && i < 3);
+ return (&fRed)[i];
+ }
+
const SkGammaCurve fRed;
const SkGammaCurve fGreen;
const SkGammaCurve fBlue;
@@ -117,6 +122,8 @@
const sk_sp<SkGammas>& gammas() const { return fGammas; }
+ SkColorLookUpTable* colorLUT() const { return fColorLUT.get(); }
+
/**
* Writes this object as an ICC profile.
*/