Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002
Review URL: https://codereview.chromium.org/1316233002
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index 23f1899..92cf9a2 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -226,7 +226,7 @@
gp = GrConicEffect::Create(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom),
edgeType, *d->fCaps,
GrTest::TestMatrix(d->fRandom), d->fRandom->nextBool());
- } while (NULL == gp);
+ } while (nullptr == gp);
return gp;
}
@@ -435,7 +435,7 @@
edgeType, *d->fCaps,
GrTest::TestMatrix(d->fRandom),
d->fRandom->nextBool());
- } while (NULL == gp);
+ } while (nullptr == gp);
return gp;
}
@@ -653,7 +653,7 @@
d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
gp = GrCubicEffect::Create(GrRandomColor(d->fRandom),
GrTest::TestMatrix(d->fRandom), edgeType, *d->fCaps);
- } while (NULL == gp);
+ } while (nullptr == gp);
return gp;
}
diff --git a/src/gpu/effects/GrBezierEffect.h b/src/gpu/effects/GrBezierEffect.h
index b78c3f3..1c76c64 100644
--- a/src/gpu/effects/GrBezierEffect.h
+++ b/src/gpu/effects/GrBezierEffect.h
@@ -68,13 +68,13 @@
switch (edgeType) {
case kFillAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
- return NULL;
+ return nullptr;
}
return new GrConicEffect(color, viewMatrix, coverage, kFillAA_GrProcessorEdgeType,
localMatrix, usesLocalCoords);
case kHairlineAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
- return NULL;
+ return nullptr;
}
return new GrConicEffect(color, viewMatrix, coverage,
kHairlineAA_GrProcessorEdgeType, localMatrix,
@@ -83,7 +83,7 @@
return new GrConicEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType,
localMatrix, usesLocalCoords);
default:
- return NULL;
+ return nullptr;
}
}
@@ -151,13 +151,13 @@
switch (edgeType) {
case kFillAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
- return NULL;
+ return nullptr;
}
return new GrQuadEffect(color, viewMatrix, coverage, kFillAA_GrProcessorEdgeType,
localMatrix, usesLocalCoords);
case kHairlineAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
- return NULL;
+ return nullptr;
}
return new GrQuadEffect(color, viewMatrix, coverage,
kHairlineAA_GrProcessorEdgeType, localMatrix,
@@ -166,7 +166,7 @@
return new GrQuadEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType,
localMatrix, usesLocalCoords);
default:
- return NULL;
+ return nullptr;
}
}
@@ -233,18 +233,18 @@
switch (edgeType) {
case kFillAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
- return NULL;
+ return nullptr;
}
return new GrCubicEffect(color, viewMatrix, kFillAA_GrProcessorEdgeType);
case kHairlineAA_GrProcessorEdgeType:
if (!caps.shaderCaps()->shaderDerivativeSupport()) {
- return NULL;
+ return nullptr;
}
return new GrCubicEffect(color, viewMatrix, kHairlineAA_GrProcessorEdgeType);
case kFillBW_GrProcessorEdgeType:
return new GrCubicEffect(color, viewMatrix, kFillBW_GrProcessorEdgeType);
default:
- return NULL;
+ return nullptr;
}
}
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h
index ff2d60e..18382a3 100644
--- a/src/gpu/effects/GrBicubicEffect.h
+++ b/src/gpu/effects/GrBicubicEffect.h
@@ -34,8 +34,8 @@
*/
static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
const SkScalar coefficients[16],
- const SkRect* domain = NULL) {
- if (NULL == domain) {
+ const SkRect* domain = nullptr) {
+ if (nullptr == domain) {
static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_TileMode,
SkShader::kClamp_TileMode };
return Create(procDataManager, tex, coefficients,
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 3b4f24c..85d0862 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -127,7 +127,7 @@
, fLocalMatrix(localMatrix)
, fUsesLocalCoords(usesLocalCoords)
, fTextureAccess(texture, params)
- , fInColor(NULL)
+ , fInColor(nullptr)
, fMaskFormat(format) {
this->initClassID<GrBitmapTextGeoProc>();
fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType));
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index cee0f2f..838dc1c 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -182,11 +182,11 @@
desc.fHeight = 256;
desc.fConfig = kRGBA_8888_GrPixelConfig;
- SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(desc, true, NULL, 0));
+ SkAutoTUnref<GrTexture> readTex(context->textureProvider()->createTexture(desc, true, nullptr, 0));
if (!readTex.get()) {
return;
}
- SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(desc, true, NULL, 0));
+ SkAutoTUnref<GrTexture> tempTex(context->textureProvider()->createTexture(desc, true, nullptr, 0));
if (!tempTex.get()) {
return;
}
@@ -303,7 +303,7 @@
kBGRA_8888_GrPixelConfig != texture->config() &&
kNone_PMConversion != pmConversion) {
// The PM conversions assume colors are 0..255
- return NULL;
+ return nullptr;
}
return new GrConfigConversionEffect(procDataManager, texture, swapRedAndBlue, pmConversion,
matrix);
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 92ec518..2504fd4 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -71,7 +71,7 @@
d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
fp = AARectEffect::Create(edgeType, rect);
- } while (NULL == fp);
+ } while (nullptr == fp);
return fp;
}
@@ -243,15 +243,15 @@
GrFragmentProcessor* GrConvexPolyEffect::Create(GrPrimitiveEdgeType type, const SkPath& path,
const SkVector* offset) {
if (kHairlineAA_GrProcessorEdgeType == type) {
- return NULL;
+ return nullptr;
}
if (path.getSegmentMasks() != SkPath::kLine_SegmentMask ||
!path.isConvex()) {
- return NULL;
+ return nullptr;
}
if (path.countPoints() > kMaxEdges) {
- return NULL;
+ return nullptr;
}
SkPoint pts[kMaxEdges];
@@ -261,7 +261,7 @@
SkAssertResult(SkPathPriv::CheapComputeFirstDirection(path, &dir));
SkVector t;
- if (NULL == offset) {
+ if (nullptr == offset) {
t.set(0, 0);
} else {
t = *offset;
@@ -293,7 +293,7 @@
GrFragmentProcessor* GrConvexPolyEffect::Create(GrPrimitiveEdgeType edgeType, const SkRect& rect) {
if (kHairlineAA_GrProcessorEdgeType == edgeType){
- return NULL;
+ return nullptr;
}
return AARectEffect::Create(edgeType, rect);
}
@@ -351,6 +351,6 @@
GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
fp = GrConvexPolyEffect::Create(edgeType, count, edges);
- } while (NULL == fp);
+ } while (nullptr == fp);
return fp;
}
diff --git a/src/gpu/effects/GrConvexPolyEffect.h b/src/gpu/effects/GrConvexPolyEffect.h
index 68cd9ec..9e7f154 100644
--- a/src/gpu/effects/GrConvexPolyEffect.h
+++ b/src/gpu/effects/GrConvexPolyEffect.h
@@ -41,18 +41,18 @@
static GrFragmentProcessor* Create(GrPrimitiveEdgeType edgeType, int n,
const SkScalar edges[]) {
if (n <= 0 || n > kMaxEdges || kHairlineAA_GrProcessorEdgeType == edgeType) {
- return NULL;
+ return nullptr;
}
return new GrConvexPolyEffect(edgeType, n, edges);
}
/**
* Creates an effect that clips against the path. If the path is not a convex polygon, is
- * inverse filled, or has too many edges, this will return NULL. If offset is non-NULL, then
+ * inverse filled, or has too many edges, this will return nullptr. If offset is non-nullptr, then
* the path is translated by the vector.
*/
static GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkPath&,
- const SkVector* offset = NULL);
+ const SkVector* offset = nullptr);
/**
* Creates an effect that fills inside the rect with AA edges..
diff --git a/src/gpu/effects/GrCoverageSetOpXP.cpp b/src/gpu/effects/GrCoverageSetOpXP.cpp
index 8a7c83b..8c45d22 100644
--- a/src/gpu/effects/GrCoverageSetOpXP.cpp
+++ b/src/gpu/effects/GrCoverageSetOpXP.cpp
@@ -216,7 +216,7 @@
break;
}
default:
- return NULL;
+ return nullptr;
}
}
@@ -231,7 +231,7 @@
// modulation table. Note that an inverted table still won't work if there are coverage procs.
if (fInvertCoverage && hasMixedSamples) {
SkASSERT(false);
- return NULL;
+ return nullptr;
}
return CoverageSetOpXP::Create(fRegionOp, fInvertCoverage);
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 1fcdb12..58591e5 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -298,7 +298,7 @@
const char* inputColor,
const char* dstColor) {
// We don't try to optimize for this case at all
- if (NULL == inputColor) {
+ if (nullptr == inputColor) {
fsBuilder->codeAppendf("const vec4 ones = vec4(1);");
inputColor = "ones";
}
@@ -434,7 +434,7 @@
GrFragmentProcessor* GrCustomXfermode::CreateFP(GrProcessorDataManager* procDataManager,
SkXfermode::Mode mode, GrTexture* background) {
if (!GrCustomXfermode::IsSupportedMode(mode)) {
- return NULL;
+ return nullptr;
} else {
return new GrCustomXferFP(procDataManager, mode, background);
}
@@ -569,7 +569,7 @@
GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) {
if (!GrCustomXfermode::IsSupportedMode(mode)) {
- return NULL;
+ return nullptr;
} else {
return new GrCustomXPFactory(mode);
}
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index 89fa423..ed64737 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -103,7 +103,7 @@
// calculates the rotation needed to aligned pts to the x axis with pts[0] < pts[1]
// Stores the rotation matrix in rotMatrix, and the mapped points in ptsRot
-static void align_to_x_axis(const SkPoint pts[2], SkMatrix* rotMatrix, SkPoint ptsRot[2] = NULL) {
+static void align_to_x_axis(const SkPoint pts[2], SkMatrix* rotMatrix, SkPoint ptsRot[2] = nullptr) {
SkVector vec = pts[1] - pts[0];
SkScalar mag = vec.length();
SkScalar inv = mag ? SkScalarInvert(mag) : 0;
@@ -695,7 +695,7 @@
align_to_x_axis(pts, &rotMatrix, geometry.fPtsRot);
if(!rotMatrix.invert(&geometry.fSrcRotInv)) {
SkDebugf("Failed to create invertible rotation matrix!\n");
- return NULL;
+ return nullptr;
}
} else {
geometry.fSrcRotInv.reset();
@@ -1212,7 +1212,7 @@
SkMatrix invert;
if (usesLocalCoords && !viewMatrix.invert(&invert)) {
SkDebugf("Failed to invert\n");
- return NULL;
+ return nullptr;
}
switch (cap) {
@@ -1221,7 +1221,7 @@
case kNonRound_DashCap:
return DashingLineEffect::Create(color, dashAAMode, invert, usesLocalCoords);
}
- return NULL;
+ return nullptr;
}
/////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 5d6df72..d0c1a3f 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -45,7 +45,7 @@
#ifdef SK_GAMMA_APPLY_TO_A8
// adjust based on gamma
- const char* distanceAdjustUniName = NULL;
+ const char* distanceAdjustUniName = nullptr;
// width, height, 1/(3*width)
fDistanceAdjustUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
@@ -222,7 +222,7 @@
, fDistanceAdjust(distanceAdjust)
#endif
, fFlags(flags & kNonLCD_DistanceFieldEffectMask)
- , fInColor(NULL)
+ , fInColor(nullptr)
, fUsesLocalCoords(usesLocalCoords) {
SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask));
this->initClassID<GrDistanceFieldA8TextGeoProc>();
@@ -322,7 +322,7 @@
this->emitTransforms(args.fPB, gpArgs->fPositionVar, dfTexEffect.inPosition()->fName,
args.fTransformsIn, args.fTransformsOut);
- const char* textureSizeUniName = NULL;
+ const char* textureSizeUniName = nullptr;
fTextureSizeUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"TextureSize", &textureSizeUniName);
@@ -446,7 +446,7 @@
, fViewMatrix(viewMatrix)
, fTextureAccess(texture, params)
, fFlags(flags & kNonLCD_DistanceFieldEffectMask)
- , fInColor(NULL)
+ , fInColor(nullptr)
, fUsesLocalCoords(usesLocalCoords) {
SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask));
this->initClassID<GrDistanceFieldPathGeoProc>();
@@ -606,7 +606,7 @@
"vec3(" SK_DistanceFieldMultiplier ")*(distance - vec3(" SK_DistanceFieldThreshold"));");
// adjust width based on gamma
- const char* distanceAdjustUniName = NULL;
+ const char* distanceAdjustUniName = nullptr;
fDistanceAdjustUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision,
"DistanceAdjust", &distanceAdjustUniName);
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index dec6ae2..0f3df7d 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -360,7 +360,7 @@
GrFragmentProcessor* GrOvalEffect::Create(GrPrimitiveEdgeType edgeType, const SkRect& oval) {
if (kHairlineAA_GrProcessorEdgeType == edgeType) {
- return NULL;
+ return nullptr;
}
SkScalar w = oval.width();
SkScalar h = oval.height();
@@ -373,5 +373,5 @@
return EllipseEffect::Create(edgeType, SkPoint::Make(oval.fLeft + w, oval.fTop + h), w, h);
}
- return NULL;
+ return nullptr;
}
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
index 4a86aab..ff857f4 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
@@ -600,11 +600,11 @@
GrXferProcessor* PDLCDXferProcessor::Create(SkXfermode::Mode xfermode,
const GrProcOptInfo& colorPOI) {
if (SkXfermode::kSrcOver_Mode != xfermode) {
- return NULL;
+ return nullptr;
}
if (kRGBA_GrColorComponentFlags != colorPOI.validFlags()) {
- return NULL;
+ return nullptr;
}
GrColor blendConstant = GrUnPreMulColor(colorPOI.color());
@@ -673,7 +673,7 @@
GR_STATIC_ASSERT(SK_ARRAY_COUNT(gFactories) == SkXfermode::kLastCoeffMode + 1);
if (xfermode < 0 || xfermode > SkXfermode::kLastCoeffMode) {
- return NULL;
+ return nullptr;
}
return SkRef(gFactories[xfermode]);
}
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index 62c6d3b..af0f1fc 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -79,7 +79,7 @@
uint32_t circularCornerFlags,
const SkRRect& rrect) {
if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdgeType != edgeType) {
- return NULL;
+ return nullptr;
}
return new CircularRRectEffect(edgeType, circularCornerFlags, rrect);
}
@@ -118,7 +118,7 @@
GrPrimitiveEdgeType et =
(GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
fp = GrRRectEffect::Create(et, rrect);
- } while (NULL == fp);
+ } while (nullptr == fp);
return fp;
}
@@ -407,7 +407,7 @@
GrFragmentProcessor*
EllipticalRRectEffect::Create(GrPrimitiveEdgeType edgeType, const SkRRect& rrect) {
if (kFillAA_GrProcessorEdgeType != edgeType && kInverseFillAA_GrProcessorEdgeType != edgeType) {
- return NULL;
+ return nullptr;
}
return new EllipticalRRectEffect(edgeType, rrect);
}
@@ -464,7 +464,7 @@
GrPrimitiveEdgeType et =
(GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
fp = GrRRectEffect::Create(et, rrect);
- } while (NULL == fp);
+ } while (nullptr == fp);
return fp;
}
@@ -706,15 +706,15 @@
// If we got here then we squashed some but not all the radii to zero. (If all
// had been squashed cornerFlags would be 0.) The elliptical effect doesn't
// support some rounded and some square corners.
- return NULL;
+ return nullptr;
}
if (rrect.isNinePatch()) {
return EllipticalRRectEffect::Create(edgeType, rrect);
}
- return NULL;
+ return nullptr;
}
}
}
- return NULL;
+ return nullptr;
}
diff --git a/src/gpu/effects/GrRRectEffect.h b/src/gpu/effects/GrRRectEffect.h
index d3901f3..63e08a4 100644
--- a/src/gpu/effects/GrRRectEffect.h
+++ b/src/gpu/effects/GrRRectEffect.h
@@ -18,7 +18,7 @@
namespace GrRRectEffect {
/**
* Creates an effect that performs anti-aliased clipping against a SkRRect. It doesn't support
- * all varieties of SkRRect so the caller must check for a NULL return.
+ * all varieties of SkRRect so the caller must check for a nullptr return.
*/
GrFragmentProcessor* Create(GrPrimitiveEdgeType, const SkRRect&);
};
diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h
index 11760fb..f4c5e9c 100644
--- a/src/gpu/effects/GrTextureDomain.h
+++ b/src/gpu/effects/GrTextureDomain.h
@@ -108,7 +108,7 @@
* @param outcolor name of vec4 variable to hold the sampled color.
* @param inCoords name of vec2 variable containing the coords to be used with the domain.
* It is assumed that this is a variable and not an expression.
- * @param inModulateColor if non-NULL the sampled color will be modulated with this
+ * @param inModulateColor if non-nullptr the sampled color will be modulated with this
* expression before being written to outColor.
*/
void sampleTexture(GrGLShaderBuilder* builder,
@@ -116,7 +116,7 @@
const char* outColor,
const SkString& inCoords,
const GrGLProcessor::TextureSampler sampler,
- const char* inModulateColor = NULL);
+ const char* inModulateColor = nullptr);
/**
* Call this from GrGLProcessor::setData() to upload uniforms necessary for the texture
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index 6aeaf6f..ca688d8 100644
--- a/src/gpu/effects/GrTextureStripAtlas.cpp
+++ b/src/gpu/effects/GrTextureStripAtlas.cpp
@@ -22,11 +22,11 @@
int32_t GrTextureStripAtlas::gCacheCount = 0;
-GrTextureStripAtlas::Hash* GrTextureStripAtlas::gAtlasCache = NULL;
+GrTextureStripAtlas::Hash* GrTextureStripAtlas::gAtlasCache = nullptr;
GrTextureStripAtlas::Hash* GrTextureStripAtlas::GetCache() {
- if (NULL == gAtlasCache) {
+ if (nullptr == gAtlasCache) {
gAtlasCache = new Hash;
}
@@ -47,13 +47,13 @@
if (0 == GetCache()->count()) {
delete gAtlasCache;
- gAtlasCache = NULL;
+ gAtlasCache = nullptr;
}
}
GrTextureStripAtlas* GrTextureStripAtlas::GetAtlas(const GrTextureStripAtlas::Desc& desc) {
AtlasEntry* entry = GetCache()->find(desc);
- if (NULL == entry) {
+ if (nullptr == entry) {
entry = new AtlasEntry;
entry->fAtlas = new GrTextureStripAtlas(desc);
@@ -72,10 +72,10 @@
, fLockedRows(0)
, fDesc(desc)
, fNumRows(desc.fHeight / desc.fRowHeight)
- , fTexture(NULL)
+ , fTexture(nullptr)
, fRows(new AtlasRow[fNumRows])
- , fLRUFront(NULL)
- , fLRUBack(NULL) {
+ , fLRUFront(nullptr)
+ , fLRUBack(nullptr) {
SkASSERT(fNumRows * fDesc.fRowHeight == fDesc.fHeight);
this->initLRU();
fNormalizedYHeight = SK_Scalar1 / fDesc.fHeight;
@@ -118,11 +118,11 @@
++fLockedRows;
- if (NULL == row) {
+ if (nullptr == row) {
// force a flush, which should unlock all the rows; then try again
fDesc.fContext->flush();
row = this->getLRU();
- if (NULL == row) {
+ if (nullptr == row) {
--fLockedRows;
return -1;
}
@@ -201,8 +201,8 @@
builder.finish();
fTexture = fDesc.fContext->textureProvider()->findAndRefTextureByUniqueKey(key);
- if (NULL == fTexture) {
- fTexture = fDesc.fContext->textureProvider()->createTexture(texDesc, true, NULL, 0);
+ if (nullptr == fTexture) {
+ fTexture = fDesc.fContext->textureProvider()->createTexture(texDesc, true, nullptr, 0);
if (!fTexture) {
return;
}
@@ -217,26 +217,26 @@
void GrTextureStripAtlas::unlockTexture() {
SkASSERT(fTexture && 0 == fLockedRows);
fTexture->unref();
- fTexture = NULL;
+ fTexture = nullptr;
}
void GrTextureStripAtlas::initLRU() {
- fLRUFront = NULL;
- fLRUBack = NULL;
+ fLRUFront = nullptr;
+ fLRUBack = nullptr;
// Initially all the rows are in the LRU list
for (int i = 0; i < fNumRows; ++i) {
fRows[i].fKey = kEmptyAtlasRowKey;
- fRows[i].fNext = NULL;
- fRows[i].fPrev = NULL;
+ fRows[i].fNext = nullptr;
+ fRows[i].fPrev = nullptr;
this->appendLRU(fRows + i);
}
- SkASSERT(NULL == fLRUFront || NULL == fLRUFront->fPrev);
- SkASSERT(NULL == fLRUBack || NULL == fLRUBack->fNext);
+ SkASSERT(nullptr == fLRUFront || nullptr == fLRUFront->fPrev);
+ SkASSERT(nullptr == fLRUBack || nullptr == fLRUBack->fNext);
}
void GrTextureStripAtlas::appendLRU(AtlasRow* row) {
- SkASSERT(NULL == row->fPrev && NULL == row->fNext);
- if (NULL == fLRUFront && NULL == fLRUBack) {
+ SkASSERT(nullptr == row->fPrev && nullptr == row->fNext);
+ if (nullptr == fLRUFront && nullptr == fLRUBack) {
fLRUFront = row;
fLRUBack = row;
} else {
@@ -252,23 +252,23 @@
row->fPrev->fNext = row->fNext;
row->fNext->fPrev = row->fPrev;
} else {
- if (NULL == row->fNext) {
+ if (nullptr == row->fNext) {
SkASSERT(row == fLRUBack);
fLRUBack = row->fPrev;
if (fLRUBack) {
- fLRUBack->fNext = NULL;
+ fLRUBack->fNext = nullptr;
}
}
- if (NULL == row->fPrev) {
+ if (nullptr == row->fPrev) {
SkASSERT(row == fLRUFront);
fLRUFront = row->fNext;
if (fLRUFront) {
- fLRUFront->fPrev = NULL;
+ fLRUFront->fPrev = nullptr;
}
}
}
- row->fNext = NULL;
- row->fPrev = NULL;
+ row->fNext = nullptr;
+ row->fPrev = nullptr;
}
int GrTextureStripAtlas::searchByKey(uint32_t key) {
@@ -294,10 +294,10 @@
int lruCount = 0;
// Validate LRU pointers, and count LRU entries
- SkASSERT(NULL == fLRUFront || NULL == fLRUFront->fPrev);
- SkASSERT(NULL == fLRUBack || NULL == fLRUBack->fNext);
- for (AtlasRow* r = fLRUFront; r != NULL; r = r->fNext) {
- if (NULL == r->fNext) {
+ SkASSERT(nullptr == fLRUFront || nullptr == fLRUFront->fPrev);
+ SkASSERT(nullptr == fLRUBack || nullptr == fLRUBack->fNext);
+ for (AtlasRow* r = fLRUFront; r != nullptr; r = r->fNext) {
+ if (nullptr == r->fNext) {
SkASSERT(r == fLRUBack);
} else {
SkASSERT(r->fNext->fPrev == r);
@@ -314,7 +314,7 @@
++freeRows;
bool inLRU = false;
// Step through the LRU and make sure it's present
- for (AtlasRow* r = fLRUFront; r != NULL; r = r->fNext) {
+ for (AtlasRow* r = fLRUFront; r != nullptr; r = r->fNext) {
if (r == &fRows[i]) {
inLRU = true;
break;
@@ -341,7 +341,7 @@
// If we have locked rows, we should have a locked texture, otherwise
// it should be unlocked
if (fLockedRows == 0) {
- SkASSERT(NULL == fTexture);
+ SkASSERT(nullptr == fTexture);
} else {
SkASSERT(fTexture);
}
diff --git a/src/gpu/effects/GrTextureStripAtlas.h b/src/gpu/effects/GrTextureStripAtlas.h
index 98ac52a..91ce61c 100644
--- a/src/gpu/effects/GrTextureStripAtlas.h
+++ b/src/gpu/effects/GrTextureStripAtlas.h
@@ -83,7 +83,7 @@
* together to represent LRU status
*/
struct AtlasRow : SkNoncopyable {
- AtlasRow() : fKey(kEmptyAtlasRowKey), fLocks(0), fNext(NULL), fPrev(NULL) { }
+ AtlasRow() : fKey(kEmptyAtlasRowKey), fLocks(0), fNext(nullptr), fPrev(nullptr) { }
// GenerationID of the bitmap that is represented by this row, 0xffffffff means "empty"
uint32_t fKey;
// How many times this has been locked (0 == unlocked)
@@ -107,7 +107,7 @@
void initLRU();
/**
- * Grabs the least recently used free row out of the LRU list, returns NULL if no rows are free.
+ * Grabs the least recently used free row out of the LRU list, returns nullptr if no rows are free.
*/
AtlasRow* getLRU();
@@ -145,7 +145,7 @@
static uint32_t Hash(const Desc& desc) { return SkChecksum::Murmur3(&desc, sizeof(Desc)); }
// AtlasEntry proper
- AtlasEntry() : fAtlas(NULL) {}
+ AtlasEntry() : fAtlas(nullptr) {}
~AtlasEntry() { delete fAtlas; }
Desc fDesc;
GrTextureStripAtlas* fAtlas;
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp
index 84be8c3..ba975f7 100644
--- a/src/gpu/effects/GrYUVtoRGBEffect.cpp
+++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp
@@ -64,7 +64,7 @@
virtual void emitCode(EmitArgs& args) override {
GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
- const char* yuvMatrix = NULL;
+ const char* yuvMatrix = nullptr;
fMatrixUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kMat44f_GrSLType, kDefault_GrSLPrecision,
"YUVMatrix", &yuvMatrix);