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

Side by Side Diff: src/images/SkImageDecoder_libwebp.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/images/SkImageDecoder_libpng.cpp ('k') | src/images/SkImageDecoder_pkm.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 2010, The Android Open Source Project 2 * Copyright 2010, The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at 6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.0 8 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 DEFINE_ENCODER_CREATOR(WEBPImageEncoder); 650 DEFINE_ENCODER_CREATOR(WEBPImageEncoder);
651 /////////////////////////////////////////////////////////////////////////////// 651 ///////////////////////////////////////////////////////////////////////////////
652 652
653 static SkImageDecoder* sk_libwebp_dfactory(SkStreamRewindable* stream) { 653 static SkImageDecoder* sk_libwebp_dfactory(SkStreamRewindable* stream) {
654 int width, height, hasAlpha; 654 int width, height, hasAlpha;
655 if (!webp_parse_header(stream, &width, &height, &hasAlpha)) { 655 if (!webp_parse_header(stream, &width, &height, &hasAlpha)) {
656 return NULL; 656 return NULL;
657 } 657 }
658 658
659 // Magic matches, call decoder 659 // Magic matches, call decoder
660 return SkNEW(SkWEBPImageDecoder); 660 return new SkWEBPImageDecoder;
661 } 661 }
662 662
663 static SkImageDecoder::Format get_format_webp(SkStreamRewindable* stream) { 663 static SkImageDecoder::Format get_format_webp(SkStreamRewindable* stream) {
664 int width, height, hasAlpha; 664 int width, height, hasAlpha;
665 if (webp_parse_header(stream, &width, &height, &hasAlpha)) { 665 if (webp_parse_header(stream, &width, &height, &hasAlpha)) {
666 return SkImageDecoder::kWEBP_Format; 666 return SkImageDecoder::kWEBP_Format;
667 } 667 }
668 return SkImageDecoder::kUnknown_Format; 668 return SkImageDecoder::kUnknown_Format;
669 } 669 }
670 670
671 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) { 671 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) {
672 return (SkImageEncoder::kWEBP_Type == t) ? SkNEW(SkWEBPImageEncoder) : NUL L; 672 return (SkImageEncoder::kWEBP_Type == t) ? new SkWEBPImageEncoder : NULL;
673 } 673 }
674 674
675 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory); 675 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory);
676 static SkImageDecoder_FormatReg gFormatReg(get_format_webp); 676 static SkImageDecoder_FormatReg gFormatReg(get_format_webp);
677 static SkImageEncoder_EncodeReg gEReg(sk_libwebp_efactory); 677 static SkImageEncoder_EncodeReg gEReg(sk_libwebp_efactory);
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder_libpng.cpp ('k') | src/images/SkImageDecoder_pkm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698