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

Side by Side Diff: include/core/SkImageEncoder.h

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 | « include/core/SkImageDecoder.h ('k') | include/core/SkLazyPtr.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 2011 Google Inc. 2 * Copyright 2011 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 #ifndef SkImageEncoder_DEFINED 8 #ifndef SkImageEncoder_DEFINED
9 #define SkImageEncoder_DEFINED 9 #define SkImageEncoder_DEFINED
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 virtual bool onEncode(SkWStream* stream, const SkBitmap& bm, int quality) = 0; 80 virtual bool onEncode(SkWStream* stream, const SkBitmap& bm, int quality) = 0;
81 }; 81 };
82 82
83 // This macro declares a global (i.e., non-class owned) creation entry point 83 // This macro declares a global (i.e., non-class owned) creation entry point
84 // for each encoder (e.g., CreateJPEGImageEncoder) 84 // for each encoder (e.g., CreateJPEGImageEncoder)
85 #define DECLARE_ENCODER_CREATOR(codec) \ 85 #define DECLARE_ENCODER_CREATOR(codec) \
86 SkImageEncoder *Create ## codec (); 86 SkImageEncoder *Create ## codec ();
87 87
88 // This macro defines the global creation entry point for each encoder. Each 88 // This macro defines the global creation entry point for each encoder. Each
89 // encoder implementation that registers with the encoder factory must call it. 89 // encoder implementation that registers with the encoder factory must call it.
90 #define DEFINE_ENCODER_CREATOR(codec) \ 90 #define DEFINE_ENCODER_CREATOR(codec) \
91 SkImageEncoder *Create ## codec () { \ 91 SkImageEncoder* Create##codec() { return new Sk##codec; }
92 return SkNEW( Sk ## codec ); \
93 }
94 92
95 // All the encoders known by Skia. Note that, depending on the compiler settings , 93 // All the encoders known by Skia. Note that, depending on the compiler settings ,
96 // not all of these will be available 94 // not all of these will be available
97 /** An ARGBImageEncoder will always write out 95 /** An ARGBImageEncoder will always write out
98 * bitmap.width() * bitmap.height() * 4 96 * bitmap.width() * bitmap.height() * 4
99 * bytes. 97 * bytes.
100 */ 98 */
101 DECLARE_ENCODER_CREATOR(ARGBImageEncoder); 99 DECLARE_ENCODER_CREATOR(ARGBImageEncoder);
102 DECLARE_ENCODER_CREATOR(JPEGImageEncoder); 100 DECLARE_ENCODER_CREATOR(JPEGImageEncoder);
103 DECLARE_ENCODER_CREATOR(PNGImageEncoder); 101 DECLARE_ENCODER_CREATOR(PNGImageEncoder);
104 DECLARE_ENCODER_CREATOR(KTXImageEncoder); 102 DECLARE_ENCODER_CREATOR(KTXImageEncoder);
105 DECLARE_ENCODER_CREATOR(WEBPImageEncoder); 103 DECLARE_ENCODER_CREATOR(WEBPImageEncoder);
106 104
107 #ifdef SK_BUILD_FOR_IOS 105 #ifdef SK_BUILD_FOR_IOS
108 DECLARE_ENCODER_CREATOR(PNGImageEncoder_IOS); 106 DECLARE_ENCODER_CREATOR(PNGImageEncoder_IOS);
109 #endif 107 #endif
110 108
111 // Typedef to make registering encoder callback easier 109 // Typedef to make registering encoder callback easier
112 // This has to be defined outside SkImageEncoder. :( 110 // This has to be defined outside SkImageEncoder. :(
113 typedef SkTRegistry<SkImageEncoder*(*)(SkImageEncoder::Type)> SkImageEncoder_Enc odeReg; 111 typedef SkTRegistry<SkImageEncoder*(*)(SkImageEncoder::Type)> SkImageEncoder_Enc odeReg;
114 #endif 112 #endif
OLDNEW
« no previous file with comments | « include/core/SkImageDecoder.h ('k') | include/core/SkLazyPtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698