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 "GrColorSpaceXform.h" | 8 #include "GrColorSpaceXform.h" |
9 #include "SkColorSpace.h" | 9 #include "SkColorSpace.h" |
10 #include "SkColorSpace_Base.h" | 10 #include "SkColorSpace_Base.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 SkMatrix44 srcToDst(SkMatrix44::kUninitialized_Constructor); | 52 SkMatrix44 srcToDst(SkMatrix44::kUninitialized_Constructor); |
53 srcToDst.setConcat(as_CSB(dst)->fromXYZD50(), src->toXYZD50()); | 53 srcToDst.setConcat(as_CSB(dst)->fromXYZD50(), src->toXYZD50()); |
54 | 54 |
55 if (matrix_is_almost_identity(srcToDst)) { | 55 if (matrix_is_almost_identity(srcToDst)) { |
56 return nullptr; | 56 return nullptr; |
57 } | 57 } |
58 | 58 |
59 return sk_make_sp<GrColorSpaceXform>(srcToDst); | 59 return sk_make_sp<GrColorSpaceXform>(srcToDst); |
60 } | 60 } |
| 61 |
| 62 GrColor4f GrColorSpaceXform::apply(const GrColor4f& srcColor) { |
| 63 GrColor4f result; |
| 64 fSrcToDst.mapScalars(srcColor.fRGBA, result.fRGBA); |
| 65 return result; |
| 66 } |
OLD | NEW |