aboutsummaryrefslogtreecommitdiffstats
path: root/tools/PictureRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/PictureRenderer.cpp')
-rw-r--r--tools/PictureRenderer.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index ee8e981a39..700d3d3982 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