| 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 #ifndef GrColorSpaceXform_DEFINED | 8 #ifndef GrColorSpaceXform_DEFINED |
| 9 #define GrColorSpaceXform_DEFINED | 9 #define GrColorSpaceXform_DEFINED |
| 10 | 10 |
| 11 #include "SkMatrix44.h" | |
| 12 #include "SkRefCnt.h" | 11 #include "SkRefCnt.h" |
| 13 | 12 |
| 14 class SkColorSpace; | 13 class SkColorSpace; |
| 14 class SkMatrix44; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * Represents a color gamut transformation (as a 4x4 color matrix) | 17 * Represents a color gamut transformation (as a 4x4 color matrix) |
| 18 */ | 18 */ |
| 19 class GrColorSpaceXform : public SkRefCnt { | 19 class GrColorSpaceXform : public SkRefCnt { |
| 20 public: | 20 public: |
| 21 GrColorSpaceXform(const SkMatrix44& srcToDst) : fSrcToDst(srcToDst) {} | 21 GrColorSpaceXform(const SkMatrix44& srcToDst); |
| 22 | 22 |
| 23 static sk_sp<GrColorSpaceXform> Make(SkColorSpace* src, SkColorSpace* dst); | 23 static sk_sp<GrColorSpaceXform> Make(SkColorSpace* src, SkColorSpace* dst); |
| 24 | 24 |
| 25 const SkMatrix44& srcToDst() { return fSrcToDst; } | 25 const float* srcToDst() { return fSrcToDst; } |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 SkMatrix44 fSrcToDst; | 28 // We store the column-major form of the srcToDst matrix, for easy uploading
to uniforms |
| 29 float fSrcToDst[16]; |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 #endif | 32 #endif |
| OLD | NEW |