Index: src/core/SkColorSpace.cpp |
diff --git a/src/core/SkColorSpace.cpp b/src/core/SkColorSpace.cpp |
index cb5c8695ee0c02a5c1c3df77ec6dd522b08bbaf2..8bec264f6f18e8ece2ce6ff6a2a76284a264f6f6 100644 |
--- a/src/core/SkColorSpace.cpp |
+++ b/src/core/SkColorSpace.cpp |
@@ -136,6 +136,9 @@ sk_sp<SkColorSpace> SkColorSpace::NewNamed(Named named) { |
sRGBOnce([] { |
SkMatrix44 srgbToxyzD50(SkMatrix44::kUninitialized_Constructor); |
srgbToxyzD50.set3x3RowMajorf(gSRGB_toXYZD50); |
+ |
+ // Force the mutable type mask to be computed. This avoids races. |
+ (void)srgbToxyzD50.getType(); |
sRGB.reset(new SkColorSpace_Base(kSRGB_GammaNamed, srgbToxyzD50, kSRGB_Named)); |
}); |
return sRGB; |
@@ -144,6 +147,9 @@ sk_sp<SkColorSpace> SkColorSpace::NewNamed(Named named) { |
adobeRGBOnce([] { |
SkMatrix44 adobergbToxyzD50(SkMatrix44::kUninitialized_Constructor); |
adobergbToxyzD50.set3x3RowMajorf(gAdobeRGB_toXYZD50); |
+ |
+ // Force the mutable type mask to be computed. This avoids races. |
+ (void)adobergbToxyzD50.getType(); |
adobeRGB.reset(new SkColorSpace_Base(k2Dot2Curve_GammaNamed, adobergbToxyzD50, |
kAdobeRGB_Named)); |
}); |