| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 here to ensure SK_SUPPORT_GPU is set correctly before it is examined. | 8 // Include here to ensure SK_SUPPORT_GPU is set correctly before it is examined. |
| 9 #include "SkTypes.h" | 9 #include "SkTypes.h" |
| 10 | 10 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 adopted.reset(nullptr); | 214 adopted.reset(nullptr); |
| 215 | 215 |
| 216 context->flush(); | 216 context->flush(); |
| 217 | 217 |
| 218 bool borrowedIsAlive = gpu->isTestingOnlyBackendTexture(texHandles[0]); | 218 bool borrowedIsAlive = gpu->isTestingOnlyBackendTexture(texHandles[0]); |
| 219 bool adoptedIsAlive = gpu->isTestingOnlyBackendTexture(texHandles[1]); | 219 bool adoptedIsAlive = gpu->isTestingOnlyBackendTexture(texHandles[1]); |
| 220 | 220 |
| 221 REPORTER_ASSERT(reporter, borrowedIsAlive); | 221 REPORTER_ASSERT(reporter, borrowedIsAlive); |
| 222 REPORTER_ASSERT(reporter, !adoptedIsAlive); | 222 REPORTER_ASSERT(reporter, !adoptedIsAlive); |
| 223 | 223 |
| 224 gpu->deleteTestingOnlyBackendTexture(texHandles[0]); | 224 gpu->deleteTestingOnlyBackendTexture(texHandles[0], !borrowedIsAlive); |
| 225 gpu->deleteTestingOnlyBackendTexture(texHandles[1], !adoptedIsAlive); |
| 225 | 226 |
| 226 context->resetContext(); | 227 context->resetContext(); |
| 227 } | 228 } |
| 228 | 229 |
| 229 class TestResource : public GrGpuResource { | 230 class TestResource : public GrGpuResource { |
| 230 enum ScratchConstructor { kScratchConstructor }; | 231 enum ScratchConstructor { kScratchConstructor }; |
| 231 public: | 232 public: |
| 232 static const size_t kDefaultSize = 100; | 233 static const size_t kDefaultSize = 100; |
| 233 | 234 |
| 234 /** Property that distinctly categorizes the resource. | 235 /** Property that distinctly categorizes the resource. |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 test_cache_chained_purge(reporter); | 1321 test_cache_chained_purge(reporter); |
| 1321 test_resource_size_changed(reporter); | 1322 test_resource_size_changed(reporter); |
| 1322 test_timestamp_wrap(reporter); | 1323 test_timestamp_wrap(reporter); |
| 1323 test_flush(reporter); | 1324 test_flush(reporter); |
| 1324 test_large_resource_count(reporter); | 1325 test_large_resource_count(reporter); |
| 1325 test_custom_data(reporter); | 1326 test_custom_data(reporter); |
| 1326 test_abandoned(reporter); | 1327 test_abandoned(reporter); |
| 1327 } | 1328 } |
| 1328 | 1329 |
| 1329 #endif | 1330 #endif |
| OLD | NEW |