Add additional clean up code in MPD path

This addresses an edge case where a picture only has one layer which is atlasable but doesn't make it into the atlas. In this case asserts can fire since there is no atlased layer to clean up the tracking picture object.

Review URL: https://codereview.chromium.org/764393002
This commit is contained in:
robertphillips 2014-12-01 11:39:59 -08:00 committed by Commit bot
parent ca92fbd029
commit bc0c4bd9df

View File

@ -226,6 +226,11 @@ bool GrLayerCache::tryToAtlas(GrCachedLayer* layer,
break; // We weren't able to purge any plots
}
}
if (pictInfo->fPlotUsage.isEmpty()) {
fPictureHash.remove(pictInfo->fPictureID);
SkDELETE(pictInfo);
}
}
return false;