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

Unified Diff: bench/ETCBitmapBench.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 4 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 | « bench/DecodingBench.cpp ('k') | bench/FontCacheBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « bench/DecodingBench.cpp ('k') | bench/FontCacheBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698