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

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

Issue 240773003: First pass at workspaces. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 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 | « experimental/webtry/js/run.js ('k') | experimental/webtry/templates/index.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkCanvas.h" 4 #include "SkCanvas.h"
5 #include "SkCommandLineFlags.h" 5 #include "SkCommandLineFlags.h"
6 #include "SkData.h" 6 #include "SkData.h"
7 #include "SkForceLinking.h" 7 #include "SkForceLinking.h"
8 #include "SkGraphics.h" 8 #include "SkGraphics.h"
9 #include "SkImageEncoder.h" 9 #include "SkImageEncoder.h"
10 #include "SkImageInfo.h" 10 #include "SkImageInfo.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 int main(int argc, char** argv) { 84 int main(int argc, char** argv) {
85 SkCommandLineFlags::Parse(argc, argv); 85 SkCommandLineFlags::Parse(argc, argv);
86 SkAutoGraphics init; 86 SkAutoGraphics init;
87 87
88 if (FLAGS_out.count() == 0) { 88 if (FLAGS_out.count() == 0) {
89 perror("The --out flag must have an argument."); 89 perror("The --out flag must have an argument.");
90 return 1; 90 return 1;
91 } 91 }
92 SkFILEWStream stream(FLAGS_out[0]); 92 SkFILEWStream stream(FLAGS_out[0]);
93 93
94 SkImageInfo info = SkImageInfo::MakeN32(300, 300, kPremul_SkAlphaType); 94 SkImageInfo info = SkImageInfo::MakeN32(256, 256, kPremul_SkAlphaType);
95 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info)); 95 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info));
96 SkCanvas* canvas = surface->getCanvas(); 96 SkCanvas* canvas = surface->getCanvas();
97 97
98 setLimits(); 98 setLimits();
99 99
100 if (!install_syscall_filter()) { 100 if (!install_syscall_filter()) {
101 return 1; 101 return 1;
102 } 102 }
103 103
104 draw(canvas); 104 draw(canvas);
105 105
106 // Write out the image as a PNG. 106 // Write out the image as a PNG.
107 SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); 107 SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
108 SkAutoTUnref<SkData> data(image->encode(SkImageEncoder::kPNG_Type, 100)); 108 SkAutoTUnref<SkData> data(image->encode(SkImageEncoder::kPNG_Type, 100));
109 if (NULL == data.get()) { 109 if (NULL == data.get()) {
110 printf("Failed to encode\n"); 110 printf("Failed to encode\n");
111 exit(1); 111 exit(1);
112 } 112 }
113 stream.write(data->data(), data->size()); 113 stream.write(data->data(), data->size());
114 } 114 }
OLDNEW
« no previous file with comments | « experimental/webtry/js/run.js ('k') | experimental/webtry/templates/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698