Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(762)

Side by Side Diff: tests/ResourceCacheTest.cpp

Issue 729683002: Make GrResourceCache2 responsible for calling release, abandon, and ~. (Closed) Base URL: https://skia.googlesource.com/skia.git@revrev
Patch Set: tiny cleanup Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698