Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1329)

Side by Side Diff: src/codec/SkSampler.h

Issue 2440563002: Subtract start_coord instead of adding it (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698