| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #ifndef SkSampler_DEFINED | 7 #ifndef SkSampler_DEFINED |
| 8 #define SkSampler_DEFINED | 8 #define SkSampler_DEFINED |
| 9 | 9 |
| 10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * Contains the width of the destination rows to fill | 28 * Contains the width of the destination rows to fill |
| 29 * Contains the number of rows that we need to fill. | 29 * Contains the number of rows that we need to fill. |
| 30 * | 30 * |
| 31 * @param dst | 31 * @param dst |
| 32 * The destination row to fill from. | 32 * The destination row to fill from. |
| 33 * | 33 * |
| 34 * @param rowBytes | 34 * @param rowBytes |
| 35 * Stride in bytes of the destination. | 35 * Stride in bytes of the destination. |
| 36 * | 36 * |
| 37 * @param colorOrIndex | 37 * @param colorOrIndex |
| 38 * If colorType is kF16, colorOrIndex is treated as a 64-bit color. |
| 38 * If colorType is kN32, colorOrIndex is treated as a 32-bit color. | 39 * If colorType is kN32, colorOrIndex is treated as a 32-bit color. |
| 39 * If colorType is k565, colorOrIndex is treated as a 16-bit color. | 40 * If colorType is k565, colorOrIndex is treated as a 16-bit color. |
| 40 * If colorType is kGray, colorOrIndex is treated as an 8-bit color. | 41 * If colorType is kGray, colorOrIndex is treated as an 8-bit color. |
| 41 * If colorType is kIndex, colorOrIndex is treated as an 8-bit index. | 42 * If colorType is kIndex, colorOrIndex is treated as an 8-bit index. |
| 42 * Other SkColorTypes are not supported. | 43 * Other SkColorTypes are not supported. |
| 43 * | 44 * |
| 44 * @param zeroInit | 45 * @param zeroInit |
| 45 * Indicates whether memory is already zero initialized. | 46 * Indicates whether memory is already zero initialized. |
| 46 * | 47 * |
| 47 */ | 48 */ |
| 48 static void Fill(const SkImageInfo& info, void* dst, size_t rowBytes, | 49 static void Fill(const SkImageInfo& info, void* dst, size_t rowBytes, |
| 49 uint32_t colorOrIndex, SkCodec::ZeroInitialized zeroInit); | 50 uint64_t colorOrIndex, SkCodec::ZeroInitialized zeroInit); |
| 50 | 51 |
| 51 /** | 52 /** |
| 52 * Allow subclasses to implement unique versions of fill(). | 53 * Allow subclasses to implement unique versions of fill(). |
| 53 */ | 54 */ |
| 54 virtual void fill(const SkImageInfo& info, void* dst, size_t rowBytes, | 55 virtual void fill(const SkImageInfo& info, void* dst, size_t rowBytes, |
| 55 uint32_t colorOrIndex, SkCodec::ZeroInitialized zeroInit) {} | 56 uint64_t colorOrIndex, SkCodec::ZeroInitialized zeroInit) {} |
| 56 | 57 |
| 57 virtual ~SkSampler() {} | 58 virtual ~SkSampler() {} |
| 58 private: | 59 private: |
| 59 | 60 |
| 60 virtual int onSetSampleX(int) = 0; | 61 virtual int onSetSampleX(int) = 0; |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 #endif // SkSampler_DEFINED | 64 #endif // SkSampler_DEFINED |
| OLD | NEW |