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

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

Issue 980903002: Option for SkCodec to treat dst as all zeroes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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_libpng.h" 10 #include "SkCodec_libpng.h"
(...skipping 21 matching lines...) Expand all
32 if (!data) { 32 if (!data) {
33 return NULL; 33 return NULL;
34 } 34 }
35 return NewFromStream(SkNEW_ARGS(SkMemoryStream, (data))); 35 return NewFromStream(SkNEW_ARGS(SkMemoryStream, (data)));
36 } 36 }
37 37
38 SkCodec::SkCodec(const SkImageInfo& info, SkStream* stream) 38 SkCodec::SkCodec(const SkImageInfo& info, SkStream* stream)
39 : fInfo(info) 39 : fInfo(info)
40 , fStream(stream) 40 , fStream(stream)
41 , fNeedsRewind(false) 41 , fNeedsRewind(false)
42 , fZeroInitialized(kNo_ZeroInitialized)
42 {} 43 {}
43 44
44 bool SkCodec::rewindIfNeeded() { 45 bool SkCodec::rewindIfNeeded() {
45 // Store the value of fNeedsRewind so we can update it. Next read will 46 // Store the value of fNeedsRewind so we can update it. Next read will
46 // require a rewind. 47 // require a rewind.
47 const bool neededRewind = fNeedsRewind; 48 const bool neededRewind = fNeedsRewind;
48 fNeedsRewind = true; 49 fNeedsRewind = true;
49 return !neededRewind || fStream->rewind(); 50 return !neededRewind || fStream->rewind();
50 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698