aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-08-27 07:41:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-27 07:41:16 -0700
commit96fcdcc219d2a0d3579719b84b28bede76efba64 (patch)
tree0ec5ea0193d8292df8bf5ed9dd8498a5eb5763dd /src/doc
parent435af2f736c85c3274a0c6760a3523810750d237 (diff)
Style Change: NULL->nullptr
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/SkDocument.cpp16
-rw-r--r--src/doc/SkDocument_PDF.cpp6
-rw-r--r--src/doc/SkDocument_PDF_None.cpp4
-rw-r--r--src/doc/SkDocument_XPS.cpp6
-rw-r--r--src/doc/SkDocument_XPS_None.cpp10
5 files changed, 24 insertions, 18 deletions
diff --git a/src/doc/SkDocument.cpp b/src/doc/SkDocument.cpp
index 5b2237d18a..fa25e44f86 100644
--- a/src/doc/SkDocument.cpp
+++ b/src/doc/SkDocument.cpp
@@ -21,7 +21,7 @@ SkDocument::~SkDocument() {
SkCanvas* SkDocument::beginPage(SkScalar width, SkScalar height,
const SkRect* content) {
if (width <= 0 || height <= 0) {
- return NULL;
+ return nullptr;
}
SkRect outer = SkRect::MakeWH(width, height);
@@ -29,7 +29,7 @@ SkCanvas* SkDocument::beginPage(SkScalar width, SkScalar height,
if (content) {
inner = *content;
if (!inner.intersect(outer)) {
- return NULL;
+ return nullptr;
}
} else {
inner = outer;
@@ -44,11 +44,11 @@ SkCanvas* SkDocument::beginPage(SkScalar width, SkScalar height,
this->endPage();
break;
case kClosed_State:
- return NULL;
+ return nullptr;
}
}
SkDEBUGFAIL("never get here");
- return NULL;
+ return nullptr;
}
void SkDocument::endPage() {
@@ -68,9 +68,9 @@ bool SkDocument::close() {
if (fDoneProc) {
fDoneProc(fStream, false);
}
- // we don't own the stream, but we mark it NULL since we can
+ // we don't own the stream, but we mark it nullptr since we can
// no longer write to it.
- fStream = NULL;
+ fStream = nullptr;
return success;
}
case kInPage_State:
@@ -89,7 +89,7 @@ void SkDocument::abort() {
if (fDoneProc) {
fDoneProc(fStream, true);
}
- // we don't own the stream, but we mark it NULL since we can
+ // we don't own the stream, but we mark it nullptr since we can
// no longer write to it.
- fStream = NULL;
+ fStream = nullptr;
}
diff --git a/src/doc/SkDocument_PDF.cpp b/src/doc/SkDocument_PDF.cpp
index 1741239bcc..6c47379951 100644
--- a/src/doc/SkDocument_PDF.cpp
+++ b/src/doc/SkDocument_PDF.cpp
@@ -318,7 +318,7 @@ protected:
void onEndPage() override {
SkASSERT(fCanvas.get());
fCanvas->flush();
- fCanvas.reset(NULL);
+ fCanvas.reset(nullptr);
}
bool onClose(SkWStream* stream) override {
@@ -345,14 +345,14 @@ private:
///////////////////////////////////////////////////////////////////////////////
SkDocument* SkDocument::CreatePDF(SkWStream* stream, SkScalar dpi) {
- return stream ? new SkDocument_PDF(stream, NULL, dpi) : NULL;
+ return stream ? new SkDocument_PDF(stream, nullptr, dpi) : nullptr;
}
SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) {
SkFILEWStream* stream = new SkFILEWStream(path);
if (!stream->isValid()) {
delete stream;
- return NULL;
+ return nullptr;
}
auto delete_wstream = [](SkWStream* stream, bool) { delete stream; };
return new SkDocument_PDF(stream, delete_wstream, dpi);
diff --git a/src/doc/SkDocument_PDF_None.cpp b/src/doc/SkDocument_PDF_None.cpp
index 4759acf2a0..f146cba018 100644
--- a/src/doc/SkDocument_PDF_None.cpp
+++ b/src/doc/SkDocument_PDF_None.cpp
@@ -5,5 +5,5 @@
* found in the LICENSE file.
*/
#include "SkDocument.h"
-SkDocument* SkDocument::CreatePDF(SkWStream*, SkScalar) { return NULL; }
-SkDocument* SkDocument::CreatePDF(const char path[], SkScalar) { return NULL; }
+SkDocument* SkDocument::CreatePDF(SkWStream*, SkScalar) { return nullptr; }
+SkDocument* SkDocument::CreatePDF(const char path[], SkScalar) { return nullptr; }
diff --git a/src/doc/SkDocument_XPS.cpp b/src/doc/SkDocument_XPS.cpp
index 943d0a882a..57fa0b80c6 100644
--- a/src/doc/SkDocument_XPS.cpp
+++ b/src/doc/SkDocument_XPS.cpp
@@ -42,7 +42,7 @@ protected:
void onEndPage() override {
SkASSERT(fCanvas.get());
fCanvas->flush();
- fCanvas.reset(NULL);
+ fCanvas.reset(nullptr);
fDevice.endSheet();
}
@@ -63,7 +63,7 @@ private:
///////////////////////////////////////////////////////////////////////////////
SkDocument* SkDocument::CreateXPS(SkWStream* stream, SkScalar dpi) {
- return stream ? new SkDocument_XPS(stream, NULL, dpi) : NULL;
+ return stream ? new SkDocument_XPS(stream, nullptr, dpi) : nullptr;
}
static void delete_wstream(SkWStream* stream, bool aborted) { delete stream; }
@@ -71,7 +71,7 @@ static void delete_wstream(SkWStream* stream, bool aborted) { delete stream; }
SkDocument* SkDocument::CreateXPS(const char path[], SkScalar dpi) {
SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(path));
if (!stream->isValid()) {
- return NULL;
+ return nullptr;
}
return new SkDocument_XPS(stream.detach(), delete_wstream, dpi);
}
diff --git a/src/doc/SkDocument_XPS_None.cpp b/src/doc/SkDocument_XPS_None.cpp
index 01055e5cf0..9d51ea25d7 100644
--- a/src/doc/SkDocument_XPS_None.cpp
+++ b/src/doc/SkDocument_XPS_None.cpp
@@ -1,3 +1,9 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
#include "SkDocument.h"
-SkDocument* SkDocument::CreateXPS(SkWStream*, SkScalar) { return NULL; }
-SkDocument* SkDocument::CreateXPS(const char path[], SkScalar) { return NULL; }
+SkDocument* SkDocument::CreateXPS(SkWStream*, SkScalar) { return nullptr; }
+SkDocument* SkDocument::CreateXPS(const char path[], SkScalar) { return nullptr; }