Fix for segfault on destruction of BitmapTextBlob
BUG=skia:
Review URL: https://codereview.chromium.org/1065773005
diff --git a/src/gpu/GrBatchAtlas.h b/src/gpu/GrBatchAtlas.h
index 2b85da1..7a89f78 100644
--- a/src/gpu/GrBatchAtlas.h
+++ b/src/gpu/GrBatchAtlas.h
@@ -90,19 +90,12 @@
void set(int index) {
SkASSERT(!this->find(index));
fPlotAlreadyUpdated = fPlotAlreadyUpdated | (1 << index);
- if (fCount < fAllocated) {
- fPlotsToUpdate[fCount++] = index;
- } else {
- // This case will almost never happen
- fAllocated = fCount << 1;
- fPlotsToUpdate.realloc(fAllocated);
- fPlotsToUpdate[fCount++] = index;
- }
+ fPlotsToUpdate.push_back(index);
}
static const int kMinItems = 4;
static const int kMaxPlots = 32;
- SkAutoSTMalloc<kMinItems, int> fPlotsToUpdate;
+ SkSTArray<kMinItems, int, true> fPlotsToUpdate;
uint32_t fPlotAlreadyUpdated;
int fCount;
int fAllocated;