OLD | NEW |
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 25 matching lines...) Expand all Loading... |
36 GrLayerCache* cache, | 36 GrLayerCache* cache, |
37 const SkPicture& picture, | 37 const SkPicture& picture, |
38 unsigned numToAdd, | 38 unsigned numToAdd, |
39 unsigned idOffset) { | 39 unsigned idOffset) { |
40 | 40 |
41 for (unsigned i = 0; i < numToAdd; ++i) { | 41 for (unsigned i = 0; i < numToAdd; ++i) { |
42 unsigned indices[1] = { idOffset+i+1 }; | 42 unsigned indices[1] = { idOffset+i+1 }; |
43 GrCachedLayer* layer = cache->findLayerOrCreate(picture.uniqueID(), | 43 GrCachedLayer* layer = cache->findLayerOrCreate(picture.uniqueID(), |
44 idOffset+i+1, idOffset+i
+2, | 44 idOffset+i+1, idOffset+i
+2, |
45 SkIRect::MakeEmpty(), | 45 SkIRect::MakeEmpty(), |
46 SkIRect::MakeEmpty(), | |
47 SkMatrix::I(), | 46 SkMatrix::I(), |
48 indices, 1, | 47 indices, 1, |
49 NULL); | 48 NULL); |
50 REPORTER_ASSERT(reporter, layer); | 49 REPORTER_ASSERT(reporter, layer); |
51 GrCachedLayer* temp = TestingAccess::Find(cache, picture.uniqueID(), SkM
atrix::I(), | 50 GrCachedLayer* temp = TestingAccess::Find(cache, picture.uniqueID(), SkM
atrix::I(), |
52 indices, 1); | 51 indices, 1); |
53 REPORTER_ASSERT(reporter, temp == layer); | 52 REPORTER_ASSERT(reporter, temp == layer); |
54 | 53 |
55 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(cache) == idOffset +
i + 1); | 54 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(cache) == idOffset +
i + 1); |
56 | 55 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 240 |
242 picture.reset(NULL); | 241 picture.reset(NULL); |
243 cache.processDeletedPictures(); | 242 cache.processDeletedPictures(); |
244 | 243 |
245 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0); | 244 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0); |
246 // TODO: add VRAM/resource cache check here | 245 // TODO: add VRAM/resource cache check here |
247 } | 246 } |
248 } | 247 } |
249 | 248 |
250 #endif | 249 #endif |
OLD | NEW |