Update how the GrSmallPathRenderer's cache entries are created and destroyed
The main thrust of this CL is to centralize creation and deletion
of the small path renderer's cache entries within the nascent
GrSmallPathAtlasMgr class.
It is pulled out of the omnibus CL:
https://skia-review.googlesource.com/c/skia/+/307776 (Split the small path renderer into record-time and flush-time pieces)
Change-Id: I13ccaca428e8c019540624dbcd0703540418f9a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308691
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrDrawOpAtlas.h b/src/gpu/GrDrawOpAtlas.h
index ead1ede..a6d1c4e 100644
--- a/src/gpu/GrDrawOpAtlas.h
+++ b/src/gpu/GrDrawOpAtlas.h
@@ -87,6 +87,12 @@
return fGenID != 0 || fPlotIndex != 0 || fPageIndex != 0;
}
+ void makeInvalid() {
+ fGenID = 0;
+ fPlotIndex = 0;
+ fPageIndex = 0;
+ }
+
bool operator==(const PlotLocator& other) const {
return fGenID == other.fGenID &&
fPlotIndex == other.fPlotIndex &&
@@ -108,6 +114,8 @@
public:
std::array<uint16_t, 4> getUVs() const;
+ void invalidatePlotLocator() { fPlotLocator.makeInvalid(); }
+
// TODO: Remove the small path renderer's use of this for eviction
PlotLocator plotLocator() const { return fPlotLocator; }