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

Side by Side Diff: src/gpu/GrLayerHoister.cpp

Issue 678403002: Discard atlas after every MultiPictureDraw::draw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix rebase error Created 6 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/GrLayerHoister.h ('k') | tests/GpuLayerCacheTest.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 #include "GrLayerCache.h" 8 #include "GrLayerCache.h"
9 #include "GrLayerHoister.h" 9 #include "GrLayerHoister.h"
10 #include "GrRecordReplaceDraw.h" 10 #include "GrRecordReplaceDraw.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 307 }
308 308
309 void GrLayerHoister::UnlockLayers(GrContext* context, 309 void GrLayerHoister::UnlockLayers(GrContext* context,
310 const SkTDArray<GrHoistedLayer>& layers) { 310 const SkTDArray<GrHoistedLayer>& layers) {
311 GrLayerCache* layerCache = context->getLayerCache(); 311 GrLayerCache* layerCache = context->getLayerCache();
312 312
313 for (int i = 0; i < layers.count(); ++i) { 313 for (int i = 0; i < layers.count(); ++i) {
314 layerCache->removeUse(layers[i].fLayer); 314 layerCache->removeUse(layers[i].fLayer);
315 } 315 }
316 316
317 #if DISABLE_CACHING 317 SkDEBUGCODE(layerCache->validate();)
318 }
319
320 void GrLayerHoister::PurgeCache(GrContext* context) {
321 #if !GR_CACHE_HOISTED_LAYERS
322 GrLayerCache* layerCache = context->getLayerCache();
323
318 // This code completely clears out the atlas. It is required when 324 // This code completely clears out the atlas. It is required when
319 // caching is disabled so the atlas doesn't fill up and force more 325 // caching is disabled so the atlas doesn't fill up and force more
320 // free floating layers 326 // free floating layers
321 layerCache->purgeAll(); 327 layerCache->purgeAll();
322 #endif 328 #endif
323
324 SkDEBUGCODE(layerCache->validate();)
325 } 329 }
326
OLDNEW
« no previous file with comments | « src/gpu/GrLayerHoister.h ('k') | tests/GpuLayerCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698