Index: bench/ETCBitmapBench.cpp |
diff --git a/bench/ETCBitmapBench.cpp b/bench/ETCBitmapBench.cpp |
index 1cc61e61575249b5fb66722b1e5b5d938aa10d49..5d72bf4c681c826a4d8989059885986642083e0f 100644 |
--- a/bench/ETCBitmapBench.cpp |
+++ b/bench/ETCBitmapBench.cpp |
@@ -19,14 +19,14 @@ |
#include "etc1.h" |
// This takes the etc1 data pointed to by orig, and copies it `factor` times in each |
-// dimension. The return value is the new data or NULL on error. |
+// dimension. The return value is the new data or nullptr on error. |
static etc1_byte* create_expanded_etc1_bitmap(const uint8_t* orig, int factor) { |
SkASSERT(orig); |
SkASSERT(factor > 1); |
const etc1_byte* origData = reinterpret_cast<const etc1_byte*>(orig); |
if (!etc1_pkm_is_valid(orig)) { |
- return NULL; |
+ return nullptr; |
} |
etc1_uint32 origWidth = etc1_pkm_get_width(origData); |
@@ -37,12 +37,12 @@ static etc1_byte* create_expanded_etc1_bitmap(const uint8_t* orig, int factor) { |
static const etc1_uint32 kETC1BlockHeight = 4; |
if ((origWidth % kETC1BlockWidth) != 0 || |
(origHeight % kETC1BlockHeight) != 0) { |
- return NULL; |
+ return nullptr; |
} |
// The picture must be at least as large as a block. |
if (origWidth <= kETC1BlockWidth || origHeight <= kETC1BlockHeight) { |
- return NULL; |
+ return nullptr; |
} |
etc1_uint32 newWidth = origWidth * factor; |
@@ -80,7 +80,7 @@ static etc1_byte* create_expanded_etc1_bitmap(const uint8_t* orig, int factor) { |
class ETCBitmapBenchBase : public Benchmark { |
public: |
ETCBitmapBenchBase() : fPKMData(loadPKM()) { |
- if (NULL == fPKMData) { |
+ if (nullptr == fPKMData) { |
SkDebugf("Could not load PKM data!"); |
} |
} |
@@ -93,17 +93,17 @@ private: |
SkString pkmFilename = GetResourcePath("mandrill_128.pkm"); |
// Expand the data |
SkAutoDataUnref fileData(SkData::NewFromFileName(pkmFilename.c_str())); |
- if (NULL == fileData) { |
+ if (nullptr == fileData) { |
SkDebugf("Could not open the file. Did you forget to set the resourcePath?\n"); |
- return NULL; |
+ return nullptr; |
} |
const etc1_uint32 kExpansionFactor = 8; |
etc1_byte* expandedETC1 = |
create_expanded_etc1_bitmap(fileData->bytes(), kExpansionFactor); |
- if (NULL == expandedETC1) { |
+ if (nullptr == expandedETC1) { |
SkDebugf("Error expanding ETC1 data by factor of %d\n", kExpansionFactor); |
- return NULL; |
+ return nullptr; |
} |
etc1_uint32 width = etc1_pkm_get_width(expandedETC1); |
@@ -145,7 +145,7 @@ protected: |
} |
void onPreDraw() override { |
- if (NULL == fPKMData) { |
+ if (nullptr == fPKMData) { |
SkDebugf("Failed to load PKM data!\n"); |
return; |
} |
@@ -164,7 +164,7 @@ protected: |
void onDraw(const int loops, SkCanvas* canvas) override { |
for (int i = 0; i < loops; ++i) { |
- canvas->drawBitmap(this->fBitmap, 0, 0, NULL); |
+ canvas->drawBitmap(this->fBitmap, 0, 0, nullptr); |
} |
} |
@@ -210,7 +210,7 @@ protected: |
if (pr) { |
pr->notifyPixelsChanged(); |
} |
- canvas->drawBitmap(this->fBitmap, 0, 0, NULL); |
+ canvas->drawBitmap(this->fBitmap, 0, 0, nullptr); |
} |
} |