| Index: tools/render_pictures_main.cpp
|
| diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp
|
| index 8cda9666649017f99f0fcf59fc6a6bef1e38e877..401c205d67d1f3902d29b252d093b14981dd6e04 100644
|
| --- a/tools/render_pictures_main.cpp
|
| +++ b/tools/render_pictures_main.cpp
|
| @@ -112,7 +112,7 @@ static void reset_image_file_base_name(const SkString& name) {
|
| // Remove ".skp"
|
| const char* cName = name.c_str();
|
| const char* dot = strrchr(cName, '.');
|
| - if (dot != NULL) {
|
| + if (dot != nullptr) {
|
| gInputFileName.set(cName, dot - cName);
|
| } else {
|
| gInputFileName.set(name);
|
| @@ -181,7 +181,7 @@ static bool render_picture_internal(const SkString& inputPath, const SkString* w
|
|
|
| SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(&inputStream, proc));
|
|
|
| - if (NULL == picture) {
|
| + if (nullptr == picture) {
|
| SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str());
|
| return false;
|
| }
|
| @@ -190,7 +190,7 @@ static bool render_picture_internal(const SkString& inputPath, const SkString* w
|
| SkPictureRecorder recorder;
|
| picture->playback(recorder.beginRecording(picture->cullRect().width(),
|
| picture->cullRect().height(),
|
| - NULL, 0));
|
| + nullptr, 0));
|
| SkAutoTUnref<SkPicture> other(recorder.endRecording());
|
| }
|
|
|
| @@ -228,7 +228,7 @@ static int MaxByteDiff(uint32_t v1, uint32_t v2) {
|
| class AutoRestoreBbhType {
|
| public:
|
| AutoRestoreBbhType() {
|
| - fRenderer = NULL;
|
| + fRenderer = nullptr;
|
| fSavedBbhType = sk_tools::PictureRenderer::kNone_BBoxHierarchyType;
|
| }
|
|
|
| @@ -254,31 +254,31 @@ private:
|
| * Render the SKP file(s) within inputPath.
|
| *
|
| * @param inputPath path to an individual SKP file, or a directory of SKP files
|
| - * @param writePath if not NULL, write all image(s) generated into this directory
|
| - * @param mismatchPath if not NULL, write any image(s) not matching expectations into this directory
|
| + * @param writePath if not nullptr, write all image(s) generated into this directory
|
| + * @param mismatchPath if not nullptr, write any image(s) not matching expectations into this directory
|
| * @param renderer PictureRenderer to use to render the SKPs
|
| - * @param jsonSummaryPtr if not NULL, add the image(s) generated to this summary
|
| + * @param jsonSummaryPtr if not nullptr, add the image(s) generated to this summary
|
| */
|
| static bool render_picture(const SkString& inputPath, const SkString* writePath,
|
| const SkString* mismatchPath, sk_tools::PictureRenderer& renderer,
|
| sk_tools::ImageResultsAndExpectations *jsonSummaryPtr) {
|
| int diffs[256] = {0};
|
| - SkBitmap* bitmap = NULL;
|
| + SkBitmap* bitmap = nullptr;
|
| renderer.setJsonSummaryPtr(jsonSummaryPtr);
|
| bool success = render_picture_internal(inputPath,
|
| - FLAGS_writeWholeImage ? NULL : writePath,
|
| - FLAGS_writeWholeImage ? NULL : mismatchPath,
|
| + FLAGS_writeWholeImage ? nullptr : writePath,
|
| + FLAGS_writeWholeImage ? nullptr : mismatchPath,
|
| renderer,
|
| - FLAGS_validate || FLAGS_writeWholeImage ? &bitmap : NULL);
|
| + FLAGS_validate || FLAGS_writeWholeImage ? &bitmap : nullptr);
|
|
|
| - if (!success || ((FLAGS_validate || FLAGS_writeWholeImage) && bitmap == NULL)) {
|
| + if (!success || ((FLAGS_validate || FLAGS_writeWholeImage) && bitmap == nullptr)) {
|
| SkDebugf("Failed to draw the picture.\n");
|
| delete bitmap;
|
| return false;
|
| }
|
|
|
| if (FLAGS_validate) {
|
| - SkBitmap* referenceBitmap = NULL;
|
| + SkBitmap* referenceBitmap = nullptr;
|
| sk_tools::PictureRenderer* referenceRenderer;
|
| // If the renderer uses a BBoxHierarchy, then the reference renderer
|
| // will be the same renderer, without the bbh.
|
| @@ -297,10 +297,10 @@ static bool render_picture(const SkString& inputPath, const SkString* writePath,
|
| }
|
| SkAutoTUnref<sk_tools::PictureRenderer> aurReferenceRenderer(referenceRenderer);
|
|
|
| - success = render_picture_internal(inputPath, NULL, NULL, *referenceRenderer,
|
| + success = render_picture_internal(inputPath, nullptr, nullptr, *referenceRenderer,
|
| &referenceBitmap);
|
|
|
| - if (!success || NULL == referenceBitmap || NULL == referenceBitmap->getPixels()) {
|
| + if (!success || nullptr == referenceBitmap || nullptr == referenceBitmap->getPixels()) {
|
| SkDebugf("Failed to draw the reference picture.\n");
|
| delete bitmap;
|
| delete referenceBitmap;
|
| @@ -363,13 +363,13 @@ static bool render_picture(const SkString& inputPath, const SkString* writePath,
|
| jsonSummaryPtr->add(inputFilename.c_str(), outputFilename.c_str(), imageDigest);
|
| if ((mismatchPath) && !mismatchPath->isEmpty() &&
|
| !jsonSummaryPtr->getExpectation(inputFilename.c_str()).matches(imageDigest)) {
|
| - success &= sk_tools::write_bitmap_to_disk(*bitmap, *mismatchPath, NULL,
|
| + success &= sk_tools::write_bitmap_to_disk(*bitmap, *mismatchPath, nullptr,
|
| outputFilename);
|
| }
|
| }
|
|
|
| if ((writePath) && !writePath->isEmpty()) {
|
| - success &= sk_tools::write_bitmap_to_disk(*bitmap, *writePath, NULL, outputFilename);
|
| + success &= sk_tools::write_bitmap_to_disk(*bitmap, *writePath, nullptr, outputFilename);
|
| }
|
| }
|
| delete bitmap;
|
| @@ -443,7 +443,7 @@ int tool_main(int argc, char** argv) {
|
| SkDebugf("%s\n", errorString.c_str());
|
| }
|
|
|
| - if (renderer.get() == NULL) {
|
| + if (renderer.get() == nullptr) {
|
| exit(-1);
|
| }
|
|
|
| @@ -458,7 +458,7 @@ int tool_main(int argc, char** argv) {
|
| mismatchPath.set(FLAGS_mismatchPath[0]);
|
| }
|
| sk_tools::ImageResultsAndExpectations jsonSummary;
|
| - sk_tools::ImageResultsAndExpectations* jsonSummaryPtr = NULL;
|
| + sk_tools::ImageResultsAndExpectations* jsonSummaryPtr = nullptr;
|
| if (FLAGS_writeJsonSummaryPath.count() == 1) {
|
| jsonSummaryPtr = &jsonSummary;
|
| if (FLAGS_readJsonSummaryPath.count() == 1) {
|
|
|