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

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

Issue 1287423002: Scanline decoding for bmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix windows errors Created 5 years, 3 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/SkJpegCodec.cpp ('k') | src/codec/SkMaskSwizzler.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 #ifndef SkMaskSwizzler_DEFINED 7 #ifndef SkMaskSwizzler_DEFINED
8 #define SkMaskSwizzler_DEFINED 8 #define SkMaskSwizzler_DEFINED
9 9
10 #include "SkMasks.h" 10 #include "SkMasks.h"
11 #include "SkSwizzler.h" 11 #include "SkSwizzler.h"
12 #include "SkTypes.h" 12 #include "SkTypes.h"
13 13
14 /* 14 /*
15 * 15 *
16 * Used to swizzle images whose pixel components are extracted by bit masks 16 * Used to swizzle images whose pixel components are extracted by bit masks
17 * Currently only used by bmp 17 * Currently only used by bmp
18 * 18 *
19 */ 19 */
20 class SkMaskSwizzler { 20 class SkMaskSwizzler {
21 public: 21 public:
22 22
23 /* 23 /*
24 * Create a new swizzler 24 * Create a new swizzler
25 * @param masks Unowned pointer to helper class 25 * @param masks Unowned pointer to helper class
26 */ 26 */
27 static SkMaskSwizzler* CreateMaskSwizzler(const SkImageInfo& imageInfo, 27 static SkMaskSwizzler* CreateMaskSwizzler(const SkImageInfo& dstInfo,
28 const SkImageInfo& srcInfo,
28 SkMasks* masks, 29 SkMasks* masks,
29 uint32_t bitsPerPixel); 30 uint32_t bitsPerPixel);
30 31
31 /* 32 /*
32 * Swizzle a row 33 * Swizzle a row
33 */ 34 */
34 SkSwizzler::ResultAlpha swizzle(void* dst, const uint8_t* SK_RESTRICT src); 35 SkSwizzler::ResultAlpha swizzle(void* dst, const uint8_t* SK_RESTRICT src);
35 36
36 private: 37 private:
37 38
38 /* 39 /*
39 * Row procedure used for swizzle 40 * Row procedure used for swizzle
40 */ 41 */
41 typedef SkSwizzler::ResultAlpha (*RowProc)( 42 typedef SkSwizzler::ResultAlpha (*RowProc)(
42 void* dstRow, const uint8_t* srcRow, int width, 43 void* dstRow, const uint8_t* srcRow, int width,
43 SkMasks* masks); 44 SkMasks* masks, uint32_t startX, uint32_t sampleX);
44 45
45 /* 46 /*
46 * Constructor for mask swizzler 47 * Constructor for mask swizzler
47 */ 48 */
48 SkMaskSwizzler(const SkImageInfo& info, SkMasks* masks, RowProc proc); 49 SkMaskSwizzler(const SkImageInfo& info, SkMasks* masks, RowProc proc,
50 uint32_t sampleX);
49 51
50 // Fields 52 // Fields
51 const SkImageInfo& fDstInfo; 53 const SkImageInfo& fDstInfo;
52 SkMasks* fMasks; // unowned 54 SkMasks* fMasks; // unowned
53 const RowProc fRowProc; 55 const RowProc fRowProc;
56 const uint32_t fSampleX;
57 const uint32_t fStartX;
54 }; 58 };
55 59
56 #endif 60 #endif
OLDNEW
« no previous file with comments | « src/codec/SkJpegCodec.cpp ('k') | src/codec/SkMaskSwizzler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698