Changed to Yoda style comparisons where appropriate.

git-svn-id: http://skia.googlecode.com/svn/trunk@5176 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
keyar@chromium.org 2012-08-20 15:03:44 +00:00
parent fe6391a624
commit 78a35c5f1d
4 changed files with 17 additions and 17 deletions

View File

@ -17,7 +17,7 @@ namespace sk_tools {
void PipePictureBenchmark::run(SkPicture* pict) { void PipePictureBenchmark::run(SkPicture* pict) {
SkASSERT(pict); SkASSERT(pict);
if (pict == NULL) { if (NULL == pict) {
return; return;
} }
@ -45,7 +45,7 @@ void PipePictureBenchmark::run(SkPicture* pict) {
void RecordPictureBenchmark::run(SkPicture* pict) { void RecordPictureBenchmark::run(SkPicture* pict) {
SkASSERT(pict); SkASSERT(pict);
if (pict == NULL) { if (NULL == pict) {
return; return;
} }
@ -71,7 +71,7 @@ void RecordPictureBenchmark::run(SkPicture* pict) {
void SimplePictureBenchmark::run(SkPicture* pict) { void SimplePictureBenchmark::run(SkPicture* pict) {
SkASSERT(pict); SkASSERT(pict);
if (pict == NULL) { if (NULL == pict) {
return; return;
} }
@ -99,7 +99,7 @@ void SimplePictureBenchmark::run(SkPicture* pict) {
void TiledPictureBenchmark::run(SkPicture* pict) { void TiledPictureBenchmark::run(SkPicture* pict) {
SkASSERT(pict); SkASSERT(pict);
if (pict == NULL) { if (NULL == pict) {
return; return;
} }
@ -128,7 +128,7 @@ void TiledPictureBenchmark::run(SkPicture* pict) {
void UnflattenPictureBenchmark::run(SkPicture* pict) { void UnflattenPictureBenchmark::run(SkPicture* pict) {
SkASSERT(pict); SkASSERT(pict);
if (pict == NULL) { if (NULL == pict) {
return; return;
} }

View File

@ -20,14 +20,14 @@ enum {
}; };
void PictureRenderer::init(SkPicture* pict) { void PictureRenderer::init(SkPicture* pict) {
SkASSERT(fPicture == NULL); SkASSERT(NULL == fPicture);
SkASSERT(fCanvas.get() == NULL); SkASSERT(NULL == fCanvas.get());
if (fPicture != NULL || fCanvas.get() != NULL) { if (fPicture != NULL || NULL != fCanvas.get()) {
return; return;
} }
SkASSERT(pict != NULL); SkASSERT(pict != NULL);
if (pict == NULL) { if (NULL == pict) {
return; return;
} }
@ -61,7 +61,7 @@ void PictureRenderer::end() {
void PipePictureRenderer::render() { void PipePictureRenderer::render() {
SkASSERT(fCanvas.get() != NULL); SkASSERT(fCanvas.get() != NULL);
SkASSERT(fPicture != NULL); SkASSERT(fPicture != NULL);
if (fCanvas.get() == NULL || fPicture == NULL) { if (NULL == fCanvas.get() || NULL == fPicture) {
return; return;
} }
@ -75,7 +75,7 @@ void PipePictureRenderer::render() {
void SimplePictureRenderer::render() { void SimplePictureRenderer::render() {
SkASSERT(fCanvas.get() != NULL); SkASSERT(fCanvas.get() != NULL);
SkASSERT(fPicture != NULL); SkASSERT(fPicture != NULL);
if (fCanvas.get() == NULL || fPicture == NULL) { if (NULL == fCanvas.get() || NULL == fPicture) {
return; return;
} }
@ -88,8 +88,8 @@ TiledPictureRenderer::TiledPictureRenderer()
void TiledPictureRenderer::init(SkPicture* pict) { void TiledPictureRenderer::init(SkPicture* pict) {
SkASSERT(pict != NULL); SkASSERT(pict != NULL);
SkASSERT(fTiles.count() == 0); SkASSERT(0 == fTiles.count());
if (pict == NULL || fTiles.count() != 0) { if (NULL == pict || fTiles.count() != 0) {
return; return;
} }
@ -108,7 +108,7 @@ void TiledPictureRenderer::init(SkPicture* pict) {
void TiledPictureRenderer::render() { void TiledPictureRenderer::render() {
SkASSERT(fCanvas.get() != NULL); SkASSERT(fCanvas.get() != NULL);
SkASSERT(fPicture != NULL); SkASSERT(fPicture != NULL);
if (fCanvas.get() == NULL || fPicture == NULL) { if (NULL == fCanvas.get() || NULL == fPicture) {
return; return;
} }

View File

@ -38,7 +38,7 @@ public:
} }
bool isUsingBitmapDevice() { bool isUsingBitmapDevice() {
return fDeviceType == kBitmap_DeviceType; return kBitmap_DeviceType == fDeviceType;
} }
#if SK_SUPPORT_GPU #if SK_SUPPORT_GPU
@ -47,7 +47,7 @@ public:
} }
bool isUsingGpuDevice() { bool isUsingGpuDevice() {
return fDeviceType == kGPU_DeviceType; return kGPU_DeviceType == fDeviceType;
} }
#endif #endif

View File

@ -182,7 +182,7 @@ static void parse_commandline(int argc, char* const argv[], SkTArray<SkString>*
exit(-1); exit(-1);
} }
if (benchmark == NULL) { if (NULL == benchmark) {
benchmark = SkNEW(sk_tools::SimplePictureBenchmark); benchmark = SkNEW(sk_tools::SimplePictureBenchmark);
} }