diff options
Diffstat (limited to 'src/gpu/effects')
-rw-r--r-- | src/gpu/effects/GrBezierEffect.cpp | 6 | ||||
-rw-r--r-- | src/gpu/effects/GrBezierEffect.h | 18 | ||||
-rw-r--r-- | src/gpu/effects/GrBicubicEffect.h | 4 | ||||
-rw-r--r-- | src/gpu/effects/GrBitmapTextGeoProc.cpp | 2 | ||||
-rw-r--r-- | src/gpu/effects/GrConfigConversionEffect.cpp | 6 | ||||
-rw-r--r-- | src/gpu/effects/GrConvexPolyEffect.cpp | 14 | ||||
-rw-r--r-- | src/gpu/effects/GrConvexPolyEffect.h | 6 | ||||
-rw-r--r-- | src/gpu/effects/GrCoverageSetOpXP.cpp | 4 | ||||
-rw-r--r-- | src/gpu/effects/GrCustomXfermode.cpp | 6 | ||||
-rw-r--r-- | src/gpu/effects/GrDashingEffect.cpp | 8 | ||||
-rw-r--r-- | src/gpu/effects/GrDistanceFieldGeoProc.cpp | 10 | ||||
-rw-r--r-- | src/gpu/effects/GrOvalEffect.cpp | 4 | ||||
-rw-r--r-- | src/gpu/effects/GrPorterDuffXferProcessor.cpp | 6 | ||||
-rw-r--r-- | src/gpu/effects/GrRRectEffect.cpp | 14 | ||||
-rw-r--r-- | src/gpu/effects/GrRRectEffect.h | 2 | ||||
-rw-r--r-- | src/gpu/effects/GrTextureDomain.h | 4 | ||||
-rw-r--r-- | src/gpu/effects/GrTextureStripAtlas.cpp | 64 | ||||
-rw-r--r-- | src/gpu/effects/GrTextureStripAtlas.h | 6 | ||||
-rw-r--r-- | src/gpu/effects/GrYUVtoRGBEffect.cpp | 2 |
19 files changed, 93 insertions, 93 deletions
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp index 23f18998d1..92cf9a2594 100644 --- a/src/gpu/effects/GrBezierEffect.cpp +++ b/src/gpu/effects/GrBezierEffect.cpp @@ -226,7 +226,7 @@ GrGeometryProcessor* GrConicEffect::TestCreate(GrProcessorTestData* d) { 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 @@ GrGeometryProcessor* GrQuadEffect::TestCreate(GrProcessorTestData* d) { edgeType, *d->fCaps, GrTest::TestMatrix(d->fRandom), d->fRandom->nextBool()); - } while (NULL == gp); + } while (nullptr == gp); return gp; } @@ -653,7 +653,7 @@ GrGeometryProcessor* GrCubicEffect::TestCreate(GrProcessorTestData* d) { 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 b78c3f3113..1c76c64f5b 100644 --- a/src/gpu/effects/GrBezierEffect.h +++ b/src/gpu/effects/GrBezierEffect.h @@ -68,13 +68,13 @@ public: 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 @@ public: return new GrConicEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType, localMatrix, usesLocalCoords); default: - return NULL; + return nullptr; } } @@ -151,13 +151,13 @@ public: 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 @@ public: return new GrQuadEffect(color, viewMatrix, coverage, kFillBW_GrProcessorEdgeType, localMatrix, usesLocalCoords); default: - return NULL; + return nullptr; } } @@ -233,18 +233,18 @@ public: 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 ff2d60e431..18382a3a7d 100644 --- a/src/gpu/effects/GrBicubicEffect.h +++ b/src/gpu/effects/GrBicubicEffect.h @@ -34,8 +34,8 @@ public: */ 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 3b4f24cb62..85d08629ac 100644 --- a/src/gpu/effects/GrBitmapTextGeoProc.cpp +++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp @@ -127,7 +127,7 @@ GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture, , 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 cee0f2f02b..838dc1ccea 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -182,11 +182,11 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context 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 @@ const GrFragmentProcessor* GrConfigConversionEffect::Create(GrProcessorDataManag 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 92ec518a76..2504fd4ccc 100644 --- a/src/gpu/effects/GrConvexPolyEffect.cpp +++ b/src/gpu/effects/GrConvexPolyEffect.cpp @@ -71,7 +71,7 @@ GrFragmentProcessor* AARectEffect::TestCreate(GrProcessorTestData* d) { d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt)); fp = AARectEffect::Create(edgeType, rect); - } while (NULL == fp); + } while (nullptr == fp); return fp; } @@ -243,15 +243,15 @@ void GrGLConvexPolyEffect::GenKey(const GrProcessor& processor, const GrGLSLCaps 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 @@ GrFragmentProcessor* GrConvexPolyEffect::Create(GrPrimitiveEdgeType type, const 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 type, const 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 @@ GrFragmentProcessor* GrConvexPolyEffect::TestCreate(GrProcessorTestData* d) { 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 68cd9ecc99..9e7f1542c2 100644 --- a/src/gpu/effects/GrConvexPolyEffect.h +++ b/src/gpu/effects/GrConvexPolyEffect.h @@ -41,18 +41,18 @@ public: 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 8a7c83bbfb..8c45d22727 100644 --- a/src/gpu/effects/GrCoverageSetOpXP.cpp +++ b/src/gpu/effects/GrCoverageSetOpXP.cpp @@ -216,7 +216,7 @@ GrXPFactory* GrCoverageSetOpXPFactory::Create(SkRegion::Op regionOp, bool invert break; } default: - return NULL; + return nullptr; } } @@ -231,7 +231,7 @@ GrCoverageSetOpXPFactory::onCreateXferProcessor(const GrCaps& caps, // 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 1fcdb12d2b..58591e5810 100644 --- a/src/gpu/effects/GrCustomXfermode.cpp +++ b/src/gpu/effects/GrCustomXfermode.cpp @@ -298,7 +298,7 @@ static void emit_custom_xfermode_code(SkXfermode::Mode mode, 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 @@ static void emit_custom_xfermode_code(SkXfermode::Mode mode, 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 @@ private: 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 89fa423deb..ed6473796d 100644 --- a/src/gpu/effects/GrDashingEffect.cpp +++ b/src/gpu/effects/GrDashingEffect.cpp @@ -103,7 +103,7 @@ static void calc_dash_scaling(SkScalar* parallelScale, SkScalar* perpScale, // 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 @@ static GrDrawBatch* create_batch(GrColor color, const SkMatrix& viewMatrix, cons 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 @@ static GrGeometryProcessor* create_dash_gp(GrColor color, SkMatrix invert; if (usesLocalCoords && !viewMatrix.invert(&invert)) { SkDebugf("Failed to invert\n"); - return NULL; + return nullptr; } switch (cap) { @@ -1221,7 +1221,7 @@ static GrGeometryProcessor* create_dash_gp(GrColor color, 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 5d6df72951..d0c1a3fcd8 100644 --- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp +++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp @@ -45,7 +45,7 @@ public: #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 @@ GrDistanceFieldA8TextGeoProc::GrDistanceFieldA8TextGeoProc(GrColor color, , fDistanceAdjust(distanceAdjust) #endif , fFlags(flags & kNonLCD_DistanceFieldEffectMask) - , fInColor(NULL) + , fInColor(nullptr) , fUsesLocalCoords(usesLocalCoords) { SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask)); this->initClassID<GrDistanceFieldA8TextGeoProc>(); @@ -322,7 +322,7 @@ public: 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 @@ GrDistanceFieldPathGeoProc::GrDistanceFieldPathGeoProc( , 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 @@ public: "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 dec6ae2bad..0f3df7d66c 100644 --- a/src/gpu/effects/GrOvalEffect.cpp +++ b/src/gpu/effects/GrOvalEffect.cpp @@ -360,7 +360,7 @@ GrGLFragmentProcessor* EllipseEffect::onCreateGLInstance() const { 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 @@ GrFragmentProcessor* GrOvalEffect::Create(GrPrimitiveEdgeType edgeType, const Sk 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 4a86aab9c9..ff857f4e0d 100644 --- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp +++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp @@ -600,11 +600,11 @@ PDLCDXferProcessor::PDLCDXferProcessor(GrColor blendConstant, uint8_t alpha) 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 @@ GrXPFactory* GrPorterDuffXPFactory::Create(SkXfermode::Mode xfermode) { 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 62c6d3bf49..af0f1fc8fd 100644 --- a/src/gpu/effects/GrRRectEffect.cpp +++ b/src/gpu/effects/GrRRectEffect.cpp @@ -79,7 +79,7 @@ GrFragmentProcessor* CircularRRectEffect::Create(GrPrimitiveEdgeType edgeType, 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 @@ GrFragmentProcessor* CircularRRectEffect::TestCreate(GrProcessorTestData* d) { GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt); fp = GrRRectEffect::Create(et, rrect); - } while (NULL == fp); + } while (nullptr == fp); return fp; } @@ -407,7 +407,7 @@ private: 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 @@ GrFragmentProcessor* EllipticalRRectEffect::TestCreate(GrProcessorTestData* d) { GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt); fp = GrRRectEffect::Create(et, rrect); - } while (NULL == fp); + } while (nullptr == fp); return fp; } @@ -706,15 +706,15 @@ GrFragmentProcessor* GrRRectEffect::Create(GrPrimitiveEdgeType edgeType, const S // 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 d3901f3933..63e08a4424 100644 --- a/src/gpu/effects/GrRRectEffect.h +++ b/src/gpu/effects/GrRRectEffect.h @@ -18,7 +18,7 @@ class SkRRect; 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 11760fb62b..f4c5e9cb06 100644 --- a/src/gpu/effects/GrTextureDomain.h +++ b/src/gpu/effects/GrTextureDomain.h @@ -108,7 +108,7 @@ public: * @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 @@ public: 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 6aeaf6f184..ca688d821b 100644 --- a/src/gpu/effects/GrTextureStripAtlas.cpp +++ b/src/gpu/effects/GrTextureStripAtlas.cpp @@ -22,11 +22,11 @@ class GrTextureStripAtlas::Hash : public SkTDynamicHash<GrTextureStripAtlas::Atl 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 @@ void GrTextureStripAtlas::CleanUp(const GrContext*, void* info) { 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 @@ GrTextureStripAtlas::GrTextureStripAtlas(GrTextureStripAtlas::Desc desc) , 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 @@ int GrTextureStripAtlas::lockRow(const SkBitmap& data) { ++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 @@ void GrTextureStripAtlas::lockTexture() { 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::lockTexture() { 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 @@ void GrTextureStripAtlas::removeFromLRU(AtlasRow* row) { 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 @@ void GrTextureStripAtlas::validate() { 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 @@ void GrTextureStripAtlas::validate() { ++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 @@ void GrTextureStripAtlas::validate() { // 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 98ac52a2d0..91ce61c232 100644 --- a/src/gpu/effects/GrTextureStripAtlas.h +++ b/src/gpu/effects/GrTextureStripAtlas.h @@ -83,7 +83,7 @@ private: * 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 @@ private: 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 @@ private: 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 84be8c3b4f..ba975f7c02 100644 --- a/src/gpu/effects/GrYUVtoRGBEffect.cpp +++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp @@ -64,7 +64,7 @@ public: 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); |