Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: include/gpu/GrContext.h

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrClipData.h ('k') | include/gpu/GrContextFactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 4f9b642b23d86d048ddb7e6101a9092a061494e8..4172543b5eca25fccb8d77cab7935706b3d21950 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -745,7 +745,7 @@ public:
fContext = context;
}
~AutoRenderTarget() {
- if (NULL != fContext) {
+ if (fContext) {
fContext->setRenderTarget(fPrevTarget);
}
SkSafeUnref(fPrevTarget);
@@ -779,7 +779,7 @@ public:
* Initializes by pre-concat'ing the context's current matrix with the preConcat param.
*/
void setPreConcat(GrContext* context, const SkMatrix& preConcat, GrPaint* paint = NULL) {
- SkASSERT(NULL != context);
+ SkASSERT(context);
this->restore();
@@ -793,11 +793,11 @@ public:
* update a paint but the matrix cannot be inverted.
*/
bool setIdentity(GrContext* context, GrPaint* paint = NULL) {
- SkASSERT(NULL != context);
+ SkASSERT(context);
this->restore();
- if (NULL != paint) {
+ if (paint) {
if (!paint->localCoordChangeInverse(context->getMatrix())) {
return false;
}
@@ -813,7 +813,7 @@ public:
* required to update a paint but the matrix cannot be inverted.
*/
bool set(GrContext* context, const SkMatrix& newMatrix, GrPaint* paint = NULL) {
- if (NULL != paint) {
+ if (paint) {
if (!this->setIdentity(context, paint)) {
return false;
}
@@ -835,7 +835,7 @@ public:
* performs an incremental update of the paint.
*/
void preConcat(const SkMatrix& preConcat, GrPaint* paint = NULL) {
- if (NULL != paint) {
+ if (paint) {
paint->localCoordChange(preConcat);
}
fContext->concatMatrix(preConcat);
@@ -845,13 +845,13 @@ public:
* Returns false if never initialized or the inverse matrix was required to update a paint
* but the matrix could not be inverted.
*/
- bool succeeded() const { return NULL != fContext; }
+ bool succeeded() const { return SkToBool(fContext); }
/**
* If this has been initialized then the context's original matrix is restored.
*/
void restore() {
- if (NULL != fContext) {
+ if (fContext) {
fContext->setMatrix(fMatrix);
fContext = NULL;
}
@@ -890,7 +890,7 @@ public:
}
~AutoClip() {
- if (NULL != fContext) {
+ if (fContext) {
fContext->setClip(fOldClip);
}
}
@@ -1091,7 +1091,7 @@ public:
}
void reset() {
- if (NULL != fContext && NULL != fTexture) {
+ if (fContext && fTexture) {
fContext->unlockScratchTexture(fTexture);
fTexture->unref();
fTexture = NULL;
@@ -1124,7 +1124,7 @@ public:
SkASSERT(!texture->unique());
texture->impl()->setFlag((GrTextureFlags) GrTextureImpl::kReturnToCache_FlagBit);
texture->unref();
- SkASSERT(NULL != texture->getCacheEntry());
+ SkASSERT(texture->getCacheEntry());
return texture;
}
@@ -1135,7 +1135,7 @@ public:
this->reset();
fContext = context;
- if (NULL != fContext) {
+ if (fContext) {
fTexture = fContext->lockAndRefScratchTexture(desc, match);
if (NULL == fTexture) {
fContext = NULL;
« no previous file with comments | « include/gpu/GrClipData.h ('k') | include/gpu/GrContextFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698