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(), |
46 SkMatrix::I(), | 47 SkMatrix::I(), |
47 indices, 1, | 48 indices, 1, |
48 NULL); | 49 NULL); |
49 REPORTER_ASSERT(reporter, layer); | 50 REPORTER_ASSERT(reporter, layer); |
50 GrCachedLayer* temp = TestingAccess::Find(cache, picture.uniqueID(), SkM
atrix::I(), | 51 GrCachedLayer* temp = TestingAccess::Find(cache, picture.uniqueID(), SkM
atrix::I(), |
51 indices, 1); | 52 indices, 1); |
52 REPORTER_ASSERT(reporter, temp == layer); | 53 REPORTER_ASSERT(reporter, temp == layer); |
53 | 54 |
54 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(cache) == idOffset +
i + 1); | 55 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(cache) == idOffset +
i + 1); |
55 | 56 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 241 |
241 picture.reset(NULL); | 242 picture.reset(NULL); |
242 cache.processDeletedPictures(); | 243 cache.processDeletedPictures(); |
243 | 244 |
244 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0); | 245 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0); |
245 // TODO: add VRAM/resource cache check here | 246 // TODO: add VRAM/resource cache check here |
246 } | 247 } |
247 } | 248 } |
248 | 249 |
249 #endif | 250 #endif |
OLD | NEW |