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

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

Issue 670453002: Remove image decoder and encoder autoregistration (Closed) Base URL: https://skia.googlesource.com/skia.git@separate-image-decoder-01-skpicture
Patch Set: Created 6 years, 1 month 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/images/SkForceLinking.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef SkImageEncoder_DEFINED 8 #ifndef SkImageEncoder_DEFINED
9 #define SkImageEncoder_DEFINED 9 #define SkImageEncoder_DEFINED
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 /** 69 /**
70 * Encode bitmap 'bm' in the desired format, writing results to 70 * Encode bitmap 'bm' in the desired format, writing results to
71 * stream 'stream', at quality level 'quality' (which can be in 71 * stream 'stream', at quality level 'quality' (which can be in
72 * range 0-100). 72 * range 0-100).
73 * 73 *
74 * This must be overridden by each SkImageEncoder implementation. 74 * This must be overridden by each SkImageEncoder implementation.
75 */ 75 */
76 virtual bool onEncode(SkWStream* stream, const SkBitmap& bm, int quality) = 0; 76 virtual bool onEncode(SkWStream* stream, const SkBitmap& bm, int quality) = 0;
77 }; 77 };
78 78
79 // This macro declares a global (i.e., non-class owned) creation entry point
80 // for each encoder (e.g., CreateJPEGImageEncoder)
81 #define DECLARE_ENCODER_CREATOR(codec) \
82 SkImageEncoder *Create ## codec ();
83
84 // This macro defines the global creation entry point for each encoder. Each
85 // encoder implementation that registers with the encoder factory must call it.
86 #define DEFINE_ENCODER_CREATOR(codec) \
87 SkImageEncoder *Create ## codec () { \
88 return SkNEW( Sk ## codec ); \
89 }
90
91 // All the encoders known by Skia. Note that, depending on the compiler settings ,
92 // not all of these will be available
93 /** An ARGBImageEncoder will always write out
94 * bitmap.width() * bitmap.height() * 4
95 * bytes.
96 */
97 DECLARE_ENCODER_CREATOR(ARGBImageEncoder);
98 DECLARE_ENCODER_CREATOR(JPEGImageEncoder);
99 DECLARE_ENCODER_CREATOR(PNGImageEncoder);
100 DECLARE_ENCODER_CREATOR(KTXImageEncoder);
101 DECLARE_ENCODER_CREATOR(WEBPImageEncoder);
102
103 #ifdef SK_BUILD_FOR_IOS
104 DECLARE_ENCODER_CREATOR(PNGImageEncoder_IOS);
105 #endif 79 #endif
106
107 // Typedef to make registering encoder callback easier
108 // This has to be defined outside SkImageEncoder. :(
109 typedef SkTRegistry<SkImageEncoder*(*)(SkImageEncoder::Type)> SkImageEncoder_Enc odeReg;
110 #endif
OLDNEW
« no previous file with comments | « include/core/SkImageDecoder.h ('k') | include/images/SkForceLinking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698