diff options
author | bsalomon <bsalomon@google.com> | 2014-09-05 13:34:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-05 13:34:00 -0700 |
commit | 49f085dddff10473b6ebf832a974288300224e60 (patch) | |
tree | 308a3cac5e1fb053c9e27e7d07213d72eaa05409 /src/utils/debugger | |
parent | 7260d7292bde966f038b8e166f3fe41ddd8f2099 (diff) |
"NULL !=" = NULL
R=reed@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/544233002
Diffstat (limited to 'src/utils/debugger')
-rw-r--r-- | src/utils/debugger/SkDebugCanvas.h | 6 | ||||
-rw-r--r-- | src/utils/debugger/SkDrawCommand.cpp | 52 | ||||
-rw-r--r-- | src/utils/debugger/SkObjectParser.cpp | 2 |
3 files changed, 30 insertions, 30 deletions
diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h index 4bb33b7475..c61627d71d 100644 --- a/src/utils/debugger/SkDebugCanvas.h +++ b/src/utils/debugger/SkDebugCanvas.h @@ -208,7 +208,7 @@ public: virtual bool isClipEmpty() const SK_OVERRIDE { return false; } virtual bool isClipRect() const SK_OVERRIDE { return true; } virtual bool getClipBounds(SkRect* bounds) const SK_OVERRIDE { - if (NULL != bounds) { + if (bounds) { bounds->setXYWH(0, 0, SkIntToScalar(this->imageInfo().width()), SkIntToScalar(this->imageInfo().height())); @@ -216,7 +216,7 @@ public: return true; } virtual bool getClipDeviceBounds(SkIRect* bounds) const SK_OVERRIDE { - if (NULL != bounds) { + if (bounds) { bounds->setLargest(); } return true; @@ -308,7 +308,7 @@ private: size_t getOpID() const { #if 0 - if (NULL != fPicture) { + if (fPicture) { return fPicture->EXPERIMENTAL_curOpID(); } #endif diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp index b9742c3535..0da8f98954 100644 --- a/src/utils/debugger/SkDrawCommand.cpp +++ b/src/utils/debugger/SkDrawCommand.cpp @@ -148,7 +148,7 @@ void render_bitmap(SkCanvas* canvas, const SkBitmap& input, const SkRect* srcRec canvas->clear(0xFFFFFFFF); canvas->drawBitmapRect(input, NULL, dst); - if (NULL != srcRect) { + if (srcRect) { SkRect r = SkRect::MakeLTRB(srcRect->fLeft * xScale + SK_Scalar1, srcRect->fTop * yScale + SK_Scalar1, srcRect->fRight * xScale + SK_Scalar1, @@ -281,7 +281,7 @@ SkDrawBitmapCommand::SkDrawBitmapCommand(const SkBitmap& bitmap, SkScalar left, fBitmap = bitmap; fLeft = left; fTop = top; - if (NULL != paint) { + if (paint) { fPaint = *paint; fPaintPtr = &fPaint; } else { @@ -291,7 +291,7 @@ SkDrawBitmapCommand::SkDrawBitmapCommand(const SkBitmap& bitmap, SkScalar left, fInfo.push(SkObjectParser::BitmapToString(bitmap)); fInfo.push(SkObjectParser::ScalarToString(left, "SkScalar left: ")); fInfo.push(SkObjectParser::ScalarToString(top, "SkScalar top: ")); - if (NULL != paint) { + if (paint) { fInfo.push(SkObjectParser::PaintToString(*paint)); } } @@ -311,7 +311,7 @@ SkDrawBitmapMatrixCommand::SkDrawBitmapMatrixCommand(const SkBitmap& bitmap, : INHERITED(DRAW_BITMAP_MATRIX) { fBitmap = bitmap; fMatrix = matrix; - if (NULL != paint) { + if (paint) { fPaint = *paint; fPaintPtr = &fPaint; } else { @@ -320,7 +320,7 @@ SkDrawBitmapMatrixCommand::SkDrawBitmapMatrixCommand(const SkBitmap& bitmap, fInfo.push(SkObjectParser::BitmapToString(bitmap)); fInfo.push(SkObjectParser::MatrixToString(matrix)); - if (NULL != paint) { + if (paint) { fInfo.push(SkObjectParser::PaintToString(*paint)); } } @@ -340,7 +340,7 @@ SkDrawBitmapNineCommand::SkDrawBitmapNineCommand(const SkBitmap& bitmap, const S fBitmap = bitmap; fCenter = center; fDst = dst; - if (NULL != paint) { + if (paint) { fPaint = *paint; fPaintPtr = &fPaint; } else { @@ -350,7 +350,7 @@ SkDrawBitmapNineCommand::SkDrawBitmapNineCommand(const SkBitmap& bitmap, const S fInfo.push(SkObjectParser::BitmapToString(bitmap)); fInfo.push(SkObjectParser::IRectToString(center)); fInfo.push(SkObjectParser::RectToString(dst, "Dst: ")); - if (NULL != paint) { + if (paint) { fInfo.push(SkObjectParser::PaintToString(*paint)); } } @@ -369,14 +369,14 @@ SkDrawBitmapRectCommand::SkDrawBitmapRectCommand(const SkBitmap& bitmap, const S SkCanvas::DrawBitmapRectFlags flags) : INHERITED(DRAW_BITMAP_RECT_TO_RECT) { fBitmap = bitmap; - if (NULL != src) { + if (src) { fSrc = *src; } else { fSrc.setEmpty(); } fDst = dst; - if (NULL != paint) { + if (paint) { fPaint = *paint; fPaintPtr = &fPaint; } else { @@ -385,11 +385,11 @@ SkDrawBitmapRectCommand::SkDrawBitmapRectCommand(const SkBitmap& bitmap, const S fFlags = flags; fInfo.push(SkObjectParser::BitmapToString(bitmap)); - if (NULL != src) { + if (src) { fInfo.push(SkObjectParser::RectToString(*src, "Src: ")); } fInfo.push(SkObjectParser::RectToString(dst, "Dst: ")); - if (NULL != paint) { + if (paint) { fInfo.push(SkObjectParser::PaintToString(*paint)); } fInfo.push(SkObjectParser::IntToString(fFlags, "Flags: ")); @@ -513,11 +513,11 @@ SkDrawPictureCommand::SkDrawPictureCommand(const SkPicture* picture, , fMatrixPtr(NULL) , fPaintPtr(NULL) { - if (NULL != matrix) { + if (matrix) { fMatrix = *matrix; fMatrixPtr = &fMatrix; } - if (NULL != paint) { + if (paint) { fPaint = *paint; fPaintPtr = &fPaint; } @@ -527,10 +527,10 @@ SkDrawPictureCommand::SkDrawPictureCommand(const SkPicture* picture, picture->cullRect().fLeft, picture->cullRect().fTop, picture->cullRect().fRight, picture->cullRect().fBottom); fInfo.push(temp); - if (NULL != matrix) { + if (matrix) { fInfo.push(SkObjectParser::MatrixToString(*matrix)); } - if (NULL != paint) { + if (paint) { fInfo.push(SkObjectParser::PaintToString(*paint)); } } @@ -739,7 +739,7 @@ SkDrawSpriteCommand::SkDrawSpriteCommand(const SkBitmap& bitmap, int left, int t fBitmap = bitmap; fLeft = left; fTop = top; - if (NULL != paint) { + if (paint) { fPaint = *paint; fPaintPtr = &fPaint; } else { @@ -749,7 +749,7 @@ SkDrawSpriteCommand::SkDrawSpriteCommand(const SkBitmap& bitmap, int left, int t fInfo.push(SkObjectParser::BitmapToString(bitmap)); fInfo.push(SkObjectParser::IntToString(left, "Left: ")); fInfo.push(SkObjectParser::IntToString(top, "Top: ")); - if (NULL != paint) { + if (paint) { fInfo.push(SkObjectParser::PaintToString(*paint)); } } @@ -791,7 +791,7 @@ SkDrawTextOnPathCommand::SkDrawTextOnPathCommand(const void* text, size_t byteLe memcpy(fText, text, byteLength); fByteLength = byteLength; fPath = path; - if (NULL != matrix) { + if (matrix) { fMatrix = *matrix; } else { fMatrix.setIdentity(); @@ -800,7 +800,7 @@ SkDrawTextOnPathCommand::SkDrawTextOnPathCommand(const void* text, size_t byteLe fInfo.push(SkObjectParser::TextToString(text, byteLength, paint.getTextEncoding())); fInfo.push(SkObjectParser::PathToString(path)); - if (NULL != matrix) { + if (matrix) { fInfo.push(SkObjectParser::MatrixToString(*matrix)); } fInfo.push(SkObjectParser::PaintToString(paint)); @@ -825,14 +825,14 @@ SkDrawVerticesCommand::SkDrawVerticesCommand(SkCanvas::VertexMode vmode, int ver fVertices = new SkPoint[vertexCount]; memcpy(fVertices, vertices, vertexCount * sizeof(SkPoint)); - if (NULL != texs) { + if (texs) { fTexs = new SkPoint[vertexCount]; memcpy(fTexs, texs, vertexCount * sizeof(SkPoint)); } else { fTexs = NULL; } - if (NULL != colors) { + if (colors) { fColors = new SkColor[vertexCount]; memcpy(fColors, colors, vertexCount * sizeof(SkColor)); } else { @@ -840,7 +840,7 @@ SkDrawVerticesCommand::SkDrawVerticesCommand(SkCanvas::VertexMode vmode, int ver } fXfermode = xfermode; - if (NULL != fXfermode) { + if (fXfermode) { fXfermode->ref(); } @@ -912,13 +912,13 @@ void SkSaveCommand::trackSaveState(int* state) { SkSaveLayerCommand::SkSaveLayerCommand(const SkRect* bounds, const SkPaint* paint, SkCanvas::SaveFlags flags) : INHERITED(SAVE_LAYER) { - if (NULL != bounds) { + if (bounds) { fBounds = *bounds; } else { fBounds.setEmpty(); } - if (NULL != paint) { + if (paint) { fPaint = *paint; fPaintPtr = &fPaint; } else { @@ -926,10 +926,10 @@ SkSaveLayerCommand::SkSaveLayerCommand(const SkRect* bounds, const SkPaint* pain } fFlags = flags; - if (NULL != bounds) { + if (bounds) { fInfo.push(SkObjectParser::RectToString(*bounds, "Bounds: ")); } - if (NULL != paint) { + if (paint) { fInfo.push(SkObjectParser::PaintToString(*paint)); } fInfo.push(SkObjectParser::SaveFlagsToString(flags)); diff --git a/src/utils/debugger/SkObjectParser.cpp b/src/utils/debugger/SkObjectParser.cpp index a9bad40f71..798db95223 100644 --- a/src/utils/debugger/SkObjectParser.cpp +++ b/src/utils/debugger/SkObjectParser.cpp @@ -174,7 +174,7 @@ SkString* SkObjectParser::PathToString(const SkPath& path) { SkString* boundStr = SkObjectParser::RectToString(path.getBounds(), " Bound: "); - if (NULL != boundStr) { + if (boundStr) { mPath->append(*boundStr); SkDELETE(boundStr); } |