Revert of Fix bug in plot locking system (patchset #3 id:80001 of https://codereview.chromium.org/640323002/)
Reason for revert:
Failing unit tests
Original issue's description:
> Fix bug in plot locking system
>
> In the new MultiPictureDraw tests a single hoisted layer is reused multiple times. The previous plot locking scheme allowed GrCachedLayer objects to be aggressively deleted prematurely leaving the reusing GrHoistedLayer objects with dangling pointers.
>
> This CL changes the plot locking system to add a pseudo-ref for each GrHoistedLayer.
>
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/5c481666c9678f43e039ad605457be3854cf8de3
TBR=jvanverth@google.com
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/643673004
diff --git a/src/gpu/GrLayerCache.h b/src/gpu/GrLayerCache.h
index 7bc98b0..790b82a 100644
--- a/src/gpu/GrLayerCache.h
+++ b/src/gpu/GrLayerCache.h
@@ -231,10 +231,9 @@
// This implements a plot-centric locking mechanism (since the atlas
// backing texture is always locked). Each layer that is locked (i.e.,
// needed for the current rendering) in a plot increments the plot lock
- // count for that plot for each time it is used. Similarly, once a
- // rendering is complete all the layers used in it decrement the lock
- // count for the used plots. Plots with a 0 lock count are open for
- // recycling/purging.
+ // count for that plot. Similarly, once a rendering is complete all the
+ // layers used in it decrement the lock count for the used plots.
+ // Plots with a 0 lock count are open for recycling/purging.
int fPlotLocks[kNumPlotsX * kNumPlotsY];
void initAtlas();
@@ -256,12 +255,6 @@
// was purged; false otherwise.
bool purgePlot();
- void incPlotLock(int plotIdx) { ++fPlotLocks[plotIdx]; }
- void decPlotLock(int plotIdx) {
- SkASSERT(fPlotLocks[plotIdx] > 0);
- --fPlotLocks[plotIdx];
- }
-
// for testing
friend class TestingAccess;
int numLayers() const { return fLayerHash.count(); }