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

Side by Side Diff: experimental/webtry/main.cpp

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, 2 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
OLDNEW
1 #include <sys/time.h> 1 #include <sys/time.h>
2 #include <sys/resource.h> 2 #include <sys/resource.h>
3 3
4 #include "GrContextFactory.h" 4 #include "GrContextFactory.h"
5 5
6 #include "SkCanvas.h" 6 #include "SkCanvas.h"
7 #include "SkCommandLineFlags.h" 7 #include "SkCommandLineFlags.h"
8 #include "SkData.h" 8 #include "SkData.h"
9 #include "SkForceLinking.h"
10 #include "SkGraphics.h" 9 #include "SkGraphics.h"
11 #include "SkImageDecoder.h" 10 #include "SkImageDecoder.h"
12 #include "SkImageEncoder.h" 11 #include "SkImageEncoder.h"
13 #include "SkImageInfo.h" 12 #include "SkImageInfo.h"
14 #include "SkOSFile.h" 13 #include "SkOSFile.h"
15 #include "SkStream.h" 14 #include "SkStream.h"
16 #include "SkSurface.h" 15 #include "SkSurface.h"
17 16
18 #include "seccomp_bpf.h" 17 #include "seccomp_bpf.h"
19 18
20 __SK_FORCE_IMAGE_DECODER_LINKING;
21
22 DEFINE_string(out, "", "Filename of the PNG to write to."); 19 DEFINE_string(out, "", "Filename of the PNG to write to.");
23 DEFINE_string(source, "", "Filename of the source image."); 20 DEFINE_string(source, "", "Filename of the source image.");
24 DEFINE_int32(width, 256, "Width of output image."); 21 DEFINE_int32(width, 256, "Width of output image.");
25 DEFINE_int32(height, 256, "Height of output image."); 22 DEFINE_int32(height, 256, "Height of output image.");
26 DEFINE_bool(gpu, false, "Use GPU (Mesa) rendering."); 23 DEFINE_bool(gpu, false, "Use GPU (Mesa) rendering.");
27 24
28 // Defined in template.cpp. 25 // Defined in template.cpp.
29 extern SkBitmap source; 26 extern SkBitmap source;
30 27
31 static bool install_syscall_filter() { 28 static bool install_syscall_filter() {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // Write out the image as a PNG. 147 // Write out the image as a PNG.
151 SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); 148 SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
152 SkAutoTUnref<SkData> data(image->encode(SkImageEncoder::kPNG_Type, 100)); 149 SkAutoTUnref<SkData> data(image->encode(SkImageEncoder::kPNG_Type, 100));
153 if (NULL == data.get()) { 150 if (NULL == data.get()) {
154 printf("Failed to encode\n"); 151 printf("Failed to encode\n");
155 exit(1); 152 exit(1);
156 } 153 }
157 stream.write(data->data(), data->size()); 154 stream.write(data->data(), data->size());
158 delete grFactory; 155 delete grFactory;
159 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698