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

Side by Side Diff: tests/ResourceCacheTest.cpp

Issue 1433353005: Fix leaks in unit tests of GrGLTextureInfos (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/GrGLGpu.cpp ('k') | tests/SurfaceTest.cpp » ('j') | 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 // 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
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
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
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698