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

Side by Side Diff: tools/skhello.cpp

Issue 15806010: Separate core and images project. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Change FORCE_LINKING to be more specific. Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « tools/render_pictures_main.cpp ('k') | tools/skimage_main.cpp » ('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 2011 Google Inc. 2 * Copyright 2011 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkCommandLineFlags.h" 9 #include "SkCommandLineFlags.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info)); 50 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info));
51 SkCanvas* canvas = surface->getCanvas(); 51 SkCanvas* canvas = surface->getCanvas();
52 52
53 canvas->drawColor(SK_ColorWHITE); 53 canvas->drawColor(SK_ColorWHITE);
54 canvas->drawText(text.c_str(), text.size(), 54 canvas->drawText(text.c_str(), text.size(),
55 SkIntToScalar(w)/2, SkIntToScalar(h)*2/3, 55 SkIntToScalar(w)/2, SkIntToScalar(h)*2/3,
56 paint); 56 paint);
57 57
58 SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); 58 SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
59 SkAutoDataUnref data(image->encode()); 59 SkAutoDataUnref data(image->encode());
60 if (NULL == data.get()) {
61 return -1;
62 }
60 SkFILEWStream stream(path.c_str()); 63 SkFILEWStream stream(path.c_str());
61 return stream.write(data->data(), data->size()); 64 return stream.write(data->data(), data->size());
62 } 65 }
63 66
64 #if !defined SK_BUILD_FOR_IOS 67 #if !defined SK_BUILD_FOR_IOS
65 int main(int argc, char * const argv[]) { 68 int main(int argc, char * const argv[]) {
66 return tool_main(argc, (char**) argv); 69 return tool_main(argc, (char**) argv);
67 } 70 }
68 #endif 71 #endif
OLDNEW
« no previous file with comments | « tools/render_pictures_main.cpp ('k') | tools/skimage_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698