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

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

Issue 1010903003: Add scanline decoding to SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove testing only changes. Created 5 years, 9 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 "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkCodec_libbmp.h" 10 #include "SkCodec_libbmp.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 , fNeedsRewind(false) 52 , fNeedsRewind(false)
53 {} 53 {}
54 54
55 bool SkCodec::rewindIfNeeded() { 55 bool SkCodec::rewindIfNeeded() {
56 // Store the value of fNeedsRewind so we can update it. Next read will 56 // Store the value of fNeedsRewind so we can update it. Next read will
57 // require a rewind. 57 // require a rewind.
58 const bool neededRewind = fNeedsRewind; 58 const bool neededRewind = fNeedsRewind;
59 fNeedsRewind = true; 59 fNeedsRewind = true;
60 return !neededRewind || fStream->rewind(); 60 return !neededRewind || fStream->rewind();
61 } 61 }
62
63 SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo) {
64 fScanlineDecoder.reset(NULL);
65 if (!rewindIfNeeded()) {
66 return NULL;
67 }
68 fScanlineDecoder.reset(this->onGetScanlineDecoder(dstInfo));
69 return fScanlineDecoder.get();
70 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698