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

Side by Side Diff: tests/ResourceCacheTest.cpp

Issue 488463004: Revert of Make GrGpuResources register with GrResourceCache2 after fully constructed. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months 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/GrGLVertexBuffer.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 "GrContextFactory.h" 10 #include "GrContextFactory.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 static const size_t kDefaultSize = 100; 62 static const size_t kDefaultSize = 100;
63 63
64 public: 64 public:
65 SK_DECLARE_INST_COUNT(TestResource); 65 SK_DECLARE_INST_COUNT(TestResource);
66 TestResource(GrGpu* gpu, size_t size = kDefaultSize) 66 TestResource(GrGpu* gpu, size_t size = kDefaultSize)
67 : INHERITED(gpu, false) 67 : INHERITED(gpu, false)
68 , fCache(NULL) 68 , fCache(NULL)
69 , fToDelete(NULL) 69 , fToDelete(NULL)
70 , fSize(size) { 70 , fSize(size) {
71 ++fAlive; 71 ++fAlive;
72 this->registerWithCache();
73 } 72 }
74 73
75 ~TestResource() { 74 ~TestResource() {
76 --fAlive; 75 --fAlive;
77 if (NULL != fToDelete) { 76 if (NULL != fToDelete) {
78 // Breaks our little 2-element cycle below. 77 // Breaks our little 2-element cycle below.
79 fToDelete->setDeleteWhenDestroyed(NULL, NULL); 78 fToDelete->setDeleteWhenDestroyed(NULL, NULL);
80 fCache->deleteResource(fToDelete->getCacheEntry()); 79 fCache->deleteResource(fToDelete->getCacheEntry());
81 } 80 }
82 this->release(); 81 this->release();
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 SkCanvas canvas(device.get()); 301 SkCanvas canvas(device.get());
303 302
304 test_cache(reporter, context, &canvas); 303 test_cache(reporter, context, &canvas);
305 test_purge_invalidated(reporter, context); 304 test_purge_invalidated(reporter, context);
306 test_cache_delete_on_destruction(reporter, context); 305 test_cache_delete_on_destruction(reporter, context);
307 test_resource_size_changed(reporter, context); 306 test_resource_size_changed(reporter, context);
308 } 307 }
309 } 308 }
310 309
311 #endif 310 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLVertexBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698