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

Side by Side Diff: tests/PDFPrimitivesTest.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, 3 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 unified diff | Download patch
« no previous file with comments | « tests/PDFJpegEmbedTest.cpp ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 The Android Open Source Project 2 * Copyright 2010 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 14 matching lines...) Expand all
25 #define DUMMY_TEXT "DCT compessed stream." 25 #define DUMMY_TEXT "DCT compessed stream."
26 26
27 namespace { 27 namespace {
28 struct Catalog { 28 struct Catalog {
29 SkPDFSubstituteMap substitutes; 29 SkPDFSubstituteMap substitutes;
30 SkPDFObjNumMap numbers; 30 SkPDFObjNumMap numbers;
31 }; 31 };
32 } // namespace 32 } // namespace
33 33
34 template <typename T> 34 template <typename T>
35 static SkString emit_to_string(T& obj, Catalog* catPtr = NULL) { 35 static SkString emit_to_string(T& obj, Catalog* catPtr = nullptr) {
36 Catalog catalog; 36 Catalog catalog;
37 SkDynamicMemoryWStream buffer; 37 SkDynamicMemoryWStream buffer;
38 if (!catPtr) { 38 if (!catPtr) {
39 catPtr = &catalog; 39 catPtr = &catalog;
40 } 40 }
41 obj.emitObject(&buffer, catPtr->numbers, catPtr->substitutes); 41 obj.emitObject(&buffer, catPtr->numbers, catPtr->substitutes);
42 SkAutoTDelete<SkStreamAsset> asset(buffer.detachAsStream()); 42 SkAutoTDelete<SkStreamAsset> asset(buffer.detachAsStream());
43 SkString tmp(asset->getLength()); 43 SkString tmp(asset->getLength());
44 asset->read(tmp.writable_str(), asset->getLength()); 44 asset->read(tmp.writable_str(), asset->getLength());
45 return tmp; 45 return tmp;
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 TestObjectNumberMap(reporter); 357 TestObjectNumberMap(reporter);
358 TestObjectRef(reporter); 358 TestObjectRef(reporter);
359 TestSubstitute(reporter); 359 TestSubstitute(reporter);
360 test_issue1083(); 360 test_issue1083();
361 } 361 }
362 362
363 namespace { 363 namespace {
364 364
365 class DummyImageFilter : public SkImageFilter { 365 class DummyImageFilter : public SkImageFilter {
366 public: 366 public:
367 DummyImageFilter(bool visited = false) : SkImageFilter(0, NULL), fVisited(vi sited) {} 367 DummyImageFilter(bool visited = false) : SkImageFilter(0, nullptr), fVisited (visited) {}
368 ~DummyImageFilter() override {} 368 ~DummyImageFilter() override {}
369 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, 369 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
370 SkBitmap* result, SkIPoint* offset) const overrid e { 370 SkBitmap* result, SkIPoint* offset) const overrid e {
371 fVisited = true; 371 fVisited = true;
372 offset->fX = offset->fY = 0; 372 offset->fX = offset->fY = 0;
373 *result = src; 373 *result = src;
374 return true; 374 return true;
375 } 375 }
376 SK_TO_STRING_OVERRIDE() 376 SK_TO_STRING_OVERRIDE()
377 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DummyImageFilter) 377 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DummyImageFilter)
(...skipping 30 matching lines...) Expand all
408 // Filter just created; should be unvisited. 408 // Filter just created; should be unvisited.
409 REPORTER_ASSERT(reporter, !filter->visited()); 409 REPORTER_ASSERT(reporter, !filter->visited());
410 SkPaint paint; 410 SkPaint paint;
411 paint.setImageFilter(filter.get()); 411 paint.setImageFilter(filter.get());
412 canvas->drawRect(SkRect::MakeWH(100, 100), paint); 412 canvas->drawRect(SkRect::MakeWH(100, 100), paint);
413 doc->close(); 413 doc->close();
414 414
415 // Filter was used in rendering; should be visited. 415 // Filter was used in rendering; should be visited.
416 REPORTER_ASSERT(reporter, filter->visited()); 416 REPORTER_ASSERT(reporter, filter->visited());
417 } 417 }
OLDNEW
« no previous file with comments | « tests/PDFJpegEmbedTest.cpp ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698