diff options
author | Jim Van Verth <jvanverth@google.com> | 2017-09-28 15:04:00 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-28 19:38:42 +0000 |
commit | c3269aea5ba61a0c2228b029c7626802474825f4 (patch) | |
tree | d568b551ab3382d2c9214451196c321f4dd797b4 /src/gpu/GrDrawOpAtlas.h | |
parent | 4e66d35fc38d45040827478f41e731e62ef75e0a (diff) |
Miscellaneous dynamic atlas fixes.
Make Chinese fling sample closer to Android test.
Fix a bug in GrDrawOpAtlas::compact(), where the atlas
generation wasn't incremented so the client didn't know it changed.
Add some debug info for GrDrawOpAtlas.
Add a comment in GrDrawOpAtlas::setLastUseTokenBulk.
Change-Id: I79192a017870541a79731b1a22f665ec5deeff09
Reviewed-on: https://skia-review.googlesource.com/52761
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrDrawOpAtlas.h')
-rw-r--r-- | src/gpu/GrDrawOpAtlas.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gpu/GrDrawOpAtlas.h b/src/gpu/GrDrawOpAtlas.h index 2031d2e60b..647e6a58b9 100644 --- a/src/gpu/GrDrawOpAtlas.h +++ b/src/gpu/GrDrawOpAtlas.h @@ -195,6 +195,8 @@ public: int count = updater.fPlotsToUpdate.count(); for (int i = 0; i < count; i++) { const BulkUseTokenUpdater::PlotData& pd = updater.fPlotsToUpdate[i]; + // it's possible we've added a plot to the updater and subsequently the plot's page + // was deleted -- so we check to prevent a crash if (pd.fPageIndex < fNumPages) { Plot* plot = fPages[pd.fPageIndex].fPlotArray[pd.fPlotIndex].get(); this->makeMRU(plot, pd.fPageIndex); @@ -342,7 +344,11 @@ private: bool createNewPage(); void deleteLastPage(); - inline void processEviction(AtlasID); + void processEviction(AtlasID); + inline void processEvictionAndResetRects(Plot* plot) { + this->processEviction(plot->id()); + plot->resetRects(); + } GrContext* fContext; GrPixelConfig fPixelConfig; |