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

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

Issue 2328663002: Revert of Checking for valid colorType, alphaType, colorSpace in SkCodec (Closed)
Patch Set: Created 4 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/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 21 matching lines...) Expand all
32 int* rowsDecoded) { 32 int* rowsDecoded) {
33 if (opts.fSubset) { 33 if (opts.fSubset) {
34 // Subsets are not supported. 34 // Subsets are not supported.
35 return kUnimplemented; 35 return kUnimplemented;
36 } 36 }
37 if (dstInfo.dimensions() != this->getInfo().dimensions()) { 37 if (dstInfo.dimensions() != this->getInfo().dimensions()) {
38 SkCodecPrintf("Error: scaling not supported.\n"); 38 SkCodecPrintf("Error: scaling not supported.\n");
39 return kInvalidScale; 39 return kInvalidScale;
40 } 40 }
41 41
42 if (!conversion_possible_ignore_color_space(dstInfo, this->getInfo())) { 42 if (!conversion_possible(dstInfo, this->getInfo())) {
43 SkCodecPrintf("Error: cannot convert input type to output type.\n"); 43 SkCodecPrintf("Error: cannot convert input type to output type.\n");
44 return kInvalidConversion; 44 return kInvalidConversion;
45 } 45 }
46 46
47 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol orCount); 47 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol orCount);
48 if (kSuccess != result) { 48 if (kSuccess != result) {
49 return result; 49 return result;
50 } 50 }
51 51
52 int rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts); 52 int rows = this->decodeRows(dstInfo, dst, dstRowBytes, opts);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 // Decode the row in destination format 86 // Decode the row in destination format
87 uint32_t row = this->getDstRow(y, height); 87 uint32_t row = this->getDstRow(y, height);
88 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); 88 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes);
89 fMaskSwizzler->swizzle(dstRow, srcRow); 89 fMaskSwizzler->swizzle(dstRow, srcRow);
90 } 90 }
91 91
92 // Finished decoding the entire image 92 // Finished decoding the entire image
93 return height; 93 return height;
94 } 94 }
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