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

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

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (Closed)
Patch Set: fix xpsdevice 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 | « src/android/SkBitmapRegionDecoder.cpp ('k') | src/codec/SkCodec.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 "SkAndroidCodec.h" 8 #include "SkAndroidCodec.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkCodecPriv.h" 10 #include "SkCodecPriv.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #endif 48 #endif
49 #ifdef SK_CODEC_DECODES_RAW 49 #ifdef SK_CODEC_DECODES_RAW
50 case kDNG_SkEncodedFormat: 50 case kDNG_SkEncodedFormat:
51 return new SkRawAdapterCodec((SkRawCodec*)codec.release()); 51 return new SkRawAdapterCodec((SkRawCodec*)codec.release());
52 #endif 52 #endif
53 default: 53 default:
54 return nullptr; 54 return nullptr;
55 } 55 }
56 } 56 }
57 57
58 SkAndroidCodec* SkAndroidCodec::NewFromData(SkData* data, SkPngChunkReader* chun kReader) { 58 SkAndroidCodec* SkAndroidCodec::NewFromData(sk_sp<SkData> data, SkPngChunkReader * chunkReader) {
59 if (!data) { 59 if (!data) {
60 return nullptr; 60 return nullptr;
61 } 61 }
62 62
63 return NewFromStream(new SkMemoryStream(data), chunkReader); 63 return NewFromStream(new SkMemoryStream(data), chunkReader);
64 } 64 }
65 65
66 SkColorType SkAndroidCodec::computeOutputColorType(SkColorType requestedColorTyp e) { 66 SkColorType SkAndroidCodec::computeOutputColorType(SkColorType requestedColorTyp e) {
67 // The legacy GIF and WBMP decoders always decode to kIndex_8_SkColorType. 67 // The legacy GIF and WBMP decoders always decode to kIndex_8_SkColorType.
68 // We will maintain this behavior. 68 // We will maintain this behavior.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 188 }
189 } 189 }
190 190
191 return this->onGetAndroidPixels(info, pixels, rowBytes, *options); 191 return this->onGetAndroidPixels(info, pixels, rowBytes, *options);
192 } 192 }
193 193
194 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void* pixels, 194 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void* pixels,
195 size_t rowBytes) { 195 size_t rowBytes) {
196 return this->getAndroidPixels(info, pixels, rowBytes, nullptr); 196 return this->getAndroidPixels(info, pixels, rowBytes, nullptr);
197 } 197 }
OLDNEW
« no previous file with comments | « src/android/SkBitmapRegionDecoder.cpp ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698