OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkAtomics.h" | 8 #include "SkAtomics.h" |
9 #include "SkColorSpace.h" | 9 #include "SkColorSpace.h" |
10 #include "SkColorSpacePriv.h" | 10 #include "SkColorSpacePriv.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 gammas = sk_ref_sp(gStandardGammas); | 88 gammas = sk_ref_sp(gStandardGammas); |
89 | 89 |
90 if (xyz_almost_equal(toXYZD50, gSRGB_toXYZD50)) { | 90 if (xyz_almost_equal(toXYZD50, gSRGB_toXYZD50)) { |
91 return SkColorSpace::NewNamed(kSRGB_Named); | 91 return SkColorSpace::NewNamed(kSRGB_Named); |
92 } else if (xyz_almost_equal(toXYZD50, gAdobeRGB_toXYZD50)) { | 92 } else if (xyz_almost_equal(toXYZD50, gAdobeRGB_toXYZD50)) { |
93 return SkColorSpace::NewNamed(kAdobeRGB_Named); | 93 return SkColorSpace::NewNamed(kAdobeRGB_Named); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 if (!gammas) { | 97 if (!gammas) { |
98 gammas = sk_ref_sp(new SkGammas(gammaVals[0], gammaVals[1], gammaVals[2]
)); | 98 gammas = sk_sp<SkGammas>(new SkGammas(gammaVals[0], gammaVals[1], gammaV
als[2])); |
99 } | 99 } |
100 return sk_sp<SkColorSpace>(new SkColorSpace(gammas, toXYZD50, kUnknown_Named
)); | 100 return sk_sp<SkColorSpace>(new SkColorSpace(gammas, toXYZD50, kUnknown_Named
)); |
101 } | 101 } |
102 | 102 |
103 sk_sp<SkColorSpace> SkColorSpace::NewNamed(Named named) { | 103 sk_sp<SkColorSpace> SkColorSpace::NewNamed(Named named) { |
104 static SkOnce sRGBOnce; | 104 static SkOnce sRGBOnce; |
105 static SkColorSpace* sRGB; | 105 static SkColorSpace* sRGB; |
106 static SkOnce adobeRGBOnce; | 106 static SkOnce adobeRGBOnce; |
107 static SkColorSpace* adobeRGB; | 107 static SkColorSpace* adobeRGB; |
108 | 108 |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 } | 738 } |
739 } | 739 } |
740 | 740 |
741 } | 741 } |
742 default: | 742 default: |
743 break; | 743 break; |
744 } | 744 } |
745 | 745 |
746 return_null("ICC profile contains unsupported colorspace"); | 746 return_null("ICC profile contains unsupported colorspace"); |
747 } | 747 } |
OLD | NEW |