| 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 23 matching lines...) Expand all Loading... |
| 34 int sampleY() const { | 34 int sampleY() const { |
| 35 return fSampleY; | 35 return fSampleY; |
| 36 } | 36 } |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * Based on fSampleY, return whether this row belongs in the output. | 39 * Based on fSampleY, return whether this row belongs in the output. |
| 40 * | 40 * |
| 41 * @param row Row of the image, starting with the first row in the subset. | 41 * @param row Row of the image, starting with the first row in the subset. |
| 42 */ | 42 */ |
| 43 bool rowNeeded(int row) const { | 43 bool rowNeeded(int row) const { |
| 44 return (row + get_start_coord(fSampleY)) % fSampleY == 0; | 44 return (row - get_start_coord(fSampleY)) % fSampleY == 0; |
| 45 } | 45 } |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Fill the remainder of the destination with a single color | 48 * Fill the remainder of the destination with a single color |
| 49 * | 49 * |
| 50 * @param info | 50 * @param info |
| 51 * Contains the color type of the rows to fill. | 51 * Contains the color type of the rows to fill. |
| 52 * Contains the width of the destination rows to fill | 52 * Contains the width of the destination rows to fill |
| 53 * Contains the number of rows that we need to fill. | 53 * Contains the number of rows that we need to fill. |
| 54 * | 54 * |
| (...skipping 29 matching lines...) Expand all Loading... |
| 84 {} | 84 {} |
| 85 | 85 |
| 86 virtual ~SkSampler() {} | 86 virtual ~SkSampler() {} |
| 87 private: | 87 private: |
| 88 int fSampleY; | 88 int fSampleY; |
| 89 | 89 |
| 90 virtual int onSetSampleX(int) = 0; | 90 virtual int onSetSampleX(int) = 0; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 #endif // SkSampler_DEFINED | 93 #endif // SkSampler_DEFINED |
| OLD | NEW |