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

Side by Side Diff: dm/DM.cpp

Issue 1240143002: Add the ability to decode a subset to SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix some conversion warning/errors. Created 5 years, 5 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 | « no previous file | dm/DMSrcSink.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 2013 Google Inc. 2 * Copyright 2013 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 "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "DMJsonWriter.h" 9 #include "DMJsonWriter.h"
10 #include "DMSrcSink.h" 10 #include "DMSrcSink.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 // Decode all images to the canvas color type 251 // Decode all images to the canvas color type
252 push_src("image", "codec", new CodecSrc(path, CodecSrc::kNormal_Mode, 252 push_src("image", "codec", new CodecSrc(path, CodecSrc::kNormal_Mode,
253 CodecSrc::kGetFromCanvas_DstColorType, scale)); 253 CodecSrc::kGetFromCanvas_DstColorType, scale));
254 push_src("image", "scanline", new CodecSrc(path, CodecSrc::kScanline_Mod e, 254 push_src("image", "scanline", new CodecSrc(path, CodecSrc::kScanline_Mod e,
255 CodecSrc::kGetFromCanvas_DstColorType, scale)); 255 CodecSrc::kGetFromCanvas_DstColorType, scale));
256 push_src("image", "scanline_subset", new CodecSrc(path, CodecSrc::kScanl ine_Subset_Mode, 256 push_src("image", "scanline_subset", new CodecSrc(path, CodecSrc::kScanl ine_Subset_Mode,
257 CodecSrc::kGetFromCanvas_DstColorType, scale)); 257 CodecSrc::kGetFromCanvas_DstColorType, scale));
258 push_src("image", "stripe", new CodecSrc(path, CodecSrc::kStripe_Mode, 258 push_src("image", "stripe", new CodecSrc(path, CodecSrc::kStripe_Mode,
259 CodecSrc::kGetFromCanvas_DstColorType, scale)); 259 CodecSrc::kGetFromCanvas_DstColorType, scale));
260 // Note: The only codec which supports subsets natively is SkWebpCodec, which will never
261 // report kIndex_8 or kGray_8, so there is no need to test kSubset_mode with those color
262 // types specifically requested.
263 push_src("image", "codec_subset", new CodecSrc(path, CodecSrc::kSubset_M ode,
264 CodecSrc::kGetFromCanvas_DstColorType, scale));
260 } 265 }
261 } 266 }
262 267
263 static bool codec_supported(const char* ext) { 268 static bool codec_supported(const char* ext) {
264 // FIXME: Once other versions of SkCodec are available, we can add them to t his 269 // FIXME: Once other versions of SkCodec are available, we can add them to t his
265 // list (and eventually we can remove this check once they are all supported ). 270 // list (and eventually we can remove this check once they are all supported ).
266 static const char* const exts[] = { 271 static const char* const exts[] = {
267 "bmp", "gif", "jpg", "jpeg", "png", "ico", "wbmp", "webp", 272 "bmp", "gif", "jpg", "jpeg", "png", "ico", "wbmp", "webp",
268 "BMP", "GIF", "JPG", "JPEG", "PNG", "ICO", "WBMP", "WEBP", 273 "BMP", "GIF", "JPG", "JPEG", "PNG", "ICO", "WBMP", "WEBP",
269 }; 274 };
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 } 831 }
827 return 0; 832 return 0;
828 } 833 }
829 834
830 #if !defined(SK_BUILD_FOR_IOS) 835 #if !defined(SK_BUILD_FOR_IOS)
831 int main(int argc, char** argv) { 836 int main(int argc, char** argv) {
832 SkCommandLineFlags::Parse(argc, argv); 837 SkCommandLineFlags::Parse(argc, argv);
833 return dm_main(); 838 return dm_main();
834 } 839 }
835 #endif 840 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698