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

Unified Diff: src/core/SkRecorder.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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRecorder.h ('k') | src/core/SkRefDict.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecorder.cpp
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp
index 0fe9e28848f00389c9015855da018b6d96a0fc7e..9eccca164f4ceb2ae4bd3092449db504f3cf8bb0 100644
--- a/src/core/SkRecorder.cpp
+++ b/src/core/SkRecorder.cpp
@@ -21,7 +21,7 @@ SkDrawableList::~SkDrawableList() {
SkBigPicture::SnapshotArray* SkDrawableList::newDrawableSnapshot() {
const int count = fArray.count();
if (0 == count) {
- return NULL;
+ return nullptr;
}
SkAutoTMalloc<const SkPicture*> pics(count);
for (int i = 0; i < count; ++i) {
@@ -60,9 +60,9 @@ void SkRecorder::reset(SkRecord* record, const SkRect& bounds,
}
void SkRecorder::forgetRecord() {
- fDrawableList.reset(NULL);
+ fDrawableList.reset(nullptr);
fApproxBytesUsedBySubPictures = 0;
- fRecord = NULL;
+ fRecord = nullptr;
}
// To make appending to fRecord a little less verbose.
@@ -82,8 +82,8 @@ void SkRecorder::forgetRecord() {
// (For most types we just pass by value and let copy constructors do their thing.)
template <typename T>
T* SkRecorder::copy(const T* src) {
- if (NULL == src) {
- return NULL;
+ if (nullptr == src) {
+ return nullptr;
}
return new (fRecord->alloc<T>()) T(*src);
}
@@ -92,8 +92,8 @@ T* SkRecorder::copy(const T* src) {
// It will work with POD or non-POD, though currently we only use it for POD.
template <typename T>
T* SkRecorder::copy(const T src[], size_t count) {
- if (NULL == src) {
- return NULL;
+ if (nullptr == src) {
+ return nullptr;
}
T* dst = fRecord->alloc<T>(count);
for (size_t i = 0; i < count; i++) {
@@ -107,8 +107,8 @@ T* SkRecorder::copy(const T src[], size_t count) {
// but I found no corresponding speedup for other arrays.
template <>
char* SkRecorder::copy(const char src[], size_t count) {
- if (NULL == src) {
- return NULL;
+ if (nullptr == src) {
+ return nullptr;
}
char* dst = fRecord->alloc<char>(count);
memcpy(dst, src, count);
@@ -302,8 +302,8 @@ void SkRecorder::onDrawVertices(VertexMode vmode,
vmode,
vertexCount,
this->copy(vertices, vertexCount),
- texs ? this->copy(texs, vertexCount) : NULL,
- colors ? this->copy(colors, vertexCount) : NULL,
+ texs ? this->copy(texs, vertexCount) : nullptr,
+ colors ? this->copy(colors, vertexCount) : nullptr,
xmode,
this->copy(indices, indexCount),
indexCount);
@@ -312,9 +312,9 @@ void SkRecorder::onDrawVertices(VertexMode vmode,
void SkRecorder::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) {
APPEND(DrawPatch, paint,
- cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : NULL,
- colors ? this->copy(colors, SkPatchUtils::kNumCorners) : NULL,
- texCoords ? this->copy(texCoords, SkPatchUtils::kNumCorners) : NULL,
+ cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : nullptr,
+ colors ? this->copy(colors, SkPatchUtils::kNumCorners) : nullptr,
+ texCoords ? this->copy(texCoords, SkPatchUtils::kNumCorners) : nullptr,
xmode);
}
« no previous file with comments | « src/core/SkRecorder.h ('k') | src/core/SkRefDict.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698