diff options
author | keyar@chromium.org <keyar@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-20 15:03:44 +0000 |
---|---|---|
committer | keyar@chromium.org <keyar@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-20 15:03:44 +0000 |
commit | 78a35c5f1dcc00b2b442069a94f9e7c996f8d7f9 (patch) | |
tree | 4c5556d43cbff4d71d13f40a3d65d31883fbced5 | |
parent | fe6391a624f98b1c70581ac86d5733afe11872d3 (diff) |
Changed to Yoda style comparisons where appropriate.
git-svn-id: http://skia.googlecode.com/svn/trunk@5176 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | tools/PictureBenchmark.cpp | 10 | ||||
-rw-r--r-- | tools/PictureRenderer.cpp | 18 | ||||
-rw-r--r-- | tools/PictureRenderer.h | 4 | ||||
-rw-r--r-- | tools/bench_pictures_main.cpp | 2 |
4 files changed, 17 insertions, 17 deletions
diff --git a/tools/PictureBenchmark.cpp b/tools/PictureBenchmark.cpp index 379a79b0d2..bb0d9fc3ea 100644 --- a/tools/PictureBenchmark.cpp +++ b/tools/PictureBenchmark.cpp @@ -17,7 +17,7 @@ namespace sk_tools { void PipePictureBenchmark::run(SkPicture* pict) { SkASSERT(pict); - if (pict == NULL) { + if (NULL == pict) { return; } @@ -45,7 +45,7 @@ void PipePictureBenchmark::run(SkPicture* pict) { void RecordPictureBenchmark::run(SkPicture* pict) { SkASSERT(pict); - if (pict == NULL) { + if (NULL == pict) { return; } @@ -71,7 +71,7 @@ void RecordPictureBenchmark::run(SkPicture* pict) { void SimplePictureBenchmark::run(SkPicture* pict) { SkASSERT(pict); - if (pict == NULL) { + if (NULL == pict) { return; } @@ -99,7 +99,7 @@ void SimplePictureBenchmark::run(SkPicture* pict) { void TiledPictureBenchmark::run(SkPicture* pict) { SkASSERT(pict); - if (pict == NULL) { + if (NULL == pict) { return; } @@ -128,7 +128,7 @@ void TiledPictureBenchmark::run(SkPicture* pict) { void UnflattenPictureBenchmark::run(SkPicture* pict) { SkASSERT(pict); - if (pict == NULL) { + if (NULL == pict) { return; } diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp index e63cd296d8..4142fa4294 100644 --- a/tools/PictureRenderer.cpp +++ b/tools/PictureRenderer.cpp @@ -20,14 +20,14 @@ enum { }; void PictureRenderer::init(SkPicture* pict) { - SkASSERT(fPicture == NULL); - SkASSERT(fCanvas.get() == NULL); - if (fPicture != NULL || fCanvas.get() != NULL) { + SkASSERT(NULL == fPicture); + SkASSERT(NULL == fCanvas.get()); + if (fPicture != NULL || NULL != fCanvas.get()) { return; } SkASSERT(pict != NULL); - if (pict == NULL) { + if (NULL == pict) { return; } @@ -61,7 +61,7 @@ void PictureRenderer::end() { void PipePictureRenderer::render() { SkASSERT(fCanvas.get() != NULL); SkASSERT(fPicture != NULL); - if (fCanvas.get() == NULL || fPicture == NULL) { + if (NULL == fCanvas.get() || NULL == fPicture) { return; } @@ -75,7 +75,7 @@ void PipePictureRenderer::render() { void SimplePictureRenderer::render() { SkASSERT(fCanvas.get() != NULL); SkASSERT(fPicture != NULL); - if (fCanvas.get() == NULL || fPicture == NULL) { + if (NULL == fCanvas.get() || NULL == fPicture) { return; } @@ -88,8 +88,8 @@ TiledPictureRenderer::TiledPictureRenderer() void TiledPictureRenderer::init(SkPicture* pict) { SkASSERT(pict != NULL); - SkASSERT(fTiles.count() == 0); - if (pict == NULL || fTiles.count() != 0) { + SkASSERT(0 == fTiles.count()); + if (NULL == pict || fTiles.count() != 0) { return; } @@ -108,7 +108,7 @@ void TiledPictureRenderer::init(SkPicture* pict) { void TiledPictureRenderer::render() { SkASSERT(fCanvas.get() != NULL); SkASSERT(fPicture != NULL); - if (fCanvas.get() == NULL || fPicture == NULL) { + if (NULL == fCanvas.get() || NULL == fPicture) { return; } diff --git a/tools/PictureRenderer.h b/tools/PictureRenderer.h index 5f8e7917a1..914857d1fd 100644 --- a/tools/PictureRenderer.h +++ b/tools/PictureRenderer.h @@ -38,7 +38,7 @@ public: } bool isUsingBitmapDevice() { - return fDeviceType == kBitmap_DeviceType; + return kBitmap_DeviceType == fDeviceType; } #if SK_SUPPORT_GPU @@ -47,7 +47,7 @@ public: } bool isUsingGpuDevice() { - return fDeviceType == kGPU_DeviceType; + return kGPU_DeviceType == fDeviceType; } #endif diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp index 0521005eb2..5fc1bd8a3b 100644 --- a/tools/bench_pictures_main.cpp +++ b/tools/bench_pictures_main.cpp @@ -182,7 +182,7 @@ static void parse_commandline(int argc, char* const argv[], SkTArray<SkString>* exit(-1); } - if (benchmark == NULL) { + if (NULL == benchmark) { benchmark = SkNEW(sk_tools::SimplePictureBenchmark); } |