Move SkColorSpace ICC parsing/writing code to its own file

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2101823003

Review-Url: https://codereview.chromium.org/2101823003
This commit is contained in:
msarett 2016-06-28 07:16:40 -07:00 committed by Commit bot
parent 0a8f40cbe6
commit 085cad4abc
4 changed files with 1081 additions and 1070 deletions

View File

@ -76,6 +76,7 @@
'<(skia_src_path)/core/SkColorShader.cpp',
'<(skia_src_path)/core/SkColorShader.h',
'<(skia_src_path)/core/SkColorSpace.cpp',
'<(skia_src_path)/core/SkColorSpace_ICC.cpp',
'<(skia_src_path)/core/SkColorSpaceXform.cpp',
'<(skia_src_path)/core/SkColorTable.cpp',
'<(skia_src_path)/core/SkComposeShader.cpp',

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#define SkColorSpacePrintf(...)
inline bool color_space_almost_equal(float a, float b) {
return SkTAbs(a - b) < 0.01f;
}
inline void set_gamma_value(SkGammaCurve* gamma, float value) {
if (color_space_almost_equal(2.2f, value)) {
gamma->fNamed = SkColorSpace::k2Dot2Curve_GammaNamed;
} else if (color_space_almost_equal(1.0f, value)) {
gamma->fNamed = SkColorSpace::kLinear_GammaNamed;
} else if (color_space_almost_equal(0.0f, value)) {
SkColorSpacePrintf("Treating invalid zero gamma as linear.");
gamma->fNamed = SkColorSpace::kLinear_GammaNamed;
} else {
gamma->fValue = value;
}
}

File diff suppressed because it is too large Load Diff