aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
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 /bench
parent435af2f736c85c3274a0c6760a3523810750d237 (diff)
Style Change: NULL->nullptr
Diffstat (limited to 'bench')
-rw-r--r--bench/AlternatingColorPatternBench.cpp6
-rw-r--r--bench/BenchLogger.cpp2
-rwxr-xr-xbench/BezierBench.cpp2
-rw-r--r--bench/BitmapBench.cpp2
-rw-r--r--bench/BlurImageFilterBench.cpp4
-rw-r--r--bench/BlurRectBench.cpp6
-rw-r--r--bench/ChartBench.cpp6
-rw-r--r--bench/CmapBench.cpp2
-rw-r--r--bench/CodecBench.cpp2
-rw-r--r--bench/ColorCubeBench.cpp4
-rw-r--r--bench/ColorFilterBench.cpp6
-rw-r--r--bench/DashBench.cpp4
-rw-r--r--bench/DecodingBench.cpp2
-rw-r--r--bench/ETCBitmapBench.cpp24
-rw-r--r--bench/FontCacheBench.cpp2
-rw-r--r--bench/GLBench.cpp16
-rw-r--r--bench/GLInstancedArraysBench.cpp2
-rw-r--r--bench/GLVec4ScalarBench.cpp2
-rw-r--r--bench/GameBench.cpp2
-rw-r--r--bench/GeometryBench.cpp8
-rw-r--r--bench/GrMemoryPoolBench.cpp2
-rw-r--r--bench/GrResourceCacheBench.cpp2
-rw-r--r--bench/GradientBench.cpp10
-rw-r--r--bench/ImageCacheBench.cpp4
-rw-r--r--bench/ImageFilterCollapse.cpp8
-rw-r--r--bench/MathBench.cpp2
-rw-r--r--bench/MipMapBench.cpp2
-rw-r--r--bench/MorphologyBench.cpp2
-rw-r--r--bench/PatchBench.cpp12
-rw-r--r--bench/PatchGridBench.cpp12
-rw-r--r--bench/PathBench.cpp10
-rw-r--r--bench/PerlinNoiseBench.cpp4
-rw-r--r--bench/PicturePlaybackBench.cpp2
-rw-r--r--bench/RTreeBench.cpp2
-rw-r--r--bench/RecordingBench.cpp2
-rw-r--r--bench/RectanizerBench.cpp2
-rw-r--r--bench/RepeatTileBench.cpp2
-rw-r--r--bench/ResultsWriter.h4
-rw-r--r--bench/SKPAnimationBench.cpp2
-rw-r--r--bench/SKPBench.cpp2
-rw-r--r--bench/SkipZeroesBench.cpp2
-rw-r--r--bench/StrokeBench.cpp2
-rw-r--r--bench/TextBench.cpp2
-rw-r--r--bench/TextBlobBench.cpp6
-rw-r--r--bench/VertBench.cpp2
-rw-r--r--bench/nanobench.cpp34
-rw-r--r--bench/nanobench.h2
-rw-r--r--bench/subset/SubsetBenchPriv.h2
-rw-r--r--bench/subset/SubsetSingleBench.cpp2
-rw-r--r--bench/subset/SubsetTranslateBench.cpp4
-rw-r--r--bench/subset/SubsetZoomBench.cpp2
51 files changed, 126 insertions, 126 deletions
diff --git a/bench/AlternatingColorPatternBench.cpp b/bench/AlternatingColorPatternBench.cpp
index 08a28ea3dc..af06c4b357 100644
--- a/bench/AlternatingColorPatternBench.cpp
+++ b/bench/AlternatingColorPatternBench.cpp
@@ -95,7 +95,7 @@ public:
AlternatingColorPatternBench(ColorPattern pattern1, ColorPattern pattern2, DrawType drawType)
- : fBmShader(NULL) {
+ : fBmShader(nullptr) {
fPattern1 = gColorPatterns[pattern1];
fPattern2 = gColorPatterns[pattern2];
fName.printf("colorPattern_%s_%s_%s",
@@ -137,10 +137,10 @@ protected:
}
if (0 == count % 2) {
fColors[count] = fPattern1.fColor;
- fShaders[count] = fPattern1.fIsBitmap ? fBmShader : NULL;
+ fShaders[count] = fPattern1.fIsBitmap ? fBmShader : nullptr;
} else {
fColors[count] = fPattern2.fColor;
- fShaders[count] = fPattern2.fIsBitmap ? fBmShader : NULL;
+ fShaders[count] = fPattern2.fIsBitmap ? fBmShader : nullptr;
}
++count;
}
diff --git a/bench/BenchLogger.cpp b/bench/BenchLogger.cpp
index 5e7455238a..7eae514b17 100644
--- a/bench/BenchLogger.cpp
+++ b/bench/BenchLogger.cpp
@@ -10,7 +10,7 @@
#include "SkStream.h"
BenchLogger::BenchLogger()
-: fFileStream(NULL) {}
+: fFileStream(nullptr) {}
BenchLogger::~BenchLogger() {
if (fFileStream) {
diff --git a/bench/BezierBench.cpp b/bench/BezierBench.cpp
index 73c9cb5b2c..d4fdf0f7e5 100755
--- a/bench/BezierBench.cpp
+++ b/bench/BezierBench.cpp
@@ -64,7 +64,7 @@ public:
fJoin = j;
fProc = proc;
fWidth = SkIntToScalar(w);
- fName.printf("draw_stroke_bezier_%s_%s_%s_%g", proc(NULL, 0), gCapName[c], gJoinName[j], w);
+ fName.printf("draw_stroke_bezier_%s_%s_%s_%g", proc(nullptr, 0), gCapName[c], gJoinName[j], w);
fRec.fQuad.moveTo(20, 20);
fRec.fQuad.quadTo(60, 20, 60, 60);
diff --git a/bench/BitmapBench.cpp b/bench/BitmapBench.cpp
index 718f7ac86f..8176f38891 100644
--- a/bench/BitmapBench.cpp
+++ b/bench/BitmapBench.cpp
@@ -46,7 +46,7 @@ static void convertToIndex666(const SkBitmap& src, SkBitmap* dst, SkAlphaType aT
}
SkColorTable* ctable = new SkColorTable(storage, 216);
dst->allocPixels(SkImageInfo::Make(src.width(), src.height(), kIndex_8_SkColorType, aType),
- NULL, ctable);
+ nullptr, ctable);
ctable->unref();
SkAutoLockPixels alps(src);
diff --git a/bench/BlurImageFilterBench.cpp b/bench/BlurImageFilterBench.cpp
index ec8b9ef59d..8bfd005f44 100644
--- a/bench/BlurImageFilterBench.cpp
+++ b/bench/BlurImageFilterBench.cpp
@@ -51,9 +51,9 @@ protected:
SkIntToScalar(fCheckerboard.height()));
const SkImageFilter::CropRect cropRect =
SkImageFilter::CropRect(bmpRect.makeInset(10.f, 10.f));
- const SkImageFilter::CropRect* crop = fIsCropped ? &cropRect : NULL;
+ const SkImageFilter::CropRect* crop = fIsCropped ? &cropRect : nullptr;
- paint.setImageFilter(SkBlurImageFilter::Create(fSigmaX, fSigmaY, NULL, crop))->unref();
+ paint.setImageFilter(SkBlurImageFilter::Create(fSigmaX, fSigmaY, nullptr, crop))->unref();
for (int i = 0; i < loops; i++) {
canvas->drawBitmap(fCheckerboard, kX, kY, &paint);
diff --git a/bench/BlurRectBench.cpp b/bench/BlurRectBench.cpp
index 8f8a2de25b..890a79e673 100644
--- a/bench/BlurRectBench.cpp
+++ b/bench/BlurRectBench.cpp
@@ -102,7 +102,7 @@ class BlurRectSeparableBench: public BlurRectBench {
public:
BlurRectSeparableBench(SkScalar rad) : INHERITED(rad) {
- fSrcMask.fImage = NULL;
+ fSrcMask.fImage = nullptr;
}
~BlurRectSeparableBench() {
@@ -144,7 +144,7 @@ protected:
void makeBlurryRect(const SkRect&) override {
SkMask mask;
- mask.fImage = NULL;
+ mask.fImage = nullptr;
SkBlurMask::BoxBlur(&mask, fSrcMask, SkBlurMask::ConvertRadiusToSigma(this->radius()),
kNormal_SkBlurStyle, kHigh_SkBlurQuality);
SkMask::FreeImage(mask.fImage);
@@ -171,7 +171,7 @@ protected:
void makeBlurryRect(const SkRect&) override {
SkMask mask;
- mask.fImage = NULL;
+ mask.fImage = nullptr;
SkBlurMask::BlurGroundTruth(SkBlurMask::ConvertRadiusToSigma(this->radius()),
&mask, fSrcMask, kNormal_SkBlurStyle);
SkMask::FreeImage(mask.fImage);
diff --git a/bench/ChartBench.cpp b/bench/ChartBench.cpp
index 61f97a2f2a..8b3aa73cff 100644
--- a/bench/ChartBench.cpp
+++ b/bench/ChartBench.cpp
@@ -29,7 +29,7 @@ static void gen_data(SkScalar yAvg, SkScalar ySpread, int count,
// Generates a path to stroke along the top of each plot and a fill path for the area below each
// plot. The fill path is bounded below by the bottomData plot points or a horizontal line at
-// yBase if bottomData == NULL.
+// yBase if bottomData == nullptr.
// The plots are animated by rotating the data points by leftShift.
static void gen_paths(const SkTDArray<SkScalar>& topData,
const SkTDArray<SkScalar>* bottomData,
@@ -40,7 +40,7 @@ static void gen_paths(const SkTDArray<SkScalar>& topData,
plot->rewind();
fill->rewind();
plot->incReserve(topData.count());
- if (NULL == bottomData) {
+ if (nullptr == bottomData) {
fill->incReserve(topData.count() + 2);
} else {
fill->incReserve(2 * topData.count());
@@ -149,7 +149,7 @@ protected:
fillPaint.setAntiAlias(fAA);
fillPaint.setStyle(SkPaint::kFill_Style);
- SkTDArray<SkScalar>* prevData = NULL;
+ SkTDArray<SkScalar>* prevData = nullptr;
for (int i = 0; i < kNumGraphs; ++i) {
gen_paths(fData[i],
prevData,
diff --git a/bench/CmapBench.cpp b/bench/CmapBench.cpp
index 10591ed410..5bec50652e 100644
--- a/bench/CmapBench.cpp
+++ b/bench/CmapBench.cpp
@@ -58,7 +58,7 @@ static void charsToGlyphsNull_proc(int loops, const SkPaint& paint, const void*
SkTypeface* face = paint.getTypeface();
for (int i = 0; i < loops; ++i) {
- face->charsToGlyphs(text, encoding, NULL, glyphCount);
+ face->charsToGlyphs(text, encoding, nullptr, glyphCount);
}
}
diff --git a/bench/CodecBench.cpp b/bench/CodecBench.cpp
index 903b7336c8..1e6b5207bf 100644
--- a/bench/CodecBench.cpp
+++ b/bench/CodecBench.cpp
@@ -72,7 +72,7 @@ void CodecBench::onDraw(const int n, SkCanvas* canvas) {
const SkCodec::Result result =
#endif
codec->getPixels(fInfo, fPixelStorage.get(), fInfo.minRowBytes(),
- NULL, colorTable, &colorCount);
+ nullptr, colorTable, &colorCount);
SkASSERT(result == SkCodec::kSuccess
|| result == SkCodec::kIncompleteInput);
}
diff --git a/bench/ColorCubeBench.cpp b/bench/ColorCubeBench.cpp
index 9326a123c3..65270a85a3 100644
--- a/bench/ColorCubeBench.cpp
+++ b/bench/ColorCubeBench.cpp
@@ -18,7 +18,7 @@ class ColorCubeBench : public Benchmark {
public:
ColorCubeBench()
: fCubeDimension(0)
- , fCubeData(NULL) {
+ , fCubeData(nullptr) {
fSize = SkISize::Make(2880, 1800); // 2014 Macbook Pro resolution
}
@@ -54,7 +54,7 @@ private:
};
static const SkColor colors[] = { SK_ColorYELLOW, SK_ColorBLUE };
return SkGradientShader::CreateLinear(
- pts, colors, NULL, 2, SkShader::kRepeat_TileMode, 0, &SkMatrix::I());
+ pts, colors, nullptr, 2, SkShader::kRepeat_TileMode, 0, &SkMatrix::I());
}
void make_bitmap() {
diff --git a/bench/ColorFilterBench.cpp b/bench/ColorFilterBench.cpp
index 4f7f1517dd..3c4ddd86e5 100644
--- a/bench/ColorFilterBench.cpp
+++ b/bench/ColorFilterBench.cpp
@@ -28,7 +28,7 @@ protected:
SkRect::MakeWH(FILTER_WIDTH_LARGE, FILTER_HEIGHT_LARGE);
}
- static SkImageFilter* make_brightness(float amount, SkImageFilter* input = NULL) {
+ static SkImageFilter* make_brightness(float amount, SkImageFilter* input = nullptr) {
SkScalar amount255 = SkScalarMul(amount, SkIntToScalar(255));
SkScalar matrix[20] = { 1, 0, 0, 0, amount255,
0, 1, 0, 0, amount255,
@@ -38,7 +38,7 @@ protected:
return SkColorFilterImageFilter::Create(filter, input);
}
- static SkImageFilter* make_grayscale(SkImageFilter* input = NULL) {
+ static SkImageFilter* make_grayscale(SkImageFilter* input = nullptr) {
SkScalar matrix[20];
memset(matrix, 0, 20 * sizeof(SkScalar));
matrix[0] = matrix[5] = matrix[10] = 0.2126f;
@@ -49,7 +49,7 @@ protected:
return SkColorFilterImageFilter::Create(filter, input);
}
- static SkImageFilter* make_mode_blue(SkImageFilter* input = NULL) {
+ static SkImageFilter* make_mode_blue(SkImageFilter* input = nullptr) {
SkAutoTUnref<SkColorFilter> filter(
SkColorFilter::CreateModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mode));
return SkColorFilterImageFilter::Create(filter, input);
diff --git a/bench/DashBench.cpp b/bench/DashBench.cpp
index e54d038768..2653cdc992 100644
--- a/bench/DashBench.cpp
+++ b/bench/DashBench.cpp
@@ -119,7 +119,7 @@ protected:
SkPaint p(paint);
p.setStyle(SkPaint::kFill_Style);
- p.setPathEffect(NULL);
+ p.setPathEffect(nullptr);
int count = SkScalarRoundToInt((pts[1].fX - pts[0].fX) / (2*fWidth));
SkScalar dx = SkIntToScalar(2 * fWidth);
@@ -198,7 +198,7 @@ protected:
for (int i = 0; i < loops; ++i) {
SkStrokeRec rec(SkStrokeRec::kHairline_InitStyle);
- fPE->filterPath(&dst, fPath, &rec, NULL);
+ fPE->filterPath(&dst, fPath, &rec, nullptr);
dst.rewind();
}
}
diff --git a/bench/DecodingBench.cpp b/bench/DecodingBench.cpp
index 6cf3c3aed7..421cabe34a 100644
--- a/bench/DecodingBench.cpp
+++ b/bench/DecodingBench.cpp
@@ -45,7 +45,7 @@ DecodingBench::DecodingBench(SkString path, SkColorType colorType)
// Ensure that we can create a decoder.
SkAutoTDelete<SkStreamRewindable> stream(new SkMemoryStream(fData));
SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(stream));
- SkASSERT(decoder != NULL);
+ SkASSERT(decoder != nullptr);
#endif
}
diff --git a/bench/ETCBitmapBench.cpp b/bench/ETCBitmapBench.cpp
index 1cc61e6157..5d72bf4c68 100644
--- a/bench/ETCBitmapBench.cpp
+++ b/bench/ETCBitmapBench.cpp
@@ -19,14 +19,14 @@
#include "etc1.h"
// This takes the etc1 data pointed to by orig, and copies it `factor` times in each
-// dimension. The return value is the new data or NULL on error.
+// dimension. The return value is the new data or nullptr on error.
static etc1_byte* create_expanded_etc1_bitmap(const uint8_t* orig, int factor) {
SkASSERT(orig);
SkASSERT(factor > 1);
const etc1_byte* origData = reinterpret_cast<const etc1_byte*>(orig);
if (!etc1_pkm_is_valid(orig)) {
- return NULL;
+ return nullptr;
}
etc1_uint32 origWidth = etc1_pkm_get_width(origData);
@@ -37,12 +37,12 @@ static etc1_byte* create_expanded_etc1_bitmap(const uint8_t* orig, int factor) {
static const etc1_uint32 kETC1BlockHeight = 4;
if ((origWidth % kETC1BlockWidth) != 0 ||
(origHeight % kETC1BlockHeight) != 0) {
- return NULL;
+ return nullptr;
}
// The picture must be at least as large as a block.
if (origWidth <= kETC1BlockWidth || origHeight <= kETC1BlockHeight) {
- return NULL;
+ return nullptr;
}
etc1_uint32 newWidth = origWidth * factor;
@@ -80,7 +80,7 @@ static etc1_byte* create_expanded_etc1_bitmap(const uint8_t* orig, int factor) {
class ETCBitmapBenchBase : public Benchmark {
public:
ETCBitmapBenchBase() : fPKMData(loadPKM()) {
- if (NULL == fPKMData) {
+ if (nullptr == fPKMData) {
SkDebugf("Could not load PKM data!");
}
}
@@ -93,17 +93,17 @@ private:
SkString pkmFilename = GetResourcePath("mandrill_128.pkm");
// Expand the data
SkAutoDataUnref fileData(SkData::NewFromFileName(pkmFilename.c_str()));
- if (NULL == fileData) {
+ if (nullptr == fileData) {
SkDebugf("Could not open the file. Did you forget to set the resourcePath?\n");
- return NULL;
+ return nullptr;
}
const etc1_uint32 kExpansionFactor = 8;
etc1_byte* expandedETC1 =
create_expanded_etc1_bitmap(fileData->bytes(), kExpansionFactor);
- if (NULL == expandedETC1) {
+ if (nullptr == expandedETC1) {
SkDebugf("Error expanding ETC1 data by factor of %d\n", kExpansionFactor);
- return NULL;
+ return nullptr;
}
etc1_uint32 width = etc1_pkm_get_width(expandedETC1);
@@ -145,7 +145,7 @@ protected:
}
void onPreDraw() override {
- if (NULL == fPKMData) {
+ if (nullptr == fPKMData) {
SkDebugf("Failed to load PKM data!\n");
return;
}
@@ -164,7 +164,7 @@ protected:
void onDraw(const int loops, SkCanvas* canvas) override {
for (int i = 0; i < loops; ++i) {
- canvas->drawBitmap(this->fBitmap, 0, 0, NULL);
+ canvas->drawBitmap(this->fBitmap, 0, 0, nullptr);
}
}
@@ -210,7 +210,7 @@ protected:
if (pr) {
pr->notifyPixelsChanged();
}
- canvas->drawBitmap(this->fBitmap, 0, 0, NULL);
+ canvas->drawBitmap(this->fBitmap, 0, 0, nullptr);
}
}
diff --git a/bench/FontCacheBench.cpp b/bench/FontCacheBench.cpp
index 304d8d3c88..35bb329e9e 100644
--- a/bench/FontCacheBench.cpp
+++ b/bench/FontCacheBench.cpp
@@ -99,7 +99,7 @@ static void dump_array(const uint16_t array[], int count) {
class FontCacheEfficiency : public Benchmark {
public:
FontCacheEfficiency() {
- if (false) dump_array(NULL, 0);
+ if (false) dump_array(nullptr, 0);
if (false) rotr(0, 0);
}
diff --git a/bench/GLBench.cpp b/bench/GLBench.cpp
index 0252c26b37..531bf88b55 100644
--- a/bench/GLBench.cpp
+++ b/bench/GLBench.cpp
@@ -13,20 +13,20 @@
const GrGLContext* GLBench::getGLContext(SkCanvas* canvas) {
// This bench exclusively tests GL calls directly
- if (NULL == canvas->getGrContext()) {
- return NULL;
+ if (nullptr == canvas->getGrContext()) {
+ return nullptr;
}
GrContext* context = canvas->getGrContext();
GrGpu* gpu = context->getGpu();
if (!gpu) {
SkDebugf("Couldn't get Gr gpu.");
- return NULL;
+ return nullptr;
}
const GrGLContext* ctx = gpu->glContextForTesting();
if (!ctx) {
SkDebugf("Couldn't get an interface\n");
- return NULL;
+ return nullptr;
}
return this->onGetGLContext(ctx);
@@ -64,7 +64,7 @@ GrGLuint GLBench::CompileShader(const GrGLInterface* gl, const char* shaderSrc,
GR_GL_CALL_RET(gl, shader, CreateShader(type));
// Load the shader source
- GR_GL_CALL(gl, ShaderSource(shader, 1, &shaderSrc, NULL));
+ GR_GL_CALL(gl, ShaderSource(shader, 1, &shaderSrc, nullptr));
// Compile the shader
GR_GL_CALL(gl, CompileShader(shader));
@@ -74,7 +74,7 @@ GrGLuint GLBench::CompileShader(const GrGLInterface* gl, const char* shaderSrc,
GrGLchar infoLog[512];
GR_GL_CALL(gl, GetShaderiv(shader, GR_GL_COMPILE_STATUS, &success));
if (!success) {
- GR_GL_CALL(gl, GetShaderInfoLog(shader, 512, NULL, infoLog));
+ GR_GL_CALL(gl, GetShaderInfoLog(shader, 512, nullptr, infoLog));
SkDebugf("ERROR::SHADER::COMPLIATION_FAILED: %s\n", infoLog);
}
@@ -97,7 +97,7 @@ GrGLuint GLBench::CreateProgram(const GrGLInterface* gl, const char* vshader, co
GrGLchar infoLog[512];
GR_GL_CALL(gl, GetProgramiv(shaderProgram, GR_GL_LINK_STATUS, &success));
if (!success) {
- GR_GL_CALL(gl, GetProgramInfoLog(shaderProgram, 512, NULL, infoLog));
+ GR_GL_CALL(gl, GetProgramInfoLog(shaderProgram, 512, nullptr, infoLog));
SkDebugf("Linker Error: %s\n", infoLog);
}
GR_GL_CALL(gl, DeleteShader(vertexShader));
@@ -124,7 +124,7 @@ GrGLuint GLBench::SetupFramebuffer(const GrGLInterface* gl, int screenWidth, int
0, //border
GR_GL_RGBA, //format
GR_GL_UNSIGNED_BYTE, // type
- NULL));
+ nullptr));
// bind framebuffer
GrGLuint framebuffer;
diff --git a/bench/GLInstancedArraysBench.cpp b/bench/GLInstancedArraysBench.cpp
index 8ffbaf03fe..5cb4c069ab 100644
--- a/bench/GLInstancedArraysBench.cpp
+++ b/bench/GLInstancedArraysBench.cpp
@@ -172,7 +172,7 @@ static void setup_matrices(int numQuads, Func f) {
const GrGLContext* GLCpuPosInstancedArraysBench::onGetGLContext(const GrGLContext* ctx) {
// We only care about gpus with drawArraysInstanced support
if (!ctx->interface()->fFunctions.fDrawArraysInstanced) {
- return NULL;
+ return nullptr;
}
return ctx;
}
diff --git a/bench/GLVec4ScalarBench.cpp b/bench/GLVec4ScalarBench.cpp
index e8c40f429d..bbd282e43e 100644
--- a/bench/GLVec4ScalarBench.cpp
+++ b/bench/GLVec4ScalarBench.cpp
@@ -246,7 +246,7 @@ void GLVec4ScalarBench::setupSingleVbo(const GrGLInterface* gl, const SkMatrix*
void GLVec4ScalarBench::setup(const GrGLContext* ctx) {
const GrGLInterface* gl = ctx->interface();
if (!gl) {
- SkFAIL("GL interface is NULL in setup()!\n");
+ SkFAIL("GL interface is nullptr in setup()!\n");
}
fFboTextureId = SetupFramebuffer(gl, kScreenWidth, kScreenHeight);
diff --git a/bench/GameBench.cpp b/bench/GameBench.cpp
index 631a8f25f0..b99440043c 100644
--- a/bench/GameBench.cpp
+++ b/bench/GameBench.cpp
@@ -201,7 +201,7 @@ protected:
{ SkIntToScalar(src.fRight), SkIntToScalar(src.fBottom) },
};
canvas->drawVertices(SkCanvas::kTriangles_VertexMode,
- 4, verts, uvs, NULL, NULL,
+ 4, verts, uvs, nullptr, nullptr,
indices, 6, p2);
} else {
canvas->drawBitmapRect(fAtlas, src, dst, &p,
diff --git a/bench/GeometryBench.cpp b/bench/GeometryBench.cpp
index 6cd9ca2377..99d39dd740 100644
--- a/bench/GeometryBench.cpp
+++ b/bench/GeometryBench.cpp
@@ -185,10 +185,10 @@ protected:
void onDraw(const int loops, SkCanvas* canvas) override {
SkPoint result;
for (int outer = 0; outer < loops; ++outer) {
- SkEvalQuadAt(fPts, 0.5f, NULL, &result);
- SkEvalQuadAt(fPts, 0.5f, NULL, &result);
- SkEvalQuadAt(fPts, 0.5f, NULL, &result);
- SkEvalQuadAt(fPts, 0.5f, NULL, &result);
+ SkEvalQuadAt(fPts, 0.5f, nullptr, &result);
+ SkEvalQuadAt(fPts, 0.5f, nullptr, &result);
+ SkEvalQuadAt(fPts, 0.5f, nullptr, &result);
+ SkEvalQuadAt(fPts, 0.5f, nullptr, &result);
}
}
};
diff --git a/bench/GrMemoryPoolBench.cpp b/bench/GrMemoryPoolBench.cpp
index 394577498f..fd29775307 100644
--- a/bench/GrMemoryPoolBench.cpp
+++ b/bench/GrMemoryPoolBench.cpp
@@ -114,7 +114,7 @@ protected:
for (int i = 0; i < loops; i++) {
uint32_t idx = r.nextRangeU(0, kMaxObjects-1);
- if (NULL == objects[idx].get()) {
+ if (nullptr == objects[idx].get()) {
objects[idx].reset(new B);
} else {
objects[idx].free();
diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp
index e7a9ca8c8f..ec2f8cabdb 100644
--- a/bench/GrResourceCacheBench.cpp
+++ b/bench/GrResourceCacheBench.cpp
@@ -71,7 +71,7 @@ protected:
void onDraw(const int loops, SkCanvas* canvas) override {
SkAutoTUnref<GrContext> context(GrContext::CreateMockContext());
- if (NULL == context) {
+ if (nullptr == context) {
return;
}
// Set the cache budget to be very large so no purging occurs.
diff --git a/bench/GradientBench.cpp b/bench/GradientBench.cpp
index 21b73708d1..705099db1c 100644
--- a/bench/GradientBench.cpp
+++ b/bench/GradientBench.cpp
@@ -39,10 +39,10 @@ static const SkColor gShallowColors[] = { 0xFF555555, 0xFF444444 };
// We have several special-cases depending on the number (and spacing) of colors, so
// try to exercise those here.
static const GradData gGradData[] = {
- { 2, gColors, NULL, "" },
- { 50, gColors, NULL, "_hicolor" }, // many color gradient
- { 3, gColors, NULL, "_3color" },
- { 2, gShallowColors, NULL, "_shallow" },
+ { 2, gColors, nullptr, "" },
+ { 50, gColors, nullptr, "_hicolor" }, // many color gradient
+ { 3, gColors, nullptr, "_3color" },
+ { 2, gShallowColors, nullptr, "_shallow" },
};
/// Ignores scale
@@ -354,7 +354,7 @@ protected:
SK_ColorBLACK,
SkColorSetARGB(alpha, gray, gray, gray),
SK_ColorWHITE };
- SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL,
+ SkShader* s = SkGradientShader::CreateLinear(pts, colors, nullptr,
SK_ARRAY_COUNT(colors),
SkShader::kClamp_TileMode);
paint.setShader(s)->unref();
diff --git a/bench/ImageCacheBench.cpp b/bench/ImageCacheBench.cpp
index 4d71cf0190..fe11868523 100644
--- a/bench/ImageCacheBench.cpp
+++ b/bench/ImageCacheBench.cpp
@@ -27,7 +27,7 @@ struct TestRec : public SkResourceCache::Rec {
const Key& getKey() const override { return fKey; }
size_t bytesUsed() const override { return sizeof(fKey) + sizeof(fValue); }
const char* getCategory() const override { return "imagecachebench-test"; }
- SkDiscardableMemory* diagnostic_only_getDiscardable() const override { return NULL; }
+ SkDiscardableMemory* diagnostic_only_getDiscardable() const override { return nullptr; }
static bool Visitor(const SkResourceCache::Rec&, void*) {
return true;
@@ -63,7 +63,7 @@ protected:
TestKey key(-1);
// search for a miss (-1)
for (int i = 0; i < loops; ++i) {
- SkDEBUGCODE(bool found =) fCache.find(key, TestRec::Visitor, NULL);
+ SkDEBUGCODE(bool found =) fCache.find(key, TestRec::Visitor, nullptr);
SkASSERT(!found);
}
}
diff --git a/bench/ImageFilterCollapse.cpp b/bench/ImageFilterCollapse.cpp
index c631c99262..4024750dc3 100644
--- a/bench/ImageFilterCollapse.cpp
+++ b/bench/ImageFilterCollapse.cpp
@@ -22,7 +22,7 @@
class BaseImageFilterCollapseBench : public Benchmark {
public:
- BaseImageFilterCollapseBench(): fImageFilter(NULL) {}
+ BaseImageFilterCollapseBench(): fImageFilter(nullptr) {}
~BaseImageFilterCollapseBench() {
SkSafeUnref(fImageFilter);
}
@@ -30,10 +30,10 @@ public:
protected:
void doPreDraw(SkColorFilter* colorFilters[], int nFilters) {
// Create a chain of ImageFilters from colorFilters
- fImageFilter = NULL;
+ fImageFilter = nullptr;
for(int i = nFilters; i --> 0;) {
SkAutoTUnref<SkImageFilter> filter(
- SkColorFilterImageFilter::Create(colorFilters[i], fImageFilter, NULL)
+ SkColorFilterImageFilter::Create(colorFilters[i], fImageFilter, nullptr)
);
SkRefCnt_SafeAssign(fImageFilter, filter.get());
}
@@ -67,7 +67,7 @@ private:
SK_ColorRED, 0, SK_ColorBLUE, SK_ColorWHITE
};
SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(
- pts, colors, NULL, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode
+ pts, colors, nullptr, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode
));
paint.setShader(shader);
canvas.drawPaint(paint);
diff --git a/bench/MathBench.cpp b/bench/MathBench.cpp
index e05bd5fada..02867e2743 100644
--- a/bench/MathBench.cpp
+++ b/bench/MathBench.cpp
@@ -274,7 +274,7 @@ public:
}
if (index < 0) {
- fProc = NULL;
+ fProc = nullptr;
fName = "isfinite_rect";
} else {
fProc = gRec[index].fProc;
diff --git a/bench/MipMapBench.cpp b/bench/MipMapBench.cpp
index a8156ed5f9..18af1e5f8c 100644
--- a/bench/MipMapBench.cpp
+++ b/bench/MipMapBench.cpp
@@ -29,7 +29,7 @@ protected:
void onDraw(const int loops, SkCanvas*) override {
for (int i = 0; i < loops; i++) {
- SkMipMap::Build(fBitmap, NULL)->unref();
+ SkMipMap::Build(fBitmap, nullptr)->unref();
}
}
diff --git a/bench/MorphologyBench.cpp b/bench/MorphologyBench.cpp
index 97995e8195..972892b53a 100644
--- a/bench/MorphologyBench.cpp
+++ b/bench/MorphologyBench.cpp
@@ -63,7 +63,7 @@ protected:
r.offset(fRadius, fRadius);
if (fRadius > 0) {
- SkMorphologyImageFilter* mf = NULL;
+ SkMorphologyImageFilter* mf = nullptr;
switch (fStyle) {
case kDilate_MT:
mf = SkDilateImageFilter::Create(SkScalarFloorToInt(fRadius),
diff --git a/bench/PatchBench.cpp b/bench/PatchBench.cpp
index 097e68ec8c..a6f5faae65 100644
--- a/bench/PatchBench.cpp
+++ b/bench/PatchBench.cpp
@@ -76,7 +76,7 @@ public:
};
const SkPoint pts[] = { { 200.f / 4.f, 0.f }, { 3.f * 200.f / 4, 200.f } };
- return SkGradientShader::CreateLinear(pts, colors, NULL,
+ return SkGradientShader::CreateLinear(pts, colors, nullptr,
SK_ARRAY_COUNT(colors),
SkShader::kMirror_TileMode);
}
@@ -118,7 +118,7 @@ protected:
fPaint.setShader(this->createShader())->unref();
break;
default:
- fPaint.setShader(NULL);
+ fPaint.setShader(nullptr);
break;
}
}
@@ -128,16 +128,16 @@ protected:
for (int i = 0; i < loops; i++) {
switch (fVertexMode) {
case kNone_VertexMode:
- canvas->drawPatch(fCubics, NULL, NULL, NULL, fPaint);
+ canvas->drawPatch(fCubics, nullptr, nullptr, nullptr, fPaint);
break;
case kColors_VertexMode:
- canvas->drawPatch(fCubics, fColors, NULL, NULL, fPaint);
+ canvas->drawPatch(fCubics, fColors, nullptr, nullptr, fPaint);
break;
case kTexCoords_VertexMode:
- canvas->drawPatch(fCubics, NULL, fTexCoords, NULL, fPaint);
+ canvas->drawPatch(fCubics, nullptr, fTexCoords, nullptr, fPaint);
break;
case kBoth_VertexMode:
- canvas->drawPatch(fCubics, fColors, fTexCoords, NULL, fPaint);
+ canvas->drawPatch(fCubics, fColors, fTexCoords, nullptr, fPaint);
break;
default:
break;
diff --git a/bench/PatchGridBench.cpp b/bench/PatchGridBench.cpp
index 610d8e7232..e6b44870a1 100644
--- a/bench/PatchGridBench.cpp
+++ b/bench/PatchGridBench.cpp
@@ -96,7 +96,7 @@ public:
static const int kRows = 3;
static const int kCols = 4;
- fGrid.reset(kRows, kCols, SkPatchGrid::kColors_VertexType, NULL);
+ fGrid.reset(kRows, kCols, SkPatchGrid::kColors_VertexType, nullptr);
for (int i = 0; i < kRows; i++) {
for (int j = 0; j < kCols; j++) {
SkPoint points[12];
@@ -131,13 +131,13 @@ public:
switch (fVertexMode) {
case kNone_VertexMode:
- fGrid.setPatch(j, i, points, NULL, NULL);
+ fGrid.setPatch(j, i, points, nullptr, nullptr);
break;
case kColors_VertexMode:
- fGrid.setPatch(j, i, points, colors, NULL);
+ fGrid.setPatch(j, i, points, colors, nullptr);
break;
case kTexCoords_VertexMode:
- fGrid.setPatch(j, i, points, NULL, texs);
+ fGrid.setPatch(j, i, points, nullptr, texs);
break;
case kBoth_VertexMode:
fGrid.setPatch(j, i, points, colors, texs);
@@ -157,7 +157,7 @@ public:
};
const SkPoint pts[] = { { 200.f / 4.f, 0.f }, { 3.f * 200.f / 4, 200.f } };
- return SkGradientShader::CreateLinear(pts, colors, NULL,
+ return SkGradientShader::CreateLinear(pts, colors, nullptr,
SK_ARRAY_COUNT(colors),
SkShader::kMirror_TileMode);
}
@@ -208,7 +208,7 @@ protected:
fPaint.setShader(createShader())->unref();
break;
default:
- fPaint.setShader(NULL);
+ fPaint.setShader(nullptr);
break;
}
this->setupPaint(&fPaint);
diff --git a/bench/PathBench.cpp b/bench/PathBench.cpp
index f2e84c2bb2..8c157119d4 100644
--- a/bench/PathBench.cpp
+++ b/bench/PathBench.cpp
@@ -224,9 +224,9 @@ protected:
void createData(int minVerbs,
int maxVerbs,
bool allowMoves = true,
- SkRect* bounds = NULL) {
+ SkRect* bounds = nullptr) {
SkRect tempBounds;
- if (NULL == bounds) {
+ if (nullptr == bounds) {
tempBounds.setXYWH(0, 0, SK_Scalar1, SK_Scalar1);
bounds = &tempBounds;
}
@@ -711,7 +711,7 @@ protected:
if (fZeroRad) {
make_arb_round_rect(&temp, r, 0, 0);
- SkASSERT(temp.isRect(NULL));
+ SkASSERT(temp.isRect(nullptr));
} else {
make_arb_round_rect(&temp, r, r.width() / 10, r.height() / 15);
}
@@ -851,7 +851,7 @@ public:
} else {
for (int i = 0; i < loops; ++i) {
for (int j = 0; j < 1000; ++j) {
- fRQ.evalAt(0.4f, &fDst[0].fPts[0], NULL);
+ fRQ.evalAt(0.4f, &fDst[0].fPts[0], nullptr);
}
}
}
@@ -876,7 +876,7 @@ public:
} else {
for (int i = 0; i < loops; ++i) {
for (int j = 0; j < 1000; ++j) {
- fRQ.evalAt(0.4f, NULL, &fDst[0].fPts[0]);
+ fRQ.evalAt(0.4f, nullptr, &fDst[0].fPts[0]);
}
}
}
diff --git a/bench/PerlinNoiseBench.cpp b/bench/PerlinNoiseBench.cpp
index b8237c0655..3fbb72309d 100644
--- a/bench/PerlinNoiseBench.cpp
+++ b/bench/PerlinNoiseBench.cpp
@@ -43,9 +43,9 @@ private:
bool stitchTiles) {
SkShader* shader = (type == SkPerlinNoiseShader::kFractalNoise_Type) ?
SkPerlinNoiseShader::CreateFractalNoise(baseFrequencyX, baseFrequencyY, numOctaves,
- seed, stitchTiles ? &fSize : NULL) :
+ seed, stitchTiles ? &fSize : nullptr) :
SkPerlinNoiseShader::CreateTurbulence(baseFrequencyX, baseFrequencyY, numOctaves,
- seed, stitchTiles ? &fSize : NULL);
+ seed, stitchTiles ? &fSize : nullptr);
SkPaint paint;
paint.setShader(shader)->unref();
diff --git a/bench/PicturePlaybackBench.cpp b/bench/PicturePlaybackBench.cpp
index e11d7c8360..04eddc4f4f 100644
--- a/bench/PicturePlaybackBench.cpp
+++ b/bench/PicturePlaybackBench.cpp
@@ -40,7 +40,7 @@ protected:
virtual void onDraw(const int loops, SkCanvas* canvas) {
SkPictureRecorder recorder;
- SkCanvas* pCanvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT, NULL, 0);
+ SkCanvas* pCanvas = recorder.beginRecording(PICTURE_WIDTH, PICTURE_HEIGHT, nullptr, 0);
this->recordCanvas(pCanvas);
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
diff --git a/bench/RTreeBench.cpp b/bench/RTreeBench.cpp
index 1da9fbe094..63d8ed9d2c 100644
--- a/bench/RTreeBench.cpp
+++ b/bench/RTreeBench.cpp
@@ -44,7 +44,7 @@ protected:
for (int i = 0; i < loops; ++i) {
SkRTree tree;
tree.insert(rects.get(), NUM_BUILD_RECTS);
- SkASSERT(rects != NULL); // It'd break this bench if the tree took ownership of rects.
+ SkASSERT(rects != nullptr); // It'd break this bench if the tree took ownership of rects.
}
}
private:
diff --git a/bench/RecordingBench.cpp b/bench/RecordingBench.cpp
index eada9305f9..c66e11a1d5 100644
--- a/bench/RecordingBench.cpp
+++ b/bench/RecordingBench.cpp
@@ -37,7 +37,7 @@ void RecordingBench::onDraw(const int loops, SkCanvas*) {
| SkPictureRecorder::kPlaybackDrawPicture_RecordFlag;
for (int i = 0; i < loops; i++) {
SkPictureRecorder recorder;
- fSrc->playback(recorder.beginRecording(w, h, fUseBBH ? &factory : NULL, flags));
+ fSrc->playback(recorder.beginRecording(w, h, fUseBBH ? &factory : nullptr, flags));
SkSafeUnref(recorder.endRecording());
}
}
diff --git a/bench/RectanizerBench.cpp b/bench/RectanizerBench.cpp
index 506a363541..fec9bf5839 100644
--- a/bench/RectanizerBench.cpp
+++ b/bench/RectanizerBench.cpp
@@ -73,7 +73,7 @@ protected:
}
void onPreDraw() override {
- SkASSERT(NULL == fRectanizer.get());
+ SkASSERT(nullptr == fRectanizer.get());
if (kPow2_RectanizerType == fRectanizerType) {
fRectanizer.reset(new GrRectanizerPow2(kWidth, kHeight));
diff --git a/bench/RepeatTileBench.cpp b/bench/RepeatTileBench.cpp
index afbc5b27f1..4844f18af7 100644
--- a/bench/RepeatTileBench.cpp
+++ b/bench/RepeatTileBench.cpp
@@ -66,7 +66,7 @@ static void convert_to_index666(const SkBitmap& src, SkBitmap* dst) {
SkColorTable* ctable = new SkColorTable(storage, 216);
dst->allocPixels(SkImageInfo::Make(src.width(), src.height(),
kIndex_8_SkColorType, kOpaque_SkAlphaType),
- NULL, ctable);
+ nullptr, ctable);
ctable->unref();
SkAutoLockPixels alps(src);
diff --git a/bench/ResultsWriter.h b/bench/ResultsWriter.h
index b8b9a2e5ed..2906429bf0 100644
--- a/bench/ResultsWriter.h
+++ b/bench/ResultsWriter.h
@@ -79,8 +79,8 @@ public:
: fFilename(filename)
, fRoot()
, fResults(fRoot["results"])
- , fBench(NULL)
- , fConfig(NULL) {}
+ , fBench(nullptr)
+ , fConfig(nullptr) {}
~NanoJSONResultsWriter() {
this->flush();
diff --git a/bench/SKPAnimationBench.cpp b/bench/SKPAnimationBench.cpp
index f43dc80abd..1a1ca447e5 100644
--- a/bench/SKPAnimationBench.cpp
+++ b/bench/SKPAnimationBench.cpp
@@ -34,7 +34,7 @@ void SKPAnimationBench::drawPicture() {
SkMatrix trans = SkMatrix::MakeTrans(-1.f * this->tileRects()[j].fLeft,
-1.f * this->tileRects()[j].fTop);
fAnimation->preConcatFrameMatrix(fAnimationTimer.fWall, fDevBounds, &trans);
- this->surfaces()[j]->getCanvas()->drawPicture(this->picture(), &trans, NULL);
+ this->surfaces()[j]->getCanvas()->drawPicture(this->picture(), &trans, nullptr);
}
for (int j = 0; j < this->tileRects().count(); ++j) {
diff --git a/bench/SKPBench.cpp b/bench/SKPBench.cpp
index ef7f644dd7..f0dafb6c9e 100644
--- a/bench/SKPBench.cpp
+++ b/bench/SKPBench.cpp
@@ -138,7 +138,7 @@ void SKPBench::drawPicture() {
for (int j = 0; j < fTileRects.count(); ++j) {
const SkMatrix trans = SkMatrix::MakeTrans(-fTileRects[j].fLeft / fScale,
-fTileRects[j].fTop / fScale);
- fSurfaces[j]->getCanvas()->drawPicture(fPic, &trans, NULL);
+ fSurfaces[j]->getCanvas()->drawPicture(fPic, &trans, nullptr);
}
for (int j = 0; j < fTileRects.count(); ++j) {
diff --git a/bench/SkipZeroesBench.cpp b/bench/SkipZeroesBench.cpp
index 75fe78a156..87d433e422 100644
--- a/bench/SkipZeroesBench.cpp
+++ b/bench/SkipZeroesBench.cpp
@@ -23,7 +23,7 @@ class SkipZeroesBench : public Benchmark {
public:
SkipZeroesBench(const char* filename, bool skipZeroes)
: fName("SkipZeroes_")
- , fDecoder(NULL)
+ , fDecoder(nullptr)
, fFilename(filename)
, fStream()
, fSkipZeroes(skipZeroes)
diff --git a/bench/StrokeBench.cpp b/bench/StrokeBench.cpp
index 750bd0694d..d6737486e0 100644
--- a/bench/StrokeBench.cpp
+++ b/bench/StrokeBench.cpp
@@ -34,7 +34,7 @@ protected:
for (int outer = 0; outer < 10; ++outer) {
for (int i = 0; i < loops; ++i) {
SkPath result;
- paint.getFillPath(fPath, &result, NULL, fRes);
+ paint.getFillPath(fPath, &result, nullptr, fRes);
}
}
}
diff --git a/bench/TextBench.cpp b/bench/TextBench.cpp
index 3d97428d9f..ee5d5e0db3 100644
--- a/bench/TextBench.cpp
+++ b/bench/TextBench.cpp
@@ -57,7 +57,7 @@ public:
, fFQ(fq)
, fDoPos(doPos)
, fDoColorEmoji(doColorEmoji)
- , fPos(NULL) {
+ , fPos(nullptr) {
fPaint.setAntiAlias(kBW != fq);
fPaint.setLCDRenderText(kLCD == fq);
fPaint.setTextSize(SkIntToScalar(ps));
diff --git a/bench/TextBlobBench.cpp b/bench/TextBlobBench.cpp
index d110b8d2bb..0ef5eb9654 100644
--- a/bench/TextBlobBench.cpp
+++ b/bench/TextBlobBench.cpp
@@ -25,7 +25,7 @@
class TextBlobBench : public Benchmark {
public:
TextBlobBench()
- : fTypeface(NULL) {
+ : fTypeface(nullptr) {
}
protected:
@@ -37,14 +37,14 @@ protected:
const char* text = "Hello blob!";
SkTDArray<uint16_t> glyphs;
size_t len = strlen(text);
- glyphs.append(paint.textToGlyphs(text, len, NULL));
+ glyphs.append(paint.textToGlyphs(text, len, nullptr));
paint.textToGlyphs(text, len, glyphs.begin());
SkTextBlobBuilder builder;
paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
const SkTextBlobBuilder::RunBuffer& run = builder.allocRun(paint, glyphs.count(), 10, 10,
- NULL);
+ nullptr);
memcpy(run.glyphs, glyphs.begin(), glyphs.count() * sizeof(uint16_t));
fBlob.reset(builder.build());
diff --git a/bench/VertBench.cpp b/bench/VertBench.cpp
index 6e49bf42b5..d2e5269c52 100644
--- a/bench/VertBench.cpp
+++ b/bench/VertBench.cpp
@@ -83,7 +83,7 @@ protected:
for (int i = 0; i < loops; i++) {
canvas->drawVertices(SkCanvas::kTriangles_VertexMode, PTS,
- fPts, NULL, fColors, NULL, fIdx, IDX, paint);
+ fPts, nullptr, fColors, nullptr, fIdx, IDX, paint);
}
}
private:
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 75d0ce3ba2..9933cf4393 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -141,7 +141,7 @@ bool Target::capturePixels(SkBitmap* bmp) {
#if SK_SUPPORT_GPU
struct GPUTarget : public Target {
- explicit GPUTarget(const Config& c) : Target(c), gl(NULL) { }
+ explicit GPUTarget(const Config& c) : Target(c), gl(nullptr) { }
SkGLContext* gl;
void setup() override {
@@ -458,16 +458,16 @@ static void create_configs(SkTDArray<Config>* configs) {
#endif
}
-// If bench is enabled for config, returns a Target* for it, otherwise NULL.
+// If bench is enabled for config, returns a Target* for it, otherwise nullptr.
static Target* is_enabled(Benchmark* bench, const Config& config) {
if (!bench->isSuitableFor(config.backend)) {
- return NULL;
+ return nullptr;
}
SkImageInfo info = SkImageInfo::Make(bench->getSize().fX, bench->getSize().fY,
config.color, config.alpha);
- Target* target = NULL;
+ Target* target = nullptr;
switch (config.backend) {
#if SK_SUPPORT_GPU
@@ -487,7 +487,7 @@ static Target* is_enabled(Benchmark* bench, const Config& config) {
if (!target->init(info, bench)) {
delete target;
- return NULL;
+ return nullptr;
}
return target;
}
@@ -504,7 +504,7 @@ static bool valid_subset_bench(const SkString& path, SkColorType colorType, bool
// Check that we can create a codec or image decoder.
if (useCodec) {
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.detach()));
- if (NULL == codec) {
+ if (nullptr == codec) {
SkDebugf("Could not create codec for %s. Skipping bench.\n", path.c_str());
return false;
}
@@ -516,7 +516,7 @@ static bool valid_subset_bench(const SkString& path, SkColorType colorType, bool
const SkImageInfo info = codec->getInfo().makeColorType(colorType);
SkAutoTDeleteArray<uint8_t> row(new uint8_t[info.minRowBytes()]);
SkAutoTDelete<SkScanlineDecoder> scanlineDecoder(SkScanlineDecoder::NewFromData(encoded));
- if (NULL == scanlineDecoder || scanlineDecoder->start(info, NULL,
+ if (nullptr == scanlineDecoder || scanlineDecoder->start(info, nullptr,
colors, &colorCount) != SkCodec::kSuccess)
{
SkDebugf("Could not create scanline decoder for %s with color type %s. "
@@ -527,7 +527,7 @@ static bool valid_subset_bench(const SkString& path, SkColorType colorType, bool
*height = info.height();
} else {
SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(stream));
- if (NULL == decoder) {
+ if (nullptr == decoder) {
SkDebugf("Could not create decoder for %s. Skipping bench.\n", path.c_str());
return false;
}
@@ -648,13 +648,13 @@ public:
}
SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path));
- if (stream.get() == NULL) {
+ if (stream.get() == nullptr) {
SkDebugf("Could not read %s.\n", path);
return false;
}
pic->reset(SkPicture::CreateFromStream(stream.get()));
- if (pic->get() == NULL) {
+ if (pic->get() == nullptr) {
SkDebugf("Could not read %s as an SkPicture.\n", path);
return false;
}
@@ -663,7 +663,7 @@ public:
Benchmark* next() {
if (fBenches) {
- Benchmark* bench = fBenches->factory()(NULL);
+ Benchmark* bench = fBenches->factory()(nullptr);
fBenches = fBenches->next();
fSourceType = "bench";
fBenchType = "micro";
@@ -671,7 +671,7 @@ public:
}
while (fGMs) {
- SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(NULL));
+ SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(nullptr));
fGMs = fGMs->next();
if (gm->runAsBench()) {
fSourceType = "gm";
@@ -783,7 +783,7 @@ public:
SkPMColor colors[256];
const SkCodec::Result result = codec->getPixels(
- info, storage.get(), rowBytes, NULL, colors,
+ info, storage.get(), rowBytes, nullptr, colors,
&colorCount);
switch (result) {
case SkCodec::kSuccess:
@@ -871,7 +871,7 @@ public:
fUseCodec++;
}
- return NULL;
+ return nullptr;
}
void fillCurrentOptions(ResultsWriter* log) const {
@@ -976,7 +976,7 @@ int nanobench_main() {
SkDebugf("Writing files to %s.\n", FLAGS_writePath[0]);
if (!sk_mkdir(FLAGS_writePath[0])) {
SkDebugf("Could not create %s. Files won't be written.\n", FLAGS_writePath[0]);
- FLAGS_writePath.set(0, NULL);
+ FLAGS_writePath.set(0, nullptr);
}
}
@@ -1038,7 +1038,7 @@ int nanobench_main() {
continue;
}
- // During HWUI output this canvas may be NULL.
+ // During HWUI output this canvas may be nullptr.
SkCanvas* canvas = target->getCanvas();
const char* config = target->config.name;
@@ -1151,7 +1151,7 @@ int nanobench_main() {
#if SK_SUPPORT_GPU
// Make sure we clean up the global GrContextFactory here, otherwise we might race with the
// SkEventTracer destructor
- gGrFactory.reset(NULL);
+ gGrFactory.reset(nullptr);
#endif
return 0;
diff --git a/bench/nanobench.h b/bench/nanobench.h
index f556f7dc14..36f5ad5b75 100644
--- a/bench/nanobench.h
+++ b/bench/nanobench.h
@@ -78,7 +78,7 @@ struct Target {
SkCanvas* getCanvas() const {
if (!surface.get()) {
- return NULL;
+ return nullptr;
}
return surface->getCanvas();
}
diff --git a/bench/subset/SubsetBenchPriv.h b/bench/subset/SubsetBenchPriv.h
index d3876840a7..02f7040a22 100644
--- a/bench/subset/SubsetBenchPriv.h
+++ b/bench/subset/SubsetBenchPriv.h
@@ -41,7 +41,7 @@ static inline void alloc_pixels(SkBitmap* bitmap, const SkImageInfo& info, SkPMC
int colorCount) {
if (kIndex_8_SkColorType == info.colorType()) {
SkAutoTUnref<SkColorTable> colorTable(new SkColorTable(colors, colorCount));
- bitmap->allocPixels(info, NULL, colorTable);
+ bitmap->allocPixels(info, nullptr, colorTable);
} else {
bitmap->allocPixels(info);
}
diff --git a/bench/subset/SubsetSingleBench.cpp b/bench/subset/SubsetSingleBench.cpp
index 9713cfd4bd..ce00f20947 100644
--- a/bench/subset/SubsetSingleBench.cpp
+++ b/bench/subset/SubsetSingleBench.cpp
@@ -68,7 +68,7 @@ void SubsetSingleBench::onDraw(const int n, SkCanvas* canvas) {
SkScanlineDecoder::NewFromStream(fStream->duplicate()));
const SkImageInfo info = scanlineDecoder->getInfo().makeColorType(fColorType);
SkAutoTDeleteArray<uint8_t> row(new uint8_t[info.minRowBytes()]);
- scanlineDecoder->start(info, NULL, colors, &colorCount);
+ scanlineDecoder->start(info, nullptr, colors, &colorCount);
SkBitmap bitmap;
SkImageInfo subsetInfo = info.makeWH(fSubsetWidth, fSubsetHeight);
diff --git a/bench/subset/SubsetTranslateBench.cpp b/bench/subset/SubsetTranslateBench.cpp
index 35654d6a0a..8f6f2ea21b 100644
--- a/bench/subset/SubsetTranslateBench.cpp
+++ b/bench/subset/SubsetTranslateBench.cpp
@@ -64,7 +64,7 @@ void SubsetTranslateBench::onDraw(const int n, SkCanvas* canvas) {
SkScanlineDecoder::NewFromStream(fStream->duplicate()));
const SkImageInfo info = scanlineDecoder->getInfo().makeColorType(fColorType);
SkAutoTDeleteArray<uint8_t> row(new uint8_t[info.minRowBytes()]);
- scanlineDecoder->start(info, NULL, colors, &colorCount);
+ scanlineDecoder->start(info, nullptr, colors, &colorCount);
SkBitmap bitmap;
// Note that we use the same bitmap for all of the subsets.
@@ -108,7 +108,7 @@ void SubsetTranslateBench::onDraw(const int n, SkCanvas* canvas) {
// because it gives a more fair comparison with SkCodec and is a common
// use case of BitmapRegionDecoder.
bitmap.allocPixels(SkImageInfo::Make(fSubsetWidth, fSubsetHeight,
- fColorType, kOpaque_SkAlphaType), NULL, colorTable);
+ fColorType, kOpaque_SkAlphaType), nullptr, colorTable);
for (int x = 0; x < width; x += fSubsetWidth) {
for (int y = 0; y < height; y += fSubsetHeight) {
diff --git a/bench/subset/SubsetZoomBench.cpp b/bench/subset/SubsetZoomBench.cpp
index d8abfd7673..bbdca75a54 100644
--- a/bench/subset/SubsetZoomBench.cpp
+++ b/bench/subset/SubsetZoomBench.cpp
@@ -64,7 +64,7 @@ void SubsetZoomBench::onDraw(const int n, SkCanvas* canvas) {
SkScanlineDecoder::NewFromStream(fStream->duplicate()));
const SkImageInfo info = scanlineDecoder->getInfo().makeColorType(fColorType);
SkAutoTDeleteArray<uint8_t> row(new uint8_t[info.minRowBytes()]);
- scanlineDecoder->start(info, NULL, colors, &colorCount);
+ scanlineDecoder->start(info, nullptr, colors, &colorCount);
const int centerX = info.width() / 2;
const int centerY = info.height() / 2;