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

Side by Side Diff: src/codec/SkBmpRLECodec.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/SkBmpMaskCodec.cpp ('k') | src/codec/SkBmpStandardCodec.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 "SkBmpRLECodec.h" 8 #include "SkBmpRLECodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 21 matching lines...) Expand all
32 {} 32 {}
33 33
34 /* 34 /*
35 * Initiates the bitmap decode 35 * Initiates the bitmap decode
36 */ 36 */
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 if (!this->rewindIfNeeded()) {
43 return kCouldNotRewind;
44 }
45 if (opts.fSubset) { 42 if (opts.fSubset) {
46 // Subsets are not supported. 43 // Subsets are not supported.
47 return kUnimplemented; 44 return kUnimplemented;
48 } 45 }
49 if (dstInfo.dimensions() != this->getInfo().dimensions()) { 46 if (dstInfo.dimensions() != this->getInfo().dimensions()) {
50 SkCodecPrintf("Error: scaling not supported.\n"); 47 SkCodecPrintf("Error: scaling not supported.\n");
51 return kInvalidScale; 48 return kInvalidScale;
52 } 49 }
53 if (!conversion_possible(dstInfo, this->getInfo())) { 50 if (!conversion_possible(dstInfo, this->getInfo())) {
54 SkCodecPrintf("Error: cannot convert input type to output type.\n"); 51 SkCodecPrintf("Error: cannot convert input type to output type.\n");
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 459
463 // Set the indicated number of pixels 460 // Set the indicated number of pixels
464 for (int which = 0; x < endX; x++) { 461 for (int which = 0; x < endX; x++) {
465 setPixel(dst, dstRowBytes, dstInfo, x, y, indices[which]); 462 setPixel(dst, dstRowBytes, dstInfo, x, y, indices[which]);
466 which = !which; 463 which = !which;
467 } 464 }
468 } 465 }
469 } 466 }
470 } 467 }
471 } 468 }
OLDNEW
« no previous file with comments | « src/codec/SkBmpMaskCodec.cpp ('k') | src/codec/SkBmpStandardCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698