| 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 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 static void test_abandoned(skiatest::Reporter* reporter) { | 1289 static void test_abandoned(skiatest::Reporter* reporter) { |
| 1290 Mock mock(10, 300); | 1290 Mock mock(10, 300); |
| 1291 GrContext* context = mock.context(); | 1291 GrContext* context = mock.context(); |
| 1292 SkAutoTUnref<GrGpuResource> resource(new TestResource(context->getGpu())); | 1292 SkAutoTUnref<GrGpuResource> resource(new TestResource(context->getGpu())); |
| 1293 context->abandonContext(); | 1293 context->abandonContext(); |
| 1294 | 1294 |
| 1295 REPORTER_ASSERT(reporter, resource->wasDestroyed()); | 1295 REPORTER_ASSERT(reporter, resource->wasDestroyed()); |
| 1296 | 1296 |
| 1297 // Call all the public methods on resource in the abandoned state. They shou
ldn't crash. | 1297 // Call all the public methods on resource in the abandoned state. They shou
ldn't crash. |
| 1298 | 1298 |
| 1299 resource->getUniqueID(); | 1299 resource->uniqueID(); |
| 1300 resource->getUniqueKey(); | 1300 resource->getUniqueKey(); |
| 1301 resource->wasDestroyed(); | 1301 resource->wasDestroyed(); |
| 1302 resource->gpuMemorySize(); | 1302 resource->gpuMemorySize(); |
| 1303 resource->getContext(); | 1303 resource->getContext(); |
| 1304 | 1304 |
| 1305 resource->abandon(); | 1305 resource->abandon(); |
| 1306 resource->resourcePriv().getScratchKey(); | 1306 resource->resourcePriv().getScratchKey(); |
| 1307 resource->resourcePriv().isBudgeted(); | 1307 resource->resourcePriv().isBudgeted(); |
| 1308 resource->resourcePriv().makeBudgeted(); | 1308 resource->resourcePriv().makeBudgeted(); |
| 1309 resource->resourcePriv().makeUnbudgeted(); | 1309 resource->resourcePriv().makeUnbudgeted(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1328 test_cache_chained_purge(reporter); | 1328 test_cache_chained_purge(reporter); |
| 1329 test_resource_size_changed(reporter); | 1329 test_resource_size_changed(reporter); |
| 1330 test_timestamp_wrap(reporter); | 1330 test_timestamp_wrap(reporter); |
| 1331 test_flush(reporter); | 1331 test_flush(reporter); |
| 1332 test_large_resource_count(reporter); | 1332 test_large_resource_count(reporter); |
| 1333 test_custom_data(reporter); | 1333 test_custom_data(reporter); |
| 1334 test_abandoned(reporter); | 1334 test_abandoned(reporter); |
| 1335 } | 1335 } |
| 1336 | 1336 |
| 1337 #endif | 1337 #endif |
| OLD | NEW |