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

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

Issue 1472933002: Make SkAndroidCodec support ico (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments Created 5 years 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/SkCodec_libico.cpp ('k') | tests/CodexTest.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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 /** 157 /**
158 * Implement fill using a custom width. 158 * Implement fill using a custom width.
159 */ 159 */
160 void fill(const SkImageInfo& info, void* dst, size_t rowBytes, uint32_t colo rOrIndex, 160 void fill(const SkImageInfo& info, void* dst, size_t rowBytes, uint32_t colo rOrIndex,
161 SkCodec::ZeroInitialized zeroInit) override { 161 SkCodec::ZeroInitialized zeroInit) override {
162 const SkImageInfo fillInfo = info.makeWH(fAllocatedWidth, info.height()) ; 162 const SkImageInfo fillInfo = info.makeWH(fAllocatedWidth, info.height()) ;
163 SkSampler::Fill(fillInfo, dst, rowBytes, colorOrIndex, zeroInit); 163 SkSampler::Fill(fillInfo, dst, rowBytes, colorOrIndex, zeroInit);
164 } 164 }
165 165
166 /**
167 * If fSampleX > 1, the swizzler is sampling every fSampleX'th pixel and
168 * discarding the rest.
169 *
170 * This getter is currently used by SkBmpStandardCodec for Bmp-in-Ico decod es.
171 * Ideally, the subclasses of SkCodec would have no knowledge of sampling, but
172 * this allows us to apply a transparency mask to pixels after swizzling.
173 */
174 int sampleX() const { return fSampleX; }
175
166 private: 176 private:
167 177
168 /** 178 /**
169 * Method for converting raw data to Skia pixels. 179 * Method for converting raw data to Skia pixels.
170 * @param dstRow Row in which to write the resulting pixels. 180 * @param dstRow Row in which to write the resulting pixels.
171 * @param src Row of src data, in format specified by SrcConfig 181 * @param src Row of src data, in format specified by SrcConfig
172 * @param dstWidth Width in pixels of the destination 182 * @param dstWidth Width in pixels of the destination
173 * @param bpp if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel 183 * @param bpp if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel
174 * else, deltaSrc is bitsPerPixel 184 * else, deltaSrc is bitsPerPixel
175 * @param deltaSrc bpp * sampleX 185 * @param deltaSrc bpp * sampleX
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 // fBPP is bitsPerPixel 279 // fBPP is bitsPerPixel
270 const int fDstBPP; // Bytes per pixel for the destination color type 280 const int fDstBPP; // Bytes per pixel for the destination color type
271 281
272 SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidt h, int dstOffset, 282 SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidt h, int dstOffset,
273 int dstWidth, int srcBPP, int dstBPP); 283 int dstWidth, int srcBPP, int dstBPP);
274 284
275 int onSetSampleX(int) override; 285 int onSetSampleX(int) override;
276 286
277 }; 287 };
278 #endif // SkSwizzler_DEFINED 288 #endif // SkSwizzler_DEFINED
OLDNEW
« no previous file with comments | « src/codec/SkCodec_libico.cpp ('k') | tests/CodexTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698