OLD | NEW |
| 1 |
1 /* | 2 /* |
2 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
3 * | 4 * |
4 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 6 * found in the LICENSE file. |
6 */ | 7 */ |
7 | |
8 #include "Test.h" | 8 #include "Test.h" |
9 | 9 |
10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
11 #include "SkError.h" | 11 #include "SkError.h" |
12 #include "SkString.h" | 12 #include "SkString.h" |
13 #include "SkTArray.h" | 13 #include "SkTArray.h" |
14 #include "SkTime.h" | 14 #include "SkTime.h" |
15 | 15 |
16 #if SK_SUPPORT_GPU | 16 #if SK_SUPPORT_GPU |
17 #include "GrContext.h" | 17 #include "GrContext.h" |
(...skipping 16 matching lines...) Expand all Loading... |
34 void Reporter::reportFailed(const SkString& desc) { | 34 void Reporter::reportFailed(const SkString& desc) { |
35 this->onReportFailed(desc); | 35 this->onReportFailed(desc); |
36 } | 36 } |
37 | 37 |
38 void Reporter::endTest(Test* test) { | 38 void Reporter::endTest(Test* test) { |
39 this->onEnd(test); | 39 this->onEnd(test); |
40 } | 40 } |
41 | 41 |
42 /////////////////////////////////////////////////////////////////////////////// | 42 /////////////////////////////////////////////////////////////////////////////// |
43 | 43 |
44 const char* Test::gResourcePath; | |
45 | |
46 Test::Test() : fReporter(NULL), fPassed(true) {} | 44 Test::Test() : fReporter(NULL), fPassed(true) {} |
47 | 45 |
48 Test::~Test() { | 46 Test::~Test() { |
49 SkSafeUnref(fReporter); | 47 SkSafeUnref(fReporter); |
50 } | 48 } |
51 | 49 |
52 void Test::setReporter(Reporter* r) { | 50 void Test::setReporter(Reporter* r) { |
53 SkRefCnt_SafeAssign(fReporter, r); | 51 SkRefCnt_SafeAssign(fReporter, r); |
54 } | 52 } |
55 | 53 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 114 } |
117 fReporter->endTest(this); | 115 fReporter->endTest(this); |
118 | 116 |
119 } | 117 } |
120 | 118 |
121 SkString Test::GetTmpDir() { | 119 SkString Test::GetTmpDir() { |
122 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; | 120 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; |
123 return SkString(tmpDir); | 121 return SkString(tmpDir); |
124 } | 122 } |
125 | 123 |
126 void Test::SetResourcePath(const char* resourcePath) { | 124 static const char* gResourcePath = NULL; |
127 gResourcePath = resourcePath; | 125 void Test::SetResourcePath(const char* resourcePath) { gResourcePath = resourceP
ath; } |
128 } | |
129 | 126 |
130 SkString Test::GetResourcePath() { | 127 SkString Test::GetResourcePath() { |
131 return SkString(gResourcePath); | 128 return SkString(gResourcePath); |
132 } | 129 } |
OLD | NEW |