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

Unified Diff: src/gpu/GrAtlas.h

Issue 411703003: Add plot-based purging to GrLayerCache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Respond to code review comments Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrLayerCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlas.h
diff --git a/src/gpu/GrAtlas.h b/src/gpu/GrAtlas.h
index 9ccbc53bc605331dcab16725f6658862eb870f3d..1e91d1e90ee111833cf0c3a83fe0c71e4960dce3 100644
--- a/src/gpu/GrAtlas.h
+++ b/src/gpu/GrAtlas.h
@@ -81,6 +81,12 @@ public:
public:
bool isEmpty() const { return 0 == fPlots.count(); }
+#ifdef SK_DEBUG
+ bool contains(const GrPlot* plot) const {
+ return fPlots.contains(const_cast<GrPlot*>(plot));
+ }
+#endif
+
private:
SkTDArray<GrPlot*> fPlots;
@@ -112,6 +118,18 @@ public:
void uploadPlotsToTexture();
+ enum IterOrder {
+ kLRUFirst_IterOrder,
+ kMRUFirst_IterOrder
+ };
+
+ typedef GrPlotList::Iter PlotIter;
+ GrPlot* iterInit(PlotIter* iter, IterOrder order) {
+ return iter->init(fPlotList, kLRUFirst_IterOrder == order
+ ? GrPlotList::Iter::kTail_IterStart
+ : GrPlotList::Iter::kHead_IterStart);
+ }
+
private:
void makeMRU(GrPlot* plot);
« no previous file with comments | « no previous file | src/gpu/GrLayerCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698