"NULL !=" = NULL
R=reed@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/544233002
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 085ad2b..f1fd407 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -131,7 +131,7 @@
} // namespace
static void add_genID_listener(GrResourceKey key, SkPixelRef* pixelRef) {
- SkASSERT(NULL != pixelRef);
+ SkASSERT(pixelRef);
pixelRef->addGenIDChangeListener(SkNEW_ARGS(GrResourceInvalidator, (key)));
}
@@ -188,7 +188,7 @@
GrResourceKey key;
GrTexture* result = ctx->createTexture(params, desc, cacheID, bytes, 0, &key);
- if (NULL != result) {
+ if (result) {
add_genID_listener(key, bm.pixelRef());
}
return result;
@@ -250,7 +250,7 @@
GrResourceKey key;
result = ctx->createTexture(params, rtDesc, cacheID, NULL, 0, &key);
GrRenderTarget* renderTarget = result ? result->asRenderTarget() : NULL;
- if (NULL != renderTarget) {
+ if (renderTarget) {
add_genID_listener(key, bm.pixelRef());
SkAutoTUnref<GrEffect> yuvToRgbEffect(GrYUVtoRGBEffect::Create(
yuvTextures[0].texture(), yuvTextures[1].texture(), yuvTextures[2].texture()));
@@ -301,7 +301,7 @@
GrResourceKey key;
GrTexture* result = ctx->createTexture(params, desc, cacheID,
storage.get(), bitmap->width(), &key);
- if (NULL != result) {
+ if (result) {
add_genID_listener(key, origBitmap.pixelRef());
}
return result;
@@ -336,7 +336,7 @@
// data is.
&& !(bitmap->readyToDraw())) {
GrTexture *texture = load_etc1_texture(ctx, params, *bitmap, desc);
- if (NULL != texture) {
+ if (texture) {
return texture;
}
}
@@ -344,7 +344,7 @@
else {
GrTexture *texture = load_yuv_texture(ctx, params, *bitmap, desc);
- if (NULL != texture) {
+ if (texture) {
return texture;
}
}
@@ -360,7 +360,7 @@
GrResourceKey key;
GrTexture* result = ctx->createTexture(params, desc, cacheID,
bitmap->getPixels(), bitmap->rowBytes(), &key);
- if (NULL != result) {
+ if (result) {
add_genID_listener(key, origBitmap.pixelRef());
}
return result;
@@ -420,7 +420,7 @@
}
void GrUnlockAndUnrefCachedBitmapTexture(GrTexture* texture) {
- SkASSERT(NULL != texture->getContext());
+ SkASSERT(texture->getContext());
texture->getContext()->unlockScratchTexture(texture);
texture->unref();
@@ -495,7 +495,7 @@
SkXfermode* mode = skPaint.getXfermode();
GrEffect* xferEffect = NULL;
if (SkXfermode::AsNewEffectOrCoeff(mode, &xferEffect, &sm, &dm)) {
- if (NULL != xferEffect) {
+ if (xferEffect) {
grPaint->addColorEffect(xferEffect)->unref();
sm = SkXfermode::kOne_Coeff;
dm = SkXfermode::kZero_Coeff;
@@ -512,7 +512,7 @@
grPaint->setColor(paintColor);
SkColorFilter* colorFilter = skPaint.getColorFilter();
- if (NULL != colorFilter) {
+ if (colorFilter) {
// if the source color is a constant then apply the filter here once rather than per pixel
// in a shader.
if (constantColor) {
@@ -520,7 +520,7 @@
grPaint->setColor(SkColor2GrColor(filtered));
} else {
SkAutoTUnref<GrEffect> effect(colorFilter->asNewEffect(context));
- if (NULL != effect.get()) {
+ if (effect.get()) {
grPaint->addColorEffect(effect);
}
}
@@ -532,7 +532,7 @@
if (skPaint.isDither() && grPaint->numColorStages() > 0) {
// What are we rendering into?
const GrRenderTarget *target = context->getRenderTarget();
- SkASSERT(NULL != target);
+ SkASSERT(target);
// Suspect the dithering flag has no effect on these configs, otherwise
// fall back on setting the appropriate state.
@@ -541,7 +541,7 @@
// The dither flag is set and the target is likely
// not going to be dithered by the GPU.
SkAutoTUnref<GrEffect> effect(GrDitherEffect::Create());
- if (NULL != effect.get()) {
+ if (effect.get()) {
grPaint->addColorEffect(effect);
grPaint->setDither(false);
}
@@ -562,7 +562,7 @@
fContext = context;
}
~AutoMatrix() {
- SkASSERT(NULL != fContext);
+ SkASSERT(fContext);
fContext->setMatrix(fMatrix);
}
private:
@@ -595,7 +595,7 @@
// Allow the shader to modify paintColor and also create an effect to be installed as
// the first color effect on the GrPaint.
GrEffect* effect = NULL;
- if (shader->asNewEffect(context, skPaint, NULL, &paintColor, &effect) && NULL != effect) {
+ if (shader->asNewEffect(context, skPaint, NULL, &paintColor, &effect) && effect) {
grPaint->addColorEffect(effect)->unref();
constantColor = false;
}