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

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

Issue 1707933002: Return the proper error code in SkBmpRLECodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | 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 "SkBmpRLECodec.h" 8 #include "SkBmpRLECodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 return SkCodec::kInvalidInput; 280 return SkCodec::kInvalidInput;
281 } 281 }
282 282
283 // Copy the color table to the client if necessary 283 // Copy the color table to the client if necessary
284 copy_color_table(dstInfo, this->fColorTable, inputColorPtr, inputColorCount) ; 284 copy_color_table(dstInfo, this->fColorTable, inputColorPtr, inputColorCount) ;
285 285
286 // Initialize a buffer for encoded RLE data 286 // Initialize a buffer for encoded RLE data
287 fRLEBytes = fOrigRLEBytes; 287 fRLEBytes = fOrigRLEBytes;
288 if (!this->initializeStreamBuffer()) { 288 if (!this->initializeStreamBuffer()) {
289 SkCodecPrintf("Error: cannot initialize stream buffer.\n"); 289 SkCodecPrintf("Error: cannot initialize stream buffer.\n");
290 return SkCodec::kInvalidConversion; 290 return SkCodec::kInvalidInput;
291 } 291 }
292 292
293 return SkCodec::kSuccess; 293 return SkCodec::kSuccess;
294 } 294 }
295 295
296 /* 296 /*
297 * Performs the bitmap decoding for RLE input format 297 * Performs the bitmap decoding for RLE input format
298 * RLE decoding is performed all at once, rather than a one row at a time 298 * RLE decoding is performed all at once, rather than a one row at a time
299 */ 299 */
300 int SkBmpRLECodec::decodeRows(const SkImageInfo& info, void* dst, size_t dstRowB ytes, 300 int SkBmpRLECodec::decodeRows(const SkImageInfo& info, void* dst, size_t dstRowB ytes,
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 fSampler.reset(new SkBmpRLESampler(this)); 539 fSampler.reset(new SkBmpRLESampler(this));
540 } 540 }
541 541
542 return fSampler; 542 return fSampler;
543 } 543 }
544 544
545 int SkBmpRLECodec::setSampleX(int sampleX){ 545 int SkBmpRLECodec::setSampleX(int sampleX){
546 fSampleX = sampleX; 546 fSampleX = sampleX;
547 return get_scaled_dimension(this->getInfo().width(), sampleX); 547 return get_scaled_dimension(this->getInfo().width(), sampleX);
548 } 548 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698