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

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

Issue 2247743002: Fix color xform width bug when scaling/subsetting (Closed) Base URL: https://skia.googlesource.com/skia.git@skipstuff
Patch Set: Rebase Created 4 years, 4 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 | « src/codec/SkPngCodec.cpp ('k') | tests/CodecTest.cpp » ('j') | 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 7
8 #ifndef SkSwizzler_DEFINED 8 #ifndef SkSwizzler_DEFINED
9 #define SkSwizzler_DEFINED 9 #define SkSwizzler_DEFINED
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 /** 65 /**
66 * If fSampleX > 1, the swizzler is sampling every fSampleX'th pixel and 66 * If fSampleX > 1, the swizzler is sampling every fSampleX'th pixel and
67 * discarding the rest. 67 * discarding the rest.
68 * 68 *
69 * This getter is currently used by SkBmpStandardCodec for Bmp-in-Ico decod es. 69 * This getter is currently used by SkBmpStandardCodec for Bmp-in-Ico decod es.
70 * Ideally, the subclasses of SkCodec would have no knowledge of sampling, but 70 * Ideally, the subclasses of SkCodec would have no knowledge of sampling, but
71 * this allows us to apply a transparency mask to pixels after swizzling. 71 * this allows us to apply a transparency mask to pixels after swizzling.
72 */ 72 */
73 int sampleX() const { return fSampleX; } 73 int sampleX() const { return fSampleX; }
74 74
75 /**
76 * Returns the actual number of pixels written to destination memory, takin g
77 * scaling, subsetting, and partial frames into account.
78 */
79 int swizzleWidth() const { return fSwizzleWidth; }
80
75 private: 81 private:
76 82
77 /** 83 /**
78 * Method for converting raw data to Skia pixels. 84 * Method for converting raw data to Skia pixels.
79 * @param dstRow Row in which to write the resulting pixels. 85 * @param dstRow Row in which to write the resulting pixels.
80 * @param src Row of src data, in format specified by SrcConfig 86 * @param src Row of src data, in format specified by SrcConfig
81 * @param dstWidth Width in pixels of the destination 87 * @param dstWidth Width in pixels of the destination
82 * @param bpp if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel 88 * @param bpp if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel
83 * else, deltaSrc is bitsPerPixel 89 * else, deltaSrc is bitsPerPixel
84 * @param deltaSrc bpp * sampleX 90 * @param deltaSrc bpp * sampleX
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // fBPP is bitsPerPixel 201 // fBPP is bitsPerPixel
196 const int fDstBPP; // Bytes per pixel for the destination color type 202 const int fDstBPP; // Bytes per pixel for the destination color type
197 203
198 SkSwizzler(RowProc fastProc, RowProc proc, const SkPMColor* ctable, int srcO ffset, 204 SkSwizzler(RowProc fastProc, RowProc proc, const SkPMColor* ctable, int srcO ffset,
199 int srcWidth, int dstOffset, int dstWidth, int srcBPP, int dstBPP); 205 int srcWidth, int dstOffset, int dstWidth, int srcBPP, int dstBPP);
200 206
201 int onSetSampleX(int) override; 207 int onSetSampleX(int) override;
202 208
203 }; 209 };
204 #endif // SkSwizzler_DEFINED 210 #endif // SkSwizzler_DEFINED
OLDNEW
« no previous file with comments | « src/codec/SkPngCodec.cpp ('k') | tests/CodecTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698