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

Side by Side Diff: src/doc/SkDocument_XPS.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 | « src/doc/SkDocument_PDF_None.cpp ('k') | src/doc/SkDocument_XPS_None.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 2015 Google Inc. 2 * Copyright 2015 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 "SkDocument.h" 8 #include "SkDocument.h"
9 #include "SkXPSDevice.h" 9 #include "SkXPSDevice.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 24 matching lines...) Expand all
35 SkSize::Make(width, height)); 35 SkSize::Make(width, height));
36 fCanvas.reset(new SkCanvas(&fDevice)); 36 fCanvas.reset(new SkCanvas(&fDevice));
37 fCanvas->clipRect(trimBox); 37 fCanvas->clipRect(trimBox);
38 fCanvas->translate(trimBox.x(), trimBox.y()); 38 fCanvas->translate(trimBox.x(), trimBox.y());
39 return fCanvas.get(); 39 return fCanvas.get();
40 } 40 }
41 41
42 void onEndPage() override { 42 void onEndPage() override {
43 SkASSERT(fCanvas.get()); 43 SkASSERT(fCanvas.get());
44 fCanvas->flush(); 44 fCanvas->flush();
45 fCanvas.reset(NULL); 45 fCanvas.reset(nullptr);
46 fDevice.endSheet(); 46 fDevice.endSheet();
47 } 47 }
48 48
49 bool onClose(SkWStream*) override { 49 bool onClose(SkWStream*) override {
50 SkASSERT(!fCanvas.get()); 50 SkASSERT(!fCanvas.get());
51 return fDevice.endPortfolio(); 51 return fDevice.endPortfolio();
52 } 52 }
53 53
54 void onAbort() override {} 54 void onAbort() override {}
55 55
56 private: 56 private:
57 SkXPSDevice fDevice; 57 SkXPSDevice fDevice;
58 SkAutoTUnref<SkCanvas> fCanvas; 58 SkAutoTUnref<SkCanvas> fCanvas;
59 SkVector fUnitsPerMeter; 59 SkVector fUnitsPerMeter;
60 SkVector fPixelsPerMeter; 60 SkVector fPixelsPerMeter;
61 }; 61 };
62 62
63 /////////////////////////////////////////////////////////////////////////////// 63 ///////////////////////////////////////////////////////////////////////////////
64 64
65 SkDocument* SkDocument::CreateXPS(SkWStream* stream, SkScalar dpi) { 65 SkDocument* SkDocument::CreateXPS(SkWStream* stream, SkScalar dpi) {
66 return stream ? new SkDocument_XPS(stream, NULL, dpi) : NULL; 66 return stream ? new SkDocument_XPS(stream, nullptr, dpi) : nullptr;
67 } 67 }
68 68
69 static void delete_wstream(SkWStream* stream, bool aborted) { delete stream; } 69 static void delete_wstream(SkWStream* stream, bool aborted) { delete stream; }
70 70
71 SkDocument* SkDocument::CreateXPS(const char path[], SkScalar dpi) { 71 SkDocument* SkDocument::CreateXPS(const char path[], SkScalar dpi) {
72 SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(path)); 72 SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(path));
73 if (!stream->isValid()) { 73 if (!stream->isValid()) {
74 return NULL; 74 return nullptr;
75 } 75 }
76 return new SkDocument_XPS(stream.detach(), delete_wstream, dpi); 76 return new SkDocument_XPS(stream.detach(), delete_wstream, dpi);
77 } 77 }
OLDNEW
« no previous file with comments | « src/doc/SkDocument_PDF_None.cpp ('k') | src/doc/SkDocument_XPS_None.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698