| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 REPORTER_ASSERT(reporter, !layer->isAtlased()); | 54 REPORTER_ASSERT(reporter, !layer->isAtlased()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 cache->trackPicture(&picture); | 57 cache->trackPicture(&picture); |
| 58 } | 58 } |
| 59 | 59 |
| 60 static void lock_layer(skiatest::Reporter* reporter, | 60 static void lock_layer(skiatest::Reporter* reporter, |
| 61 GrLayerCache* cache, | 61 GrLayerCache* cache, |
| 62 GrCachedLayer* layer) { | 62 GrCachedLayer* layer) { |
| 63 // Make the layer 512x512 (so it can be atlased) | 63 // Make the layer 512x512 (so it can be atlased) |
| 64 GrTextureDesc desc; | 64 GrSurfaceDesc desc; |
| 65 desc.fWidth = 512; | 65 desc.fWidth = 512; |
| 66 desc.fHeight = 512; | 66 desc.fHeight = 512; |
| 67 desc.fConfig = kSkia8888_GrPixelConfig; | 67 desc.fConfig = kSkia8888_GrPixelConfig; |
| 68 | 68 |
| 69 bool needsRerendering; | 69 bool needsRerendering; |
| 70 bool inAtlas = cache->tryToAtlas(layer, desc, &needsRerendering); | 70 bool inAtlas = cache->tryToAtlas(layer, desc, &needsRerendering); |
| 71 if (!inAtlas) { | 71 if (!inAtlas) { |
| 72 cache->lock(layer, desc, &needsRerendering); | 72 cache->lock(layer, desc, &needsRerendering); |
| 73 } | 73 } |
| 74 REPORTER_ASSERT(reporter, needsRerendering); | 74 REPORTER_ASSERT(reporter, needsRerendering); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 picture.reset(NULL); | 218 picture.reset(NULL); |
| 219 cache.processDeletedPictures(); | 219 cache.processDeletedPictures(); |
| 220 | 220 |
| 221 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0); | 221 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0); |
| 222 // TODO: add VRAM/resource cache check here | 222 // TODO: add VRAM/resource cache check here |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 | 225 |
| 226 #endif | 226 #endif |
| OLD | NEW |