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

Unified Diff: src/core/SkColorSpace_Base.h

Issue 2084673002: Use a table-based implementation of SkDefaultXform (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: quickEquals() Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkColorSpaceXform.cpp ('k') | src/opts/SkColorXform_opts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpace_Base.h
diff --git a/src/core/SkColorSpace_Base.h b/src/core/SkColorSpace_Base.h
index fc4f665e688c66f3aa3016d9f43615a45c573182..cb0965aa0f80b54687ae115e3bfd198d8998ea5d 100644
--- a/src/core/SkColorSpace_Base.h
+++ b/src/core/SkColorSpace_Base.h
@@ -81,6 +81,14 @@ struct SkGammaCurve {
, fE(0.0f)
, fF(0.0f)
{}
+
+ bool quickEquals(const SkGammaCurve& that) const {
+ return (this->fNamed == that.fNamed) && (this->fValue == that.fValue) &&
+ (this->fTableSize == that.fTableSize) && (this->fTable == that.fTable) &&
+ (this->fG == that.fG) && (this->fA == that.fA) && (this->fB == that.fB) &&
+ (this->fC == that.fC) && (this->fD == that.fD) && (this->fE == that.fE) &&
+ (this->fF == that.fF);
+ }
};
struct SkGammas : public SkRefCnt {
@@ -110,7 +118,7 @@ public:
return SkColorSpace::kNonStandard_GammaNamed;
}
- const SkGammaCurve& operator[](int i) {
+ const SkGammaCurve& operator[](int i) const {
SkASSERT(0 <= i && i < 3);
return (&fRed)[i];
}
@@ -148,9 +156,9 @@ public:
static sk_sp<SkColorSpace> NewRGB(float gammas[3], const SkMatrix44& toXYZD50);
- const sk_sp<SkGammas>& gammas() const { return fGammas; }
+ const SkGammas* gammas() const { return fGammas.get(); }
- SkColorLookUpTable* colorLUT() const { return fColorLUT.get(); }
+ const SkColorLookUpTable* colorLUT() const { return fColorLUT.get(); }
/**
* Writes this object as an ICC profile.
@@ -173,6 +181,7 @@ private:
sk_sp<SkData> fProfileData;
friend class SkColorSpace;
+ friend class ColorSpaceXformTest;
typedef SkColorSpace INHERITED;
};
« no previous file with comments | « src/core/SkColorSpaceXform.cpp ('k') | src/opts/SkColorXform_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698