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

Side by Side Diff: tools/get_images_from_skps.cpp

Issue 1782913002: Rename the kRAW_SkEncodedFormat to kDNG_SkEncodedFormat as it is actually only used for DNG for… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix code formatting Created 4 years, 9 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/SkRawCodec.h ('k') | no next file » | 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 2016 Google Inc. 2 * Copyright 2016 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 "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkCommandLineFlags.h" 9 #include "SkCommandLineFlags.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 gUnknown++; 43 gUnknown++;
44 return; 44 return;
45 } 45 }
46 SkString ext; 46 SkString ext;
47 switch (codec->getEncodedFormat()) { 47 switch (codec->getEncodedFormat()) {
48 case SkEncodedFormat::kBMP_SkEncodedFormat: ext = "bmp"; break; 48 case SkEncodedFormat::kBMP_SkEncodedFormat: ext = "bmp"; break;
49 case SkEncodedFormat::kGIF_SkEncodedFormat: ext = "gif"; break; 49 case SkEncodedFormat::kGIF_SkEncodedFormat: ext = "gif"; break;
50 case SkEncodedFormat::kICO_SkEncodedFormat: ext = "ico"; break; 50 case SkEncodedFormat::kICO_SkEncodedFormat: ext = "ico"; break;
51 case SkEncodedFormat::kJPEG_SkEncodedFormat: ext = "jpg"; break; 51 case SkEncodedFormat::kJPEG_SkEncodedFormat: ext = "jpg"; break;
52 case SkEncodedFormat::kPNG_SkEncodedFormat: ext = "png"; break; 52 case SkEncodedFormat::kPNG_SkEncodedFormat: ext = "png"; break;
53 case SkEncodedFormat::kRAW_SkEncodedFormat: ext = "dng"; break; 53 case SkEncodedFormat::kDNG_SkEncodedFormat: ext = "dng"; break;
54 case SkEncodedFormat::kWBMP_SkEncodedFormat: ext = "wbmp"; break; 54 case SkEncodedFormat::kWBMP_SkEncodedFormat: ext = "wbmp"; break;
55 case SkEncodedFormat::kWEBP_SkEncodedFormat: ext = "webp"; break; 55 case SkEncodedFormat::kWEBP_SkEncodedFormat: ext = "webp"; break;
56 default: gUnknown++; return; 56 default: gUnknown++; return;
57 } 57 }
58 58
59 SkString path; 59 SkString path;
60 path.appendf("%s/%d.%s", gOutputDir, gKnown++, ext.c_str()); 60 path.appendf("%s/%d.%s", gOutputDir, gKnown++, ext.c_str());
61 61
62 SkFILEWStream file(path.c_str()); 62 SkFILEWStream file(path.c_str());
63 file.write(ptr, len); 63 file.write(ptr, len);
(...skipping 29 matching lines...) Expand all
93 SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(stream)); 93 SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(stream));
94 94
95 SkDynamicMemoryWStream scratch; 95 SkDynamicMemoryWStream scratch;
96 Sniffer sniff; 96 Sniffer sniff;
97 picture->serialize(&scratch, &sniff); 97 picture->serialize(&scratch, &sniff);
98 } 98 }
99 SkDebugf("%d known, %d unknown\n", gKnown, gUnknown); 99 SkDebugf("%d known, %d unknown\n", gKnown, gUnknown);
100 100
101 return 0; 101 return 0;
102 } 102 }
OLDNEW
« no previous file with comments | « src/codec/SkRawCodec.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698