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

Side by Side Diff: tests/skia_test.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/YUVCacheTest.cpp ('k') | tools/CopyTilesRenderer.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 2011 Google Inc. 2 * Copyright 2011 Google Inc.
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 "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "OverwriteLine.h" 9 #include "OverwriteLine.h"
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 int32_t fTestCount; // atomic 69 int32_t fTestCount; // atomic
70 int32_t fFailCount; // atomic 70 int32_t fFailCount; // atomic
71 const int fTotal; 71 const int fTotal;
72 }; 72 };
73 73
74 // Deletes self when run. 74 // Deletes self when run.
75 class SkTestRunnable : public SkRunnable { 75 class SkTestRunnable : public SkRunnable {
76 public: 76 public:
77 SkTestRunnable(const Test& test, 77 SkTestRunnable(const Test& test,
78 Status* status, 78 Status* status,
79 GrContextFactory* grContextFactory = NULL) 79 GrContextFactory* grContextFactory = nullptr)
80 : fTest(test), fStatus(status), fGrContextFactory(grContextFactory) {} 80 : fTest(test), fStatus(status), fGrContextFactory(grContextFactory) {}
81 81
82 virtual void run() { 82 virtual void run() {
83 struct TestReporter : public skiatest::Reporter { 83 struct TestReporter : public skiatest::Reporter {
84 public: 84 public:
85 TestReporter() : fError(false), fTestCount(0) {} 85 TestReporter() : fError(false), fTestCount(0) {}
86 void bumpTestCount() override { ++fTestCount; } 86 void bumpTestCount() override { ++fTestCount; }
87 bool allowExtendedTest() const override { 87 bool allowExtendedTest() const override {
88 return FLAGS_extendedTest; 88 return FLAGS_extendedTest;
89 } 89 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 const Test& test = iter->factory(); 186 const Test& test = iter->factory();
187 if (!should_run(test.name, test.needsGpu)) { 187 if (!should_run(test.name, test.needsGpu)) {
188 ++skipCount; 188 ++skipCount;
189 } else if (test.needsGpu) { 189 } else if (test.needsGpu) {
190 gpuTests.push_back(&test); 190 gpuTests.push_back(&test);
191 } else { 191 } else {
192 cpuTests.add(new SkTestRunnable(test, &status)); 192 cpuTests.add(new SkTestRunnable(test, &status));
193 } 193 }
194 } 194 }
195 195
196 GrContextFactory* grContextFactoryPtr = NULL; 196 GrContextFactory* grContextFactoryPtr = nullptr;
197 #if SK_SUPPORT_GPU 197 #if SK_SUPPORT_GPU
198 // Give GPU tests a context factory if that makes sense on this machine. 198 // Give GPU tests a context factory if that makes sense on this machine.
199 GrContextFactory grContextFactory; 199 GrContextFactory grContextFactory;
200 grContextFactoryPtr = &grContextFactory; 200 grContextFactoryPtr = &grContextFactory;
201 201
202 #endif 202 #endif
203 203
204 // Run GPU tests on this thread. 204 // Run GPU tests on this thread.
205 for (int i = 0; i < gpuTests.count(); i++) { 205 for (int i = 0; i < gpuTests.count(); i++) {
206 (new SkTestRunnable(*gpuTests[i], &status, grContextFactoryPtr))->run(); 206 (new SkTestRunnable(*gpuTests[i], &status, grContextFactoryPtr))->run();
(...skipping 12 matching lines...) Expand all
219 SkDebugf("\n"); 219 SkDebugf("\n");
220 return (status.failCount() == 0) ? 0 : 1; 220 return (status.failCount() == 0) ? 0 : 1;
221 } 221 }
222 222
223 #if !defined(SK_BUILD_FOR_IOS) 223 #if !defined(SK_BUILD_FOR_IOS)
224 int main(int argc, char** argv) { 224 int main(int argc, char** argv) {
225 SkCommandLineFlags::Parse(argc, argv); 225 SkCommandLineFlags::Parse(argc, argv);
226 return test_main(); 226 return test_main();
227 } 227 }
228 #endif 228 #endif
OLDNEW
« no previous file with comments | « tests/YUVCacheTest.cpp ('k') | tools/CopyTilesRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698