| 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 SkColorSpaceXform_DEFINED | 8 #ifndef SkColorSpaceXform_DEFINED |
| 9 #define SkColorSpaceXform_DEFINED | 9 #define SkColorSpaceXform_DEFINED |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 * @param dstColorFormat Describes color format of |dst| | 43 * @param dstColorFormat Describes color format of |dst| |
| 44 * @param srcColorFormat Describes color format of |src| | 44 * @param srcColorFormat Describes color format of |src| |
| 45 * Must be kRGBA_8888 or kBGRA_8888 | 45 * Must be kRGBA_8888 or kBGRA_8888 |
| 46 * @param alphaType Describes alpha properties of the |dst| (and |src|
) | 46 * @param alphaType Describes alpha properties of the |dst| (and |src|
) |
| 47 * kUnpremul preserves input alpha values | 47 * kUnpremul preserves input alpha values |
| 48 * kPremul performs a premultiplication and also pr
eserves alpha values | 48 * kPremul performs a premultiplication and also pr
eserves alpha values |
| 49 * kOpaque optimization hint, |dst| alphas set to 1 | 49 * kOpaque optimization hint, |dst| alphas set to 1 |
| 50 * | 50 * |
| 51 */ | 51 */ |
| 52 bool apply(ColorFormat dstFormat, void* dst, ColorFormat srcFormat, const vo
id* src, int count, | 52 bool apply(ColorFormat dstFormat, void* dst, ColorFormat srcFormat, const vo
id* src, int count, |
| 53 SkAlphaType alphaType) const { | 53 SkAlphaType alphaType) const; |
| 54 return this->onApply(dstFormat, dst, srcFormat, src, count, alphaType); | |
| 55 } | |
| 56 | |
| 57 | 54 |
| 58 virtual ~SkColorSpaceXform() {} | 55 virtual ~SkColorSpaceXform() {} |
| 59 | 56 |
| 60 protected: | 57 protected: |
| 61 virtual bool onApply(ColorFormat dstFormat, void* dst, ColorFormat srcFormat
, const void* src, | |
| 62 int count, SkAlphaType alphaType) const = 0; | |
| 63 | |
| 64 SkColorSpaceXform() {} | 58 SkColorSpaceXform() {} |
| 65 }; | 59 }; |
| 66 | 60 |
| 67 #endif | 61 #endif |
| OLD | NEW |