OLD | NEW |
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 "Test.h" | 8 #include "Test.h" |
9 // This is a GPU-backend specific test | 9 // This is a GPU-backend specific test |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 typedef A INHERITED; | 99 typedef A INHERITED; |
100 }; | 100 }; |
101 | 101 |
102 // D derives from C and owns a dynamically created B | 102 // D derives from C and owns a dynamically created B |
103 class D : public C { | 103 class D : public C { |
104 public: | 104 public: |
105 D() { | 105 D() { |
106 fB = new B(); | 106 fB = new B(); |
107 } | 107 } |
108 virtual void setValues(int v) { | 108 virtual void setValues(int v) { |
109 fVoidStar = reinterpret_cast<void*>(v); | 109 fVoidStar = reinterpret_cast<void*>(static_cast<intptr_t>(v)); |
110 this->INHERITED::setValues(v); | 110 this->INHERITED::setValues(v); |
111 fB->setValues(v); | 111 fB->setValues(v); |
112 } | 112 } |
113 virtual bool checkValues(int v) { | 113 virtual bool checkValues(int v) { |
114 return fVoidStar == reinterpret_cast<void*>(v) && | 114 return fVoidStar == reinterpret_cast<void*>(static_cast<intptr_t>(v)) && |
115 fB->checkValues(v) && | 115 fB->checkValues(v) && |
116 this->INHERITED::checkValues(v); | 116 this->INHERITED::checkValues(v); |
117 } | 117 } |
118 virtual ~D() { | 118 virtual ~D() { |
119 delete fB; | 119 delete fB; |
120 } | 120 } |
121 private: | 121 private: |
122 void* fVoidStar; | 122 void* fVoidStar; |
123 B* fB; | 123 B* fB; |
124 | 124 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 for (int i = 0; i < instanceRecs.count(); ++i) { | 221 for (int i = 0; i < instanceRecs.count(); ++i) { |
222 Rec& rec = instanceRecs[i]; | 222 Rec& rec = instanceRecs[i]; |
223 REPORTER_ASSERT(reporter, rec.fInstance->checkValues(rec.fValue)
); | 223 REPORTER_ASSERT(reporter, rec.fInstance->checkValues(rec.fValue)
); |
224 delete rec.fInstance; | 224 delete rec.fInstance; |
225 } | 225 } |
226 } | 226 } |
227 } | 227 } |
228 } | 228 } |
229 | 229 |
230 #endif | 230 #endif |
OLD | NEW |