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

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

Issue 1381483002: Call rewindIfNeeded in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@codecSDmerge
Patch Set: Rebase Created 5 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 | « src/codec/SkBmpCodec.cpp ('k') | src/codec/SkBmpRLECodec.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 #include "SkBmpMaskCodec.h" 8 #include "SkBmpMaskCodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 12 matching lines...) Expand all
23 {} 23 {}
24 24
25 /* 25 /*
26 * Initiates the bitmap decode 26 * Initiates the bitmap decode
27 */ 27 */
28 SkCodec::Result SkBmpMaskCodec::onGetPixels(const SkImageInfo& dstInfo, 28 SkCodec::Result SkBmpMaskCodec::onGetPixels(const SkImageInfo& dstInfo,
29 void* dst, size_t dstRowBytes, 29 void* dst, size_t dstRowBytes,
30 const Options& opts, 30 const Options& opts,
31 SkPMColor* inputColorPtr, 31 SkPMColor* inputColorPtr,
32 int* inputColorCount) { 32 int* inputColorCount) {
33 if (!this->rewindIfNeeded()) {
34 return kCouldNotRewind;
35 }
36 if (opts.fSubset) { 33 if (opts.fSubset) {
37 // Subsets are not supported. 34 // Subsets are not supported.
38 return kUnimplemented; 35 return kUnimplemented;
39 } 36 }
40 if (dstInfo.dimensions() != this->getInfo().dimensions()) { 37 if (dstInfo.dimensions() != this->getInfo().dimensions()) {
41 SkCodecPrintf("Error: scaling not supported.\n"); 38 SkCodecPrintf("Error: scaling not supported.\n");
42 return kInvalidScale; 39 return kInvalidScale;
43 } 40 }
44 41
45 if (!conversion_possible(dstInfo, this->getInfo())) { 42 if (!conversion_possible(dstInfo, this->getInfo())) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 98
102 // Decode the row in destination format 99 // Decode the row in destination format
103 uint32_t row = this->getDstRow(y, height); 100 uint32_t row = this->getDstRow(y, height);
104 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); 101 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes);
105 fMaskSwizzler->swizzle(dstRow, srcRow); 102 fMaskSwizzler->swizzle(dstRow, srcRow);
106 } 103 }
107 104
108 // Finished decoding the entire image 105 // Finished decoding the entire image
109 return kSuccess; 106 return kSuccess;
110 } 107 }
OLDNEW
« no previous file with comments | « src/codec/SkBmpCodec.cpp ('k') | src/codec/SkBmpRLECodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698