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

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

Issue 687233002: Revert of Discard atlas after every MultiPictureDraw::draw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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') | no next file » | 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 SkDEBUGCODE(layerCache->validate();) 317 #if DISABLE_CACHING
318 }
319
320 void GrLayerHoister::PurgeCache(GrContext* context) {
321 #if !GR_CACHE_HOISTED_LAYERS
322 GrLayerCache* layerCache = context->getLayerCache();
323
324 // This code completely clears out the atlas. It is required when 318 // This code completely clears out the atlas. It is required when
325 // caching is disabled so the atlas doesn't fill up and force more 319 // caching is disabled so the atlas doesn't fill up and force more
326 // free floating layers 320 // free floating layers
327 layerCache->purgeAll(); 321 layerCache->purgeAll();
328 #endif 322 #endif
323
324 SkDEBUGCODE(layerCache->validate();)
329 } 325 }
326
OLDNEW
« no previous file with comments | « src/gpu/GrLayerHoister.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698