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

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

Issue 2311793004: Use demux API in SkWebpCodec (Closed)
Patch Set: Fix test 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
« no previous file with comments | « no previous file | src/codec/SkWebpCodec.h » ('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 "SkBmpCodec.h" 8 #include "SkBmpCodec.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkCodecPriv.h" 10 #include "SkCodecPriv.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 , fOrigin(origin) 135 , fOrigin(origin)
136 , fDstInfo() 136 , fDstInfo()
137 , fOptions() 137 , fOptions()
138 , fCurrScanline(-1) 138 , fCurrScanline(-1)
139 {} 139 {}
140 140
141 SkCodec::~SkCodec() {} 141 SkCodec::~SkCodec() {}
142 142
143 bool SkCodec::rewindIfNeeded() { 143 bool SkCodec::rewindIfNeeded() {
144 if (!fStream) { 144 if (!fStream) {
145 // Some codecs do not have a stream, but they hold others that do. They 145 // Some codecs do not have a stream. They may hold onto their own data or another codec.
scroggo 2016/09/07 17:33:04 So when we pass the stream from webp, we're not do
msarett 2016/09/07 17:36:30 True.
146 // must handle rewinding themselves. 146 // They must handle rewinding themselves.
147 return true; 147 return true;
148 } 148 }
149 149
150 // Store the value of fNeedsRewind so we can update it. Next read will 150 // Store the value of fNeedsRewind so we can update it. Next read will
151 // require a rewind. 151 // require a rewind.
152 const bool needsRewind = fNeedsRewind; 152 const bool needsRewind = fNeedsRewind;
153 fNeedsRewind = true; 153 fNeedsRewind = true;
154 if (!needsRewind) { 154 if (!needsRewind) {
155 return true; 155 return true;
156 } 156 }
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested); 393 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested);
394 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1); 394 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1);
395 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { 395 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) {
396 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes); 396 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes);
397 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler); 397 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler);
398 } 398 }
399 break; 399 break;
400 } 400 }
401 } 401 }
402 } 402 }
OLDNEW
« no previous file with comments | « no previous file | src/codec/SkWebpCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698