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

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

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 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
« no previous file with comments | « src/codec/SkWbmpCodec.cpp ('k') | src/core/SkAdvancedTypefaceMetrics.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 "SkCodecPriv.h" 8 #include "SkCodecPriv.h"
9 #include "SkWebpCodec.h" 9 #include "SkWebpCodec.h"
10 #include "SkTemplates.h" 10 #include "SkTemplates.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 SkToBool(features.has_alpha) ? kUnpremul_SkAlp haType 70 SkToBool(features.has_alpha) ? kUnpremul_SkAlp haType
71 : kOpaque_SkAlphaT ype); 71 : kOpaque_SkAlphaT ype);
72 } 72 }
73 return true; 73 return true;
74 } 74 }
75 75
76 SkCodec* SkWebpCodec::NewFromStream(SkStream* stream) { 76 SkCodec* SkWebpCodec::NewFromStream(SkStream* stream) {
77 SkAutoTDelete<SkStream> streamDeleter(stream); 77 SkAutoTDelete<SkStream> streamDeleter(stream);
78 SkImageInfo info; 78 SkImageInfo info;
79 if (webp_parse_header(stream, &info)) { 79 if (webp_parse_header(stream, &info)) {
80 return new SkWebpCodec(info, streamDeleter.detach()); 80 return new SkWebpCodec(info, streamDeleter.release());
81 } 81 }
82 return nullptr; 82 return nullptr;
83 } 83 }
84 84
85 // This version is slightly different from SkCodecPriv's version of conversion_p ossible. It 85 // This version is slightly different from SkCodecPriv's version of conversion_p ossible. It
86 // supports both byte orders for 8888. 86 // supports both byte orders for 8888.
87 static bool webp_conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) { 87 static bool webp_conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) {
88 if (dst.profileType() != src.profileType()) { 88 if (dst.profileType() != src.profileType()) {
89 return false; 89 return false;
90 } 90 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // Break out of the switch statement. Continue the loop. 246 // Break out of the switch statement. Continue the loop.
247 break; 247 break;
248 default: 248 default:
249 return kInvalidInput; 249 return kInvalidInput;
250 } 250 }
251 } 251 }
252 } 252 }
253 253
254 SkWebpCodec::SkWebpCodec(const SkImageInfo& info, SkStream* stream) 254 SkWebpCodec::SkWebpCodec(const SkImageInfo& info, SkStream* stream)
255 : INHERITED(info, stream) {} 255 : INHERITED(info, stream) {}
OLDNEW
« no previous file with comments | « src/codec/SkWbmpCodec.cpp ('k') | src/core/SkAdvancedTypefaceMetrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698