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

Side by Side Diff: tests/GpuLayerCacheTest.cpp

Issue 751663002: Remove Picture deletion listeners. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: f Created 6 years 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/utils/SkPictureUtils.cpp ('k') | tests/PictureTest.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 2014 Google Inc. 2 * Copyright 2014 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(cache) == idOffset + i + 1); 47 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(cache) == idOffset + i + 1);
48 48
49 REPORTER_ASSERT(reporter, picture.uniqueID() == layer->pictureID()); 49 REPORTER_ASSERT(reporter, picture.uniqueID() == layer->pictureID());
50 REPORTER_ASSERT(reporter, layer->start() == idOffset + i + 1); 50 REPORTER_ASSERT(reporter, layer->start() == idOffset + i + 1);
51 REPORTER_ASSERT(reporter, layer->stop() == idOffset + i + 2); 51 REPORTER_ASSERT(reporter, layer->stop() == idOffset + i + 2);
52 REPORTER_ASSERT(reporter, NULL == layer->texture()); 52 REPORTER_ASSERT(reporter, NULL == layer->texture());
53 REPORTER_ASSERT(reporter, NULL == layer->paint()); 53 REPORTER_ASSERT(reporter, NULL == layer->paint());
54 REPORTER_ASSERT(reporter, !layer->isAtlased()); 54 REPORTER_ASSERT(reporter, !layer->isAtlased());
55 } 55 }
56
57 cache->trackPicture(&picture);
58 } 56 }
59 57
60 static void lock_layer(skiatest::Reporter* reporter, 58 static void lock_layer(skiatest::Reporter* reporter,
61 GrLayerCache* cache, 59 GrLayerCache* cache,
62 GrCachedLayer* layer) { 60 GrCachedLayer* layer) {
63 // Make the layer 512x512 (so it can be atlased) 61 // Make the layer 512x512 (so it can be atlased)
64 GrSurfaceDesc desc; 62 GrSurfaceDesc desc;
65 desc.fWidth = 512; 63 desc.fWidth = 512;
66 desc.fHeight = 512; 64 desc.fHeight = 512;
67 desc.fConfig = kSkia8888_GrPixelConfig; 65 desc.fConfig = kSkia8888_GrPixelConfig;
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 225
228 picture.reset(NULL); 226 picture.reset(NULL);
229 cache.processDeletedPictures(); 227 cache.processDeletedPictures();
230 228
231 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0); 229 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0);
232 // TODO: add VRAM/resource cache check here 230 // TODO: add VRAM/resource cache check here
233 } 231 }
234 } 232 }
235 233
236 #endif 234 #endif
OLDNEW
« no previous file with comments | « src/utils/SkPictureUtils.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698