DDLTileHelper: Use SkAutoTArray instead of raw pointer

Noticed this while poking around.

Change-Id: Ibc371cc3dcf2ed4b1e029ec74b16bb41a4b8e592
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289017
Auto-Submit: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Adlai Holler 2020-05-11 13:33:59 -04:00 committed by Skia Commit-Bot
parent de228e53fe
commit 8e82123bef
2 changed files with 2 additions and 5 deletions

View File

@ -233,9 +233,9 @@ DDLTileHelper::DDLTileHelper(GrContext* context,
const SkIRect& viewport,
int numDivisions)
: fNumDivisions(numDivisions)
, fTiles(numDivisions * numDivisions)
, fDstCharacterization(dstChar) {
SkASSERT(fNumDivisions > 0);
fTiles = new TileData[this->numTiles()];
int xTileSize = viewport.width()/fNumDivisions;
int yTileSize = viewport.height()/fNumDivisions;

View File

@ -97,9 +97,6 @@ public:
const SkSurfaceCharacterization& dstChar,
const SkIRect& viewport,
int numDivisions);
~DDLTileHelper() {
delete[] fTiles;
}
void createSKPPerTile(SkData* compressedPictureData, const DDLPromiseImageHelper& helper);
@ -136,7 +133,7 @@ public:
private:
int fNumDivisions; // number of tiles along a side
TileData* fTiles; // 'fNumDivisions' x 'fNumDivisions'
SkAutoTArray<TileData> fTiles; // 'fNumDivisions' x 'fNumDivisions'
std::unique_ptr<SkDeferredDisplayList> fComposeDDL;