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 "SkColorSpace.h" | 8 #include "SkColorSpace.h" |
9 #include "SkColorSpacePriv.h" | |
9 #include "SkColorSpace_Base.h" | 10 #include "SkColorSpace_Base.h" |
10 #include "SkEndian.h" | 11 #include "SkEndian.h" |
11 #include "SkOnce.h" | 12 #include "SkOnce.h" |
12 | 13 |
13 #define SkColorSpacePrintf(...) | 14 #define SkColorSpacePrintf(...) |
14 | 15 |
15 static bool color_space_almost_equal(float a, float b) { | 16 static bool color_space_almost_equal(float a, float b) { |
16 return SkTAbs(a - b) < 0.01f; | 17 return SkTAbs(a - b) < 0.01f; |
17 } | 18 } |
18 | 19 |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1201 ptr32[4] = SkEndian_SwapBE32(0x000116cc); | 1202 ptr32[4] = SkEndian_SwapBE32(0x000116cc); |
1202 ptr += kTAG_XYZ_Bytes; | 1203 ptr += kTAG_XYZ_Bytes; |
1203 | 1204 |
1204 // Write copyright tag | 1205 // Write copyright tag |
1205 memcpy(ptr, gEmptyTextTag, sizeof(gEmptyTextTag)); | 1206 memcpy(ptr, gEmptyTextTag, sizeof(gEmptyTextTag)); |
1206 | 1207 |
1207 // TODO (msarett): Should we try to hold onto the data so we can return imme diately if | 1208 // TODO (msarett): Should we try to hold onto the data so we can return imme diately if |
1208 // the client calls again? | 1209 // the client calls again? |
1209 return SkData::MakeFromMalloc(profile.release(), kICCProfileSize); | 1210 return SkData::MakeFromMalloc(profile.release(), kICCProfileSize); |
1210 } | 1211 } |
1212 | |
1213 //////////////////////////////////////////////////////////////////////////////// /////////////////// | |
1214 | |
1215 bool SkColorSpacePriv::EQ(SkColorSpace* a, SkColorSpace* b) { | |
1216 if (!a) { | |
1217 return !b; | |
1218 } | |
1219 if (!b) { | |
1220 return false; | |
1221 } | |
1222 // TODO: could have an approx EQ where we compare gamma and xyz for a near-m atch, since this | |
1223 // operator is called to detect when they're close enough for a "fast- case" | |
1224 return a == b; | |
msarett
2016/06/20 19:41:05
So this will only work when both are sRGB or Adobe
reed1
2016/06/20 21:05:53
Removed
| |
1225 } | |
OLD | NEW |