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

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

Issue 1288483002: Consolidate SkCodec functions for handling rewind (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 {} 59 {}
60 60
61 /* 61 /*
62 * Initiates the bitmap decode 62 * Initiates the bitmap decode
63 */ 63 */
64 SkCodec::Result SkBmpRLECodec::onGetPixels(const SkImageInfo& dstInfo, 64 SkCodec::Result SkBmpRLECodec::onGetPixels(const SkImageInfo& dstInfo,
65 void* dst, size_t dstRowBytes, 65 void* dst, size_t dstRowBytes,
66 const Options& opts, 66 const Options& opts,
67 SkPMColor* inputColorPtr, 67 SkPMColor* inputColorPtr,
68 int* inputColorCount) { 68 int* inputColorCount) {
69 if (!this->handleRewind(false)) { 69 if (!this->rewindIfNeeded()) {
70 return kCouldNotRewind; 70 return kCouldNotRewind;
71 } 71 }
72 if (opts.fSubset) { 72 if (opts.fSubset) {
73 // Subsets are not supported. 73 // Subsets are not supported.
74 return kUnimplemented; 74 return kUnimplemented;
75 } 75 }
76 if (dstInfo.dimensions() != this->getInfo().dimensions()) { 76 if (dstInfo.dimensions() != this->getInfo().dimensions()) {
77 SkCodecPrintf("Error: scaling not supported.\n"); 77 SkCodecPrintf("Error: scaling not supported.\n");
78 return kInvalidScale; 78 return kInvalidScale;
79 } 79 }
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // Set the indicated number of pixels 421 // Set the indicated number of pixels
422 for (int which = 0; x < endX; x++) { 422 for (int which = 0; x < endX; x++) {
423 setPixel(dst, dstRowBytes, dstInfo, x, y, 423 setPixel(dst, dstRowBytes, dstInfo, x, y,
424 indices[which]); 424 indices[which]);
425 which = !which; 425 which = !which;
426 } 426 }
427 } 427 }
428 } 428 }
429 } 429 }
430 } 430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698