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

Unified Diff: src/pipe/SkGPipeRead.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/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pipe/SkGPipeRead.cpp
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index 97cae90034814a8fef1d16d6abf4ce318302b4f2..4d57a6cca9db0896249b825ff03af0bb70f2418f 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -118,7 +118,7 @@ public:
SkFlattenable* getFlat(unsigned index) const {
if (0 == index) {
- return NULL;
+ return nullptr;
}
return fFlatArray[index - 1];
}
@@ -174,7 +174,7 @@ public:
void releaseRef(int32_t) override {}
void setSharedHeap(SkBitmapHeap* heap) {
- SkASSERT(!shouldFlattenBitmaps(fFlags) || NULL == heap);
+ SkASSERT(!shouldFlattenBitmaps(fFlags) || nullptr == heap);
SkRefCnt_SafeAssign(fSharedHeap, heap);
this->updateReader();
}
@@ -200,7 +200,7 @@ public:
}
SkTypeface* getTypeface(unsigned id) const {
- return id ? fTypefaces[id - 1] : NULL;
+ return id ? fTypefaces[id - 1] : nullptr;
}
const SkImage* getImage(int32_t slot) const {
@@ -209,7 +209,7 @@ public:
private:
void updateReader() {
- if (NULL == fReader) {
+ if (nullptr == fReader) {
return;
}
bool crossProcess = SkToBool(fFlags & SkGPipeWriter::kCrossProcess_Flag);
@@ -218,7 +218,7 @@ private:
if (crossProcess) {
fReader->setFactoryArray(&fFactoryArray);
} else {
- fReader->setFactoryArray(NULL);
+ fReader->setFactoryArray(nullptr);
}
if (shouldFlattenBitmaps(fFlags)) {
@@ -337,11 +337,11 @@ static void saveLayer_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
unsigned flags = DrawOp_unpackFlags(op32);
SkCanvas::SaveFlags saveFlags = (SkCanvas::SaveFlags)DrawOp_unpackData(op32);
- const SkRect* bounds = NULL;
+ const SkRect* bounds = nullptr;
if (flags & kSaveLayer_HasBounds_DrawOpFlag) {
bounds = skip<SkRect>(reader);
}
- const SkPaint* paint = NULL;
+ const SkPaint* paint = nullptr;
if (flags & kSaveLayer_HasPaint_DrawOpFlag) {
paint = &state->paint();
}
@@ -414,11 +414,11 @@ static void drawPatch_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
const SkPoint* cubics = skip<SkPoint>(reader, SkPatchUtils::kNumCtrlPts);
- const SkColor* colors = NULL;
+ const SkColor* colors = nullptr;
if (flags & kDrawVertices_HasColors_DrawOpFlag) {
colors = skip<SkColor>(reader, SkPatchUtils::kNumCorners);
}
- const SkPoint* texCoords = NULL;
+ const SkPoint* texCoords = nullptr;
if (flags & kDrawVertices_HasTexs_DrawOpFlag) {
texCoords = skip<SkPoint>(reader, SkPatchUtils::kNumCorners);
}
@@ -452,12 +452,12 @@ static void drawVertices_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
int vertexCount = reader->readU32();
const SkPoint* verts = skip<SkPoint>(reader, vertexCount);
- const SkPoint* texs = NULL;
+ const SkPoint* texs = nullptr;
if (flags & kDrawVertices_HasTexs_DrawOpFlag) {
texs = skip<SkPoint>(reader, vertexCount);
}
- const SkColor* colors = NULL;
+ const SkColor* colors = nullptr;
if (flags & kDrawVertices_HasColors_DrawOpFlag) {
colors = skip<SkColor>(reader, vertexCount);
}
@@ -469,7 +469,7 @@ static void drawVertices_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
}
int indexCount = 0;
- const uint16_t* indices = NULL;
+ const uint16_t* indices = nullptr;
if (flags & kDrawVertices_HasIndices_DrawOpFlag) {
indexCount = reader->readU32();
indices = skipAlign<uint16_t>(reader, indexCount);
@@ -483,7 +483,7 @@ static void drawVertices_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
static void drawAtlas_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, SkGPipeState* state) {
unsigned flags = DrawOp_unpackFlags(op32);
- const SkPaint* paint = NULL;
+ const SkPaint* paint = nullptr;
if (flags & kDrawAtlas_HasPaint_DrawOpFlag) {
paint = &state->paint();
}
@@ -493,11 +493,11 @@ static void drawAtlas_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, Sk
SkXfermode::Mode mode = (SkXfermode::Mode)reader->readU32();
const SkRSXform* xform = skip<SkRSXform>(reader, count);
const SkRect* tex = skip<SkRect>(reader, count);
- const SkColor* colors = NULL;
+ const SkColor* colors = nullptr;
if (flags & kDrawAtlas_HasColors_DrawOpFlag) {
colors = skip<SkColor>(reader, count);
}
- const SkRect* cull = NULL;
+ const SkRect* cull = nullptr;
if (flags & kDrawAtlas_HasCull_DrawOpFlag) {
cull = skip<SkRect>(reader, 1);
}
@@ -551,7 +551,7 @@ static void drawTextOnPath_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op3
reader->readPath(&path);
SkMatrix matrixStorage;
- const SkMatrix* matrix = NULL;
+ const SkMatrix* matrix = nullptr;
if (DrawOp_unpackFlags(op32) & kDrawTextOnPath_HasMatrix_DrawOpFlag) {
reader->readMatrix(&matrixStorage);
matrix = &matrixStorage;
@@ -567,7 +567,7 @@ class BitmapHolder : SkNoncopyable {
public:
BitmapHolder(SkReader32* reader, uint32_t op32, SkGPipeState* state);
~BitmapHolder() {
- if (fHeapEntry != NULL) {
+ if (fHeapEntry != nullptr) {
fHeapEntry->releaseRef();
}
}
@@ -585,7 +585,7 @@ BitmapHolder::BitmapHolder(SkReader32* reader, uint32_t op32,
const unsigned flags = state->getFlags();
const unsigned index = DrawOp_unpackData(op32);
if (shouldFlattenBitmaps(flags)) {
- fHeapEntry = NULL;
+ fHeapEntry = nullptr;
fBitmap = state->getBitmap(index);
} else {
SkBitmapHeapEntry* entry = state->getSharedHeap()->getEntry(index);
@@ -596,7 +596,7 @@ BitmapHolder::BitmapHolder(SkReader32* reader, uint32_t op32,
fBitmap = &fBitmapStorage;
// Release the ref on the bitmap now, since we made our own copy.
entry->releaseRef();
- fHeapEntry = NULL;
+ fHeapEntry = nullptr;
} else {
SkASSERT(!shouldFlattenBitmaps(flags));
SkASSERT(!SkToBool(flags & SkGPipeWriter::kSimultaneousReaders_Flag));
@@ -614,7 +614,7 @@ static void drawBitmap_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
SkScalar top = reader->readScalar();
const SkBitmap* bitmap = holder.getBitmap();
if (state->shouldDraw()) {
- canvas->drawBitmap(*bitmap, left, top, hasPaint ? &state->paint() : NULL);
+ canvas->drawBitmap(*bitmap, left, top, hasPaint ? &state->paint() : nullptr);
}
}
@@ -627,7 +627,7 @@ static void drawBitmapNine_rp(SkCanvas* canvas, SkReader32* reader,
const SkBitmap* bitmap = holder.getBitmap();
if (state->shouldDraw()) {
canvas->drawBitmapNine(*bitmap, *center, *dst,
- hasPaint ? &state->paint() : NULL);
+ hasPaint ? &state->paint() : nullptr);
}
}
@@ -641,7 +641,7 @@ static void drawBitmapRect_rp(SkCanvas* canvas, SkReader32* reader,
if (hasSrc) {
src = skip<SkRect>(reader);
} else {
- src = NULL;
+ src = nullptr;
}
SkCanvas::SrcRectConstraint constraint = SkCanvas::kStrict_SrcRectConstraint;
if (flags & kDrawBitmap_Bleed_DrawOpFlag) {
@@ -650,7 +650,7 @@ static void drawBitmapRect_rp(SkCanvas* canvas, SkReader32* reader,
const SkRect* dst = skip<SkRect>(reader);
const SkBitmap* bitmap = holder.getBitmap();
if (state->shouldDraw()) {
- canvas->legacy_drawBitmapRect(*bitmap, src, *dst, hasPaint ? &state->paint() : NULL, constraint);
+ canvas->legacy_drawBitmapRect(*bitmap, src, *dst, hasPaint ? &state->paint() : nullptr, constraint);
}
}
@@ -661,7 +661,7 @@ static void drawSprite_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
const SkIPoint* point = skip<SkIPoint>(reader);
const SkBitmap* bitmap = holder.getBitmap();
if (state->shouldDraw()) {
- canvas->drawSprite(*bitmap, point->fX, point->fY, hasPaint ? &state->paint() : NULL);
+ canvas->drawSprite(*bitmap, point->fX, point->fY, hasPaint ? &state->paint() : nullptr);
}
}
@@ -673,7 +673,7 @@ static void drawImage_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, Sk
SkScalar y = reader->readScalar();
const SkImage* image = state->getImage(slot);
if (state->shouldDraw()) {
- canvas->drawImage(image, x, y, hasPaint ? &state->paint() : NULL);
+ canvas->drawImage(image, x, y, hasPaint ? &state->paint() : nullptr);
}
}
@@ -683,7 +683,7 @@ static void drawImageRect_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32
unsigned flags = DrawOp_unpackFlags(op32);
bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag);
bool hasSrc = SkToBool(flags & kDrawBitmap_HasSrcRect_DrawOpFlag);
- const SkRect* src = NULL;
+ const SkRect* src = nullptr;
if (hasSrc) {
src = skip<SkRect>(reader);
}
@@ -692,7 +692,7 @@ static void drawImageRect_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32
const SkImage* image = state->getImage(slot);
if (state->shouldDraw()) {
- canvas->legacy_drawImageRect(image, src, *dst, hasPaint ? &state->paint() : NULL, constraint);
+ canvas->legacy_drawImageRect(image, src, *dst, hasPaint ? &state->paint() : nullptr, constraint);
}
}
@@ -705,7 +705,7 @@ static void drawImageNine_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32
const SkRect* dst = skip<SkRect>(reader);
const SkImage* image = state->getImage(slot);
if (state->shouldDraw()) {
- canvas->drawImageNine(image, *center, *dst, hasPaint ? &state->paint() : NULL);
+ canvas->drawImageNine(image, *center, *dst, hasPaint ? &state->paint() : nullptr);
}
}
@@ -812,7 +812,7 @@ static void annotation_rp(SkCanvas*, SkReader32* reader, uint32_t op32,
p->setAnnotation(SkAnnotation::Create(buffer))->unref();
SkASSERT(buffer.offset() == size);
} else {
- p->setAnnotation(NULL);
+ p->setAnnotation(nullptr);
}
}
@@ -925,7 +925,7 @@ static const ReadProc gReadTable[] = {
SkGPipeState::SkGPipeState()
: fReader(0)
, fSilent(false)
- , fSharedHeap(NULL)
+ , fSharedHeap(nullptr)
, fFlags(0) {
}
@@ -942,16 +942,16 @@ SkGPipeState::~SkGPipeState() {
#include "SkGPipe.h"
SkGPipeReader::SkGPipeReader() {
- fCanvas = NULL;
- fState = NULL;
- fProc = NULL;
+ fCanvas = nullptr;
+ fState = nullptr;
+ fProc = nullptr;
}
SkGPipeReader::SkGPipeReader(SkCanvas* target) {
- fCanvas = NULL;
+ fCanvas = nullptr;
this->setCanvas(target);
- fState = NULL;
- fProc = NULL;
+ fState = nullptr;
+ fProc = nullptr;
}
void SkGPipeReader::setCanvas(SkCanvas *target) {
@@ -965,11 +965,11 @@ SkGPipeReader::~SkGPipeReader() {
SkGPipeReader::Status SkGPipeReader::playback(const void* data, size_t length,
uint32_t playbackFlags, size_t* bytesRead) {
- if (NULL == fCanvas) {
+ if (nullptr == fCanvas) {
return kError_Status;
}
- if (NULL == fState) {
+ if (nullptr == fState) {
fState = new SkGPipeState;
}
« no previous file with comments | « src/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698