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

Unified Diff: src/core/SkBitmap.cpp

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 | « src/core/SkBBoxHierarchyRecord.cpp ('k') | src/core/SkBitmapProcState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index adb69da1de9f1b55fa43532ef7ae553eed44a740..e28c6fdc3488ff486d98a338828389d5d2e4f131 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -153,12 +153,12 @@ bool SkBitmap::setAlphaType(SkAlphaType newAlphaType) {
}
void SkBitmap::updatePixelsFromRef() const {
- if (NULL != fPixelRef) {
+ if (fPixelRef) {
if (fPixelLockCount > 0) {
SkASSERT(fPixelRef->isLocked());
void* p = fPixelRef->pixels();
- if (NULL != p) {
+ if (p) {
p = (char*)p
+ fPixelRefOrigin.fY * fRowBytes
+ fPixelRefOrigin.fX * fInfo.bytesPerPixel();
@@ -221,7 +221,7 @@ SkPixelRef* SkBitmap::setPixelRef(SkPixelRef* pr, int dx, int dy) {
}
void SkBitmap::lockPixels() const {
- if (NULL != fPixelRef && 0 == sk_atomic_inc(&fPixelLockCount)) {
+ if (fPixelRef && 0 == sk_atomic_inc(&fPixelLockCount)) {
fPixelRef->lockPixels();
this->updatePixelsFromRef();
}
@@ -231,7 +231,7 @@ void SkBitmap::lockPixels() const {
void SkBitmap::unlockPixels() const {
SkASSERT(NULL == fPixelRef || fPixelLockCount > 0);
- if (NULL != fPixelRef && 1 == sk_atomic_dec(&fPixelLockCount)) {
+ if (fPixelRef && 1 == sk_atomic_dec(&fPixelLockCount)) {
fPixelRef->unlockPixels();
this->updatePixelsFromRef();
}
@@ -376,7 +376,7 @@ bool SkBitmap::installMaskPixels(const SkMask& mask) {
///////////////////////////////////////////////////////////////////////////////
void SkBitmap::freePixels() {
- if (NULL != fPixelRef) {
+ if (fPixelRef) {
if (fPixelLockCount > 0) {
fPixelRef->unlockPixels();
}
@@ -1103,7 +1103,7 @@ bool SkBitmap::extractAlpha(SkBitmap* dst, const SkPaint* paint,
SkMaskFilter* filter = paint ? paint->getMaskFilter() : NULL;
// compute our (larger?) dst bounds if we have a filter
- if (NULL != filter) {
+ if (filter) {
identity.reset();
srcM.fImage = NULL;
if (!filter->filterMask(&dstM, srcM, identity, NULL)) {
@@ -1366,7 +1366,7 @@ void SkBitmap::toString(SkString* str) const {
str->appendf(" pixels:%p", this->getPixels());
} else {
const char* uri = pr->getURI();
- if (NULL != uri) {
+ if (uri) {
str->appendf(" uri:\"%s\"", uri);
} else {
str->appendf(" pixelref:%p", pr);
« no previous file with comments | « src/core/SkBBoxHierarchyRecord.cpp ('k') | src/core/SkBitmapProcState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698