| 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 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
| 9 | 9 |
| 10 #include "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 , fToDelete(NULL) | 79 , fToDelete(NULL) |
| 80 , fSize(kDefaultSize) { | 80 , fSize(kDefaultSize) { |
| 81 this->setScratchKey(scratchKey); | 81 this->setScratchKey(scratchKey); |
| 82 ++fNumAlive; | 82 ++fNumAlive; |
| 83 this->registerWithCache(); | 83 this->registerWithCache(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 ~TestResource() { | 86 ~TestResource() { |
| 87 --fNumAlive; | 87 --fNumAlive; |
| 88 SkSafeUnref(fToDelete); | 88 SkSafeUnref(fToDelete); |
| 89 this->release(); | |
| 90 } | 89 } |
| 91 | 90 |
| 92 void setSize(size_t size) { | 91 void setSize(size_t size) { |
| 93 fSize = size; | 92 fSize = size; |
| 94 this->didChangeGpuMemorySize(); | 93 this->didChangeGpuMemorySize(); |
| 95 } | 94 } |
| 96 | 95 |
| 97 static int NumAlive() { return fNumAlive; } | 96 static int NumAlive() { return fNumAlive; } |
| 98 | 97 |
| 99 void setUnrefWhenDestroyed(TestResource* resource) { | 98 void setUnrefWhenDestroyed(TestResource* resource) { |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 // The below tests create their own mock contexts. | 492 // The below tests create their own mock contexts. |
| 494 test_no_key(reporter); | 493 test_no_key(reporter); |
| 495 test_duplicate_content_key(reporter); | 494 test_duplicate_content_key(reporter); |
| 496 test_duplicate_scratch_key(reporter); | 495 test_duplicate_scratch_key(reporter); |
| 497 test_purge_invalidated(reporter); | 496 test_purge_invalidated(reporter); |
| 498 test_cache_chained_purge(reporter); | 497 test_cache_chained_purge(reporter); |
| 499 test_resource_size_changed(reporter); | 498 test_resource_size_changed(reporter); |
| 500 } | 499 } |
| 501 | 500 |
| 502 #endif | 501 #endif |
| OLD | NEW |