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

Side by Side Diff: src/core/SkColorSpace.cpp

Issue 2086583002: update callers to not use SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698