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

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

Issue 2319293003: 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
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 "SkBmpRLECodec.h" 8 #include "SkBmpRLECodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 26 matching lines...) Expand all
37 SkCodec::Result SkBmpRLECodec::onGetPixels(const SkImageInfo& dstInfo, 37 SkCodec::Result SkBmpRLECodec::onGetPixels(const SkImageInfo& dstInfo,
38 void* dst, size_t dstRowBytes, 38 void* dst, size_t dstRowBytes,
39 const Options& opts, 39 const Options& opts,
40 SkPMColor* inputColorPtr, 40 SkPMColor* inputColorPtr,
41 int* inputColorCount, 41 int* inputColorCount,
42 int* rowsDecoded) { 42 int* rowsDecoded) {
43 if (opts.fSubset) { 43 if (opts.fSubset) {
44 // Subsets are not supported. 44 // Subsets are not supported.
45 return kUnimplemented; 45 return kUnimplemented;
46 } 46 }
47 if (!conversion_possible(dstInfo, this->getInfo())) { 47 if (!legacy_conversion_possible(dstInfo, this->getInfo())) {
48 SkCodecPrintf("Error: cannot convert input type to output type.\n"); 48 SkCodecPrintf("Error: cannot convert input type to output type.\n");
49 return kInvalidConversion; 49 return kInvalidConversion;
50 } 50 }
51 51
52 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol orCount); 52 Result result = this->prepareToDecode(dstInfo, opts, inputColorPtr, inputCol orCount);
53 if (kSuccess != result) { 53 if (kSuccess != result) {
54 return result; 54 return result;
55 } 55 }
56 56
57 // Perform the decode 57 // Perform the decode
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 fSampler.reset(new SkBmpRLESampler(this)); 547 fSampler.reset(new SkBmpRLESampler(this));
548 } 548 }
549 549
550 return fSampler; 550 return fSampler;
551 } 551 }
552 552
553 int SkBmpRLECodec::setSampleX(int sampleX){ 553 int SkBmpRLECodec::setSampleX(int sampleX){
554 fSampleX = sampleX; 554 fSampleX = sampleX;
555 return get_scaled_dimension(this->getInfo().width(), sampleX); 555 return get_scaled_dimension(this->getInfo().width(), sampleX);
556 } 556 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698