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

Unified Diff: src/core/SkColorSpace.cpp

Issue 2381553002: Move toXYZD50() to SkColorSpace_Base (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkColorSpace.h ('k') | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpace.cpp
diff --git a/src/core/SkColorSpace.cpp b/src/core/SkColorSpace.cpp
index 225cfe146451d7e0f154abec8e9d1b0441326582..c6bf4b9431300460b4fbe4dd2b6f276de9dda4a2 100644
--- a/src/core/SkColorSpace.cpp
+++ b/src/core/SkColorSpace.cpp
@@ -10,26 +10,22 @@
#include "SkColorSpacePriv.h"
#include "SkOnce.h"
-SkColorSpace::SkColorSpace(const SkMatrix44& toXYZD50)
- : fToXYZD50(toXYZD50)
-{}
-
SkColorSpace_Base::SkColorSpace_Base(SkGammaNamed gammaNamed, const SkMatrix44& toXYZD50)
- : INHERITED(toXYZD50)
- , fGammaNamed(gammaNamed)
+ : fGammaNamed(gammaNamed)
, fGammas(nullptr)
, fProfileData(nullptr)
+ , fToXYZD50(toXYZD50)
, fFromXYZD50(SkMatrix44::kUninitialized_Constructor)
{}
SkColorSpace_Base::SkColorSpace_Base(sk_sp<SkColorLookUpTable> colorLUT, SkGammaNamed gammaNamed,
sk_sp<SkGammas> gammas, const SkMatrix44& toXYZD50,
sk_sp<SkData> profileData)
- : INHERITED(toXYZD50)
- , fColorLUT(std::move(colorLUT))
+ : fColorLUT(std::move(colorLUT))
, fGammaNamed(gammaNamed)
, fGammas(std::move(gammas))
, fProfileData(std::move(profileData))
+ , fToXYZD50(toXYZD50)
, fFromXYZD50(SkMatrix44::kUninitialized_Constructor)
{}
@@ -192,7 +188,7 @@ sk_sp<SkColorSpace> SkColorSpace::makeLinearGamma() {
if (this->gammaIsLinear()) {
return sk_ref_sp(this);
}
- return SkColorSpace_Base::NewRGB(kLinear_SkGammaNamed, fToXYZD50);
+ return SkColorSpace_Base::NewRGB(kLinear_SkGammaNamed, as_CSB(this)->fToXYZD50);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -311,7 +307,7 @@ size_t SkColorSpace::writeToMemory(void* memory) const {
ColorSpaceHeader::Pack(k0_Version, 0, as_CSB(this)->fGammaNamed,
ColorSpaceHeader::kMatrix_Flag);
memory = SkTAddOffset<void>(memory, sizeof(ColorSpaceHeader));
- fToXYZD50.as3x4RowMajorf((float*) memory);
+ as_CSB(this)->fToXYZD50.as3x4RowMajorf((float*) memory);
}
return sizeof(ColorSpaceHeader) + 12 * sizeof(float);
}
@@ -333,7 +329,7 @@ size_t SkColorSpace::writeToMemory(void* memory) const {
*(((float*) memory) + 2) = gammas->fBlueData.fValue;
memory = SkTAddOffset<void>(memory, 3 * sizeof(float));
- fToXYZD50.as3x4RowMajorf((float*) memory);
+ as_CSB(this)->fToXYZD50.as3x4RowMajorf((float*) memory);
}
return sizeof(ColorSpaceHeader) + 15 * sizeof(float);
}
@@ -461,7 +457,7 @@ bool SkColorSpace::Equals(const SkColorSpace* src, const SkColorSpace* dst) {
case k2Dot2Curve_SkGammaNamed:
case kLinear_SkGammaNamed:
return (as_CSB(src)->fGammaNamed == as_CSB(dst)->fGammaNamed) &&
- (src->fToXYZD50 == dst->fToXYZD50);
+ (as_CSB(src)->fToXYZD50 == as_CSB(dst)->fToXYZD50);
default:
if (as_CSB(src)->fGammaNamed != as_CSB(dst)->fGammaNamed) {
return false;
« no previous file with comments | « include/core/SkColorSpace.h ('k') | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698