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

Unified Diff: tools/PictureRenderer.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 | « tools/PictureRenderer.h ('k') | tools/PictureRenderingFlags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/PictureRenderer.cpp
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index ee8e981a3989b18fcb34440e1fc258d0d7cee413..700d3d39824fc4115bd39c3737fba29537da20e4 100644
--- a/tools/PictureRenderer.cpp
+++ b/tools/PictureRenderer.cpp
@@ -65,14 +65,14 @@ void PictureRenderer::init(const SkPicture* pict,
fUseChecksumBasedFilenames = useChecksumBasedFilenames;
fUseMultiPictureDraw = useMultiPictureDraw;
- SkASSERT(NULL == fPicture);
- SkASSERT(NULL == fCanvas.get());
+ SkASSERT(nullptr == fPicture);
+ SkASSERT(nullptr == fCanvas.get());
if (fPicture || fCanvas.get()) {
return;
}
- SkASSERT(pict != NULL);
- if (NULL == pict) {
+ SkASSERT(pict != nullptr);
+ if (nullptr == pict) {
return;
}
@@ -102,7 +102,7 @@ protected:
if (PictureRenderer::kMaskFilter_DrawFilterFlag & fFlags[t]) {
SkMaskFilter* maskFilter = paint->getMaskFilter();
if (maskFilter) {
- paint->setMaskFilter(NULL);
+ paint->setMaskFilter(nullptr);
}
}
if (PictureRenderer::kHinting_DrawFilterFlag & fFlags[t]) {
@@ -154,7 +154,7 @@ SkCanvas* PictureRenderer::setupCanvas(int width, int height) {
desc.fWidth = width;
desc.fHeight = height;
desc.fSampleCnt = fSampleCount;
- target.reset(fGrContext->textureProvider()->createTexture(desc, false, NULL, 0));
+ target.reset(fGrContext->textureProvider()->createTexture(desc, false, nullptr, 0));
}
uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts_Flag : 0;
@@ -163,7 +163,7 @@ SkCanvas* PictureRenderer::setupCanvas(int width, int height) {
SkGpuDevice::Create(target->asRenderTarget(), &props,
SkGpuDevice::kUninit_InitContents));
if (!device) {
- return NULL;
+ return nullptr;
}
canvas.reset(new SkCanvas(device));
break;
@@ -171,7 +171,7 @@ SkCanvas* PictureRenderer::setupCanvas(int width, int height) {
#endif
default:
SkASSERT(0);
- return NULL;
+ return nullptr;
}
if (fHasDrawFilters) {
@@ -192,7 +192,7 @@ SkCanvas* PictureRenderer::setupCanvas(int width, int height) {
}
void PictureRenderer::scaleToScaleFactor(SkCanvas* canvas) {
- SkASSERT(canvas != NULL);
+ SkASSERT(canvas != nullptr);
if (fScaleFactor != SK_Scalar1) {
canvas->scale(fScaleFactor, fScaleFactor);
}
@@ -200,12 +200,12 @@ void PictureRenderer::scaleToScaleFactor(SkCanvas* canvas) {
void PictureRenderer::end() {
this->resetState(true);
- fPicture.reset(NULL);
- fCanvas.reset(NULL);
+ fPicture.reset(nullptr);
+ fCanvas.reset(nullptr);
}
int PictureRenderer::getViewWidth() {
- SkASSERT(fPicture != NULL);
+ SkASSERT(fPicture != nullptr);
int width = SkScalarCeilToInt(fPicture->cullRect().width() * fScaleFactor);
if (fViewport.width() > 0) {
width = SkMin32(width, fViewport.width());
@@ -214,7 +214,7 @@ int PictureRenderer::getViewWidth() {
}
int PictureRenderer::getViewHeight() {
- SkASSERT(fPicture != NULL);
+ SkASSERT(fPicture != nullptr);
int height = SkScalarCeilToInt(fPicture->cullRect().height() * fScaleFactor);
if (fViewport.height() > 0) {
height = SkMin32(height, fViewport.height());
@@ -247,7 +247,7 @@ void PictureRenderer::buildBBoxHierarchy() {
void PictureRenderer::resetState(bool callFinish) {
#if SK_SUPPORT_GPU
SkGLContext* glContext = this->getGLContext();
- if (NULL == glContext) {
+ if (nullptr == glContext) {
SkASSERT(kBitmap_DeviceType == fDeviceType);
return;
}
@@ -267,7 +267,7 @@ void PictureRenderer::purgeTextures() {
#if SK_SUPPORT_GPU
SkGLContext* glContext = this->getGLContext();
- if (NULL == glContext) {
+ if (nullptr == glContext) {
SkASSERT(kBitmap_DeviceType == fDeviceType);
return;
}
@@ -295,9 +295,9 @@ void PictureRenderer::purgeTextures() {
*/
static bool write(SkCanvas* canvas, const SkString& writePath, const SkString& mismatchPath,
const SkString& inputFilename, ImageResultsAndExpectations *jsonSummaryPtr,
- bool useChecksumBasedFilenames, const int* tileNumberPtr=NULL) {
- SkASSERT(canvas != NULL);
- if (NULL == canvas) {
+ bool useChecksumBasedFilenames, const int* tileNumberPtr=nullptr) {
+ SkASSERT(canvas != nullptr);
+ if (nullptr == canvas) {
return false;
}
@@ -315,7 +315,7 @@ static bool write(SkCanvas* canvas, const SkString& writePath, const SkString& m
// TODO(epoger): what about including the config type within outputFilename? That way,
// we could combine results of different config types without conflicting filenames.
SkString outputFilename;
- const char *outputSubdirPtr = NULL;
+ const char *outputSubdirPtr = nullptr;
if (useChecksumBasedFilenames) {
ImageDigest *imageDigestPtr = bitmapAndDigest.getImageDigestPtr();
outputSubdirPtr = escapedInputFilename.c_str();
@@ -364,7 +364,7 @@ static bool write(SkCanvas* canvas, const SkString& writePath, const SkString& m
SkCanvas* RecordPictureRenderer::setupCanvas(int width, int height) {
// defer the canvas setup until the render step
- return NULL;
+ return nullptr;
}
bool RecordPictureRenderer::render(SkBitmap** out) {
@@ -395,9 +395,9 @@ SkString RecordPictureRenderer::getConfigNameInternal() {
///////////////////////////////////////////////////////////////////////////////////////////////
bool PipePictureRenderer::render(SkBitmap** out) {
- SkASSERT(fCanvas.get() != NULL);
- SkASSERT(fPicture != NULL);
- if (NULL == fCanvas.get() || NULL == fPicture) {
+ SkASSERT(fCanvas.get() != nullptr);
+ SkASSERT(fPicture != nullptr);
+ if (nullptr == fCanvas.get() || nullptr == fPicture) {
return false;
}
@@ -436,9 +436,9 @@ void SimplePictureRenderer::init(const SkPicture* picture, const SkString* write
}
bool SimplePictureRenderer::render(SkBitmap** out) {
- SkASSERT(fCanvas.get() != NULL);
+ SkASSERT(fCanvas.get() != nullptr);
SkASSERT(fPicture);
- if (NULL == fCanvas.get() || NULL == fPicture) {
+ if (nullptr == fCanvas.get() || nullptr == fPicture) {
return false;
}
@@ -493,7 +493,7 @@ void TiledPictureRenderer::init(const SkPicture* pict, const SkString* writePath
bool useChecksumBasedFilenames, bool useMultiPictureDraw) {
SkASSERT(pict);
SkASSERT(0 == fTileRects.count());
- if (NULL == pict || fTileRects.count() != 0) {
+ if (nullptr == pict || fTileRects.count() != 0) {
return;
}
@@ -550,7 +550,7 @@ void TiledPictureRenderer::setupTiles() {
}
bool TiledPictureRenderer::tileDimensions(int &x, int &y) {
- if (fTileRects.count() == 0 || NULL == fPicture) {
+ if (fTileRects.count() == 0 || nullptr == fPicture) {
return false;
}
x = fTilesX;
@@ -687,8 +687,8 @@ bool TiledPictureRenderer::postRender(SkCanvas* canvas, const SkIRect& tileRect,
}
bool TiledPictureRenderer::render(SkBitmap** out) {
- SkASSERT(fPicture != NULL);
- if (NULL == fPicture) {
+ SkASSERT(fPicture != nullptr);
+ if (nullptr == fPicture) {
return false;
}
@@ -819,12 +819,12 @@ SkString PlaybackCreationRenderer::getConfigNameInternal() {
SkBBHFactory* PictureRenderer::getFactory() {
switch (fBBoxHierarchyType) {
case kNone_BBoxHierarchyType:
- return NULL;
+ return nullptr;
case kRTree_BBoxHierarchyType:
return new SkRTreeFactory;
}
SkASSERT(0); // invalid bbhType
- return NULL;
+ return nullptr;
}
} // namespace sk_tools
« no previous file with comments | « tools/PictureRenderer.h ('k') | tools/PictureRenderingFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698