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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 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/codec/SkSwizzler.cpp ('k') | src/core/SkBBHFactory.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 "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 SkNEW_ARGS(SkWebpCodec, (info, streamDeleter.detach())); 80 return new SkWebpCodec(info, streamDeleter.detach());
81 } 81 }
82 return NULL; 82 return NULL;
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // Break out of the switch statement. Continue the loop. 244 // Break out of the switch statement. Continue the loop.
245 break; 245 break;
246 default: 246 default:
247 return kInvalidInput; 247 return kInvalidInput;
248 } 248 }
249 } 249 }
250 } 250 }
251 251
252 SkWebpCodec::SkWebpCodec(const SkImageInfo& info, SkStream* stream) 252 SkWebpCodec::SkWebpCodec(const SkImageInfo& info, SkStream* stream)
253 : INHERITED(info, stream) {} 253 : INHERITED(info, stream) {}
OLDNEW
« no previous file with comments | « src/codec/SkSwizzler.cpp ('k') | src/core/SkBBHFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698