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

Side by Side Diff: tools/skhello.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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 | « tools/skdiff_utils.cpp ('k') | tools/skpdiff/SkCLImageDiffer.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 21 matching lines...) Expand all
32 } 32 }
33 33
34 static bool do_surface(int w, int h, const char path[], const char text[], 34 static bool do_surface(int w, int h, const char path[], const char text[],
35 const SkPaint& paint) { 35 const SkPaint& paint) {
36 SkSurfaceProps props(0, kUnknown_SkPixelGeometry); 36 SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
37 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(w, h, &props)) ; 37 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(w, h, &props)) ;
38 doDraw(surface->getCanvas(), paint, text); 38 doDraw(surface->getCanvas(), paint, text);
39 39
40 SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); 40 SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
41 SkAutoDataUnref data(image->encode()); 41 SkAutoDataUnref data(image->encode());
42 if (NULL == data.get()) { 42 if (nullptr == data.get()) {
43 return false; 43 return false;
44 } 44 }
45 SkFILEWStream stream(path); 45 SkFILEWStream stream(path);
46 return stream.write(data->data(), data->size()); 46 return stream.write(data->data(), data->size());
47 } 47 }
48 48
49 static bool do_document(int w, int h, const char path[], const char text[], 49 static bool do_document(int w, int h, const char path[], const char text[],
50 const SkPaint& paint) { 50 const SkPaint& paint) {
51 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(path)); 51 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(path));
52 if (doc.get()) { 52 if (doc.get()) {
53 SkScalar width = SkIntToScalar(w); 53 SkScalar width = SkIntToScalar(w);
54 SkScalar height = SkIntToScalar(h); 54 SkScalar height = SkIntToScalar(h);
55 doDraw(doc->beginPage(width, height, NULL), paint, text); 55 doDraw(doc->beginPage(width, height, nullptr), paint, text);
56 return true; 56 return true;
57 } 57 }
58 return false; 58 return false;
59 } 59 }
60 60
61 int tool_main(int argc, char** argv); 61 int tool_main(int argc, char** argv);
62 int tool_main(int argc, char** argv) { 62 int tool_main(int argc, char** argv) {
63 SkCommandLineFlags::SetUsage(""); 63 SkCommandLineFlags::SetUsage("");
64 SkCommandLineFlags::Parse(argc, argv); 64 SkCommandLineFlags::Parse(argc, argv);
65 65
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 } 103 }
104 return 0; 104 return 0;
105 } 105 }
106 106
107 #if !defined SK_BUILD_FOR_IOS 107 #if !defined SK_BUILD_FOR_IOS
108 int main(int argc, char * const argv[]) { 108 int main(int argc, char * const argv[]) {
109 return tool_main(argc, (char**) argv); 109 return tool_main(argc, (char**) argv);
110 } 110 }
111 #endif 111 #endif
OLDNEW
« no previous file with comments | « tools/skdiff_utils.cpp ('k') | tools/skpdiff/SkCLImageDiffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698