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

Side by Side Diff: src/codec/SkBmpMaskCodec.cpp

Issue 1287423002: Scanline decoding for bmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments - Does not compile - Needs rebase for conv_poss update Created 5 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
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 #include "SkBmpMaskCodec.h" 8 #include "SkBmpMaskCodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 22 matching lines...) Expand all
33 default: 33 default:
34 return false; 34 return false;
35 } 35 }
36 } 36 }
37 37
38 38
39 /* 39 /*
40 * Creates an instance of the decoder 40 * Creates an instance of the decoder
41 */ 41 */
42 SkBmpMaskCodec::SkBmpMaskCodec(const SkImageInfo& info, SkStream* stream, 42 SkBmpMaskCodec::SkBmpMaskCodec(const SkImageInfo& info, SkStream* stream,
43 SkBmpCodec::BmpInputFormat inputFormat,
43 uint16_t bitsPerPixel, SkMasks* masks, 44 uint16_t bitsPerPixel, SkMasks* masks,
44 SkBmpCodec::RowOrder rowOrder) 45 SkBmpCodec::RowOrder rowOrder)
45 : INHERITED(info, stream, bitsPerPixel, rowOrder) 46 : INHERITED(info, stream, inputFormat, bitsPerPixel, rowOrder)
46 , fMasks(masks) 47 , fMasks(masks)
47 , fMaskSwizzler(NULL) 48 , fMaskSwizzler(NULL)
48 , fSrcBuffer(NULL) 49 , fSrcBuffer(NULL)
49 {} 50 {}
50 51
51 /* 52 /*
52 * Initiates the bitmap decode 53 * Initiates the bitmap decode
53 */ 54 */
54 SkCodec::Result SkBmpMaskCodec::onGetPixels(const SkImageInfo& dstInfo, 55 SkCodec::Result SkBmpMaskCodec::onGetPixels(const SkImageInfo& dstInfo,
55 void* dst, size_t dstRowBytes, 56 void* dst, size_t dstRowBytes,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 129
129 // Decode the row in destination format 130 // Decode the row in destination format
130 int row = SkBmpCodec::kBottomUp_RowOrder == this->rowOrder() ? height - 1 - y : y; 131 int row = SkBmpCodec::kBottomUp_RowOrder == this->rowOrder() ? height - 1 - y : y;
131 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); 132 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes);
132 fMaskSwizzler->swizzle(dstRow, srcRow); 133 fMaskSwizzler->swizzle(dstRow, srcRow);
133 } 134 }
134 135
135 // Finished decoding the entire image 136 // Finished decoding the entire image
136 return kSuccess; 137 return kSuccess;
137 } 138 }
139
140 SkCodec::Result SkBmpMaskCodec::onStart(const SkImageInfo& dstInfo,
141 const SkCodec::Options& options, SkPMColor inputColorPtr[], int* inputCo lorCount) {
142 // Initialize a the mask swizzler
143 if (!this->initializeSwizzler(dstInfo)) {
144 SkCodecPrintf("Error: cannot initialize swizzler.\n");
145 return SkCodec::kInvalidConversion;
146 }
147
148 return SkCodec::kSuccess;
149 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698